mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(db): Execute dirty reads on the primary node
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
e0053e1c06
commit
97152de9bf
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Reference in a new issue