+ // Run all post-commit callbacks in a separate step
+ $e = $this->executePostTransactionCallbacks();
+ $this->trxRoundStage = self::ROUND_CURSORY;
+ // Throw any last post-commit callback error
+ if ( $e instanceof Exception ) {
+ throw $e;
+ }
+ }
+
+ final public function rollbackMasterChanges( $fname = __METHOD__ ) {
+ $this->trxRoundStage = self::ROUND_ROLLING_BACK;
+ $this->trxRoundId = false;
+ // Actually perform the rollback on all master DB connections and revert DBO_TRX
+ $this->forEachLBCallMethod( 'rollbackMasterChanges', [ $fname ] );
+ // Run all post-commit callbacks in a separate step
+ $this->executePostTransactionCallbacks();
+ $this->trxRoundStage = self::ROUND_CURSORY;
+ }
+
+ /**
+ * @return Exception|null
+ */
+ private function executePostTransactionCallbacks() {