}
/**
- * Get the list of method names that have pending write queries or that
- * have transaction callbacks that have yet to run
+ * List the methods that have write queries or callbacks for the current transaction
*
- * @return array
+ * This method should not be used outside of Database/LoadBalancer
+ *
+ * @return string[]
+ * @since 1.32
*/
- protected function pendingWriteAndCallbackCallers() {
+ public function pendingWriteAndCallbackCallers() {
$fnames = $this->pendingWriteCallers();
foreach ( [
$this->trxIdleCallbacks,
if ( $conn->writesPending() ) {
// A callback from another handle wrote to this one and DBO_TRX is set
$this->queryLogger->warning( __METHOD__ . ": found writes pending." );
+ $fnames = implode( ', ', $conn->pendingWriteAndCallbackCallers() );
+ $this->queryLogger->warning(
+ __METHOD__ . ": found writes pending ($fnames).",
+ [
+ 'db_server' => $conn->getServer(),
+ 'db_name' => $conn->getDBname()
+ ]
+ );
} elseif ( $conn->trxLevel() ) {
// A callback from another handle read from this one and DBO_TRX is set,
// which can easily happen if there is only one DB (no replicas)