fix(db): Execute dirty reads on the primary node

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/42933/head
Christoph Wurst 2 years ago
parent e0053e1c06
commit 97152de9bf
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 4
      lib/private/DB/Connection.php

@ -285,6 +285,10 @@ class Connection extends PrimaryReadReplicaConnection {
'exception' => new \Exception(),
],
);
// To prevent a dirty read on a replica that is slightly out of sync, we
// switch back to the primary. This is detrimental for performance but
// safer for consistency.
$this->ensureConnectedToPrimary();
}
$sql = $this->replaceTablePrefix($sql);

Loading…
Cancel
Save