X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabase.php;h=523f7cd462f8adaeec38ac3b469054f8955ba772;hp=00d9b0b33d9aaf08b554dbf41871f97c82e04b45;hb=ea37a9b65d4b4040f0ffedafa3d2813ebef28a90;hpb=0b2b8e94cd306195a6999c122184b92d4d643f83 diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 00d9b0b33d..523f7cd462 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -3392,10 +3392,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $this->trxWriteAdjQueryCount = 0; $this->trxWriteCallers = []; // First SELECT after BEGIN will establish the snapshot in REPEATABLE-READ. - // Get an estimate of the replica DB lag before then, treating estimate staleness - // as lag itself just to be safe - $status = $this->getApproximateLagStatus(); - $this->trxReplicaLag = $status['lag'] + ( microtime( true ) - $status['since'] ); + // Get an estimate of the replication lag before any such queries. + $this->trxReplicaLag = $this->getApproximateLagStatus()['lag']; // T147697: make explicitTrxActive() return true until begin() finishes. This way, no // caller will think its OK to muck around with the transaction just because startAtomic() // has not yet completed (e.g. setting trxAtomicLevels).