Merge "rdbms: merge isClean() into popAtomicLevels() in TransactionManager"

This commit is contained in:
jenkins-bot 2024-09-07 03:58:13 +00:00 committed by Gerrit Code Review
commit 64475f3edf
2 changed files with 5 additions and 4 deletions

View file

@ -2164,10 +2164,10 @@ abstract class Database implements Stringable, IDatabaseForOwner, IMaintainableD
$cs = $this->commenceCriticalSection( __METHOD__ );
// Remove the last section (no need to re-index the array)
$this->transactionManager->popAtomicLevel();
$finalLevelOfImplicitTrxPopped = $this->transactionManager->popAtomicLevel();
try {
if ( $this->transactionManager->isClean() ) {
if ( $finalLevelOfImplicitTrxPopped ) {
$this->commit( $fname, self::FLUSHING_INTERNAL );
$runPostCommitCallbacks = true;
} elseif ( $savepointId !== null && $savepointId !== self::NOT_APPLICABLE ) {

View file

@ -523,11 +523,12 @@ class TransactionManager {
return [ $savedFname, $excisedIds, $newTopSection, $savedSectionId, $savepointId ];
}
/**
* @return bool Whether no levels remain and transaction was started by a popped level
*/
public function popAtomicLevel() {
array_pop( $this->trxAtomicLevels );
}
public function isClean() {
return !$this->trxAtomicLevels && $this->trxAutomaticAtomic;
}