fix(cluster): ensure only VIP holder pushes sync and prevent deadlocks with flock and strict VIP check
This commit is contained in:
1 parent
0b740da87e
commit
0b654c885c
3 files changed
+14
-9
No files matched your search
+2
-1
@@ -1798,7 +1798,8 @@ try {
|
||||
try {
|
||||
$cm = new ClusterManager($db);
|
||||
$cSet = $cm->getSettings();
|
||||
if (!empty($cSet['enabled']) && !empty($cSet['auto_sync']) && ($cSet['role'] ?? '') === 'master' && !empty($cSet['peer_ip'])) {
|
||||
$isVipActive = $cm->isVirtualIpActive($cSet['virtual_ip'] ?? '');
|
||||
if (!empty($cSet['enabled']) && !empty($cSet['auto_sync']) && $isVipActive && !empty($cSet['peer_ip'])) {
|
||||
$syncRes = $cm->pushSyncToPeer();
|
||||
$clusterSyncMsg = $syncRes['message'] ?? 'Réplication pair OK';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user