*/
private $mTrxAutomaticAtomic = false;
+ /**
+ * Track the write query callers of the current transaction
+ *
+ * @var string[]
+ */
+ private $mTrxWriteCallers = array();
+
/**
* Track the seconds spent in write queries for the current transaction
*
return $this->mTrxLevel ? $this->mTrxWriteDuration : false;
}
+ public function pendingWriteCallers() {
+ return $this->mTrxLevel ? $this->mTrxWriteCallers : array();
+ }
+
public function isOpen() {
return $this->mOpened;
}
if ( $isWriteQuery && $this->mTrxLevel ) {
$this->mTrxWriteDuration += $queryRuntime;
+ $this->mTrxWriteCallers[] = $fname;
}
return $res;
$this->mTrxPreCommitCallbacks = array();
$this->mTrxShortId = wfRandomString( 12 );
$this->mTrxWriteDuration = 0.0;
+ $this->mTrxWriteCallers = array();
// First SELECT after BEGIN will establish the snapshot in REPEATABLE-READ.
// Get an estimate of the slave lag before then, treating estimate staleness
// as lag itself just to be safe
if ( !$this->mTrxLevel ) {
wfWarn( "$fname: No transaction to rollback, something got out of sync!" );
return; // nothing to do
- } elseif ( $this->mTrxAutomatic ) {
- wfWarn( "$fname: Explicit rollback of implicit transaction. Something may be out of sync!" );
}
} else {
if ( !$this->mTrxLevel ) {
return; // nothing to do
- } elseif ( !$this->mTrxAutomatic ) {
- wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" );
}
}