HomePhabricator

[Database] Fixed case where trx idle callbacks might be lost.
60cc0607084bUnpublished

Authored by aaron.

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

[Database] Fixed case where trx idle callbacks might be lost.

  • (bug 41656) LoadBalancer always commits if there are callbacks pending. This works by checking a new DatabaseBase::writesOrCallbacksPending() function.
  • Made transaction idle callbacks run in autocommit mode. Generally callers already want autocommit mode or do quick begin()/commit() calls anyway. The docs already state that callbacks should close any connections they start, but this makes it harder for people to forget about implicit transactions. Since the callbacks often may happen in commitMasterChanges(), if transactions are left open, they might not get committed by anything afterwards.
  • Added sanity exceptions and warnings if callbacks get lost for some reason.
  • Renamed trxIdleCallbacks -> mTrxIdleCallbacks for consistency.

Change-Id: I00e1e0fcdd7deeee1fbac6d0f295160479cb8962

Details

Committed
aaronNov 17 2012, 7:43 PM
Parents
rMW44edaa25a9bb: Commit changes from tarball for 1.20 to REL1_20
Branches
Unknown
Tags
Unknown
References
refs/changes/18/33818/2
ChangeId
I00e1e0fcdd7deeee1fbac6d0f295160479cb8962