From e0f8f6a966811f07b8cc42d922d889351ba53b50 Mon Sep 17 00:00:00 2001 From: "arcoalien@qq.com" Date: Wed, 5 Jan 2022 16:00:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E7=BA=BF=E5=9B=9E?= =?UTF-8?q?=E5=90=88=E5=AF=BC=E8=87=B4=E7=9A=84=E5=B7=AE=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/replication/syncrep.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gausskernel/storage/replication/syncrep.cpp b/src/gausskernel/storage/replication/syncrep.cpp index 4bbcd8b77..147ee4498 100755 --- a/src/gausskernel/storage/replication/syncrep.cpp +++ b/src/gausskernel/storage/replication/syncrep.cpp @@ -185,7 +185,8 @@ void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN, bool enableHandleCancel) */ if (!t_thrd.walsender_cxt.WalSndCtl->sync_standbys_defined || XLByteLE(XactCommitLSN, t_thrd.walsender_cxt.WalSndCtl->lsn[mode]) || - (t_thrd.walsender_cxt.WalSndCtl->sync_master_standalone && !DelayIntoMostAvaSync(false)) || + (t_thrd.walsender_cxt.WalSndCtl->sync_master_standalone && !IS_SHARED_STORAGE_MODE && + !DelayIntoMostAvaSync(false)) || !SynRepWaitCatchup(XactCommitLSN)) { LWLockRelease(SyncRepLock); RESUME_INTERRUPTS(); @@ -314,8 +315,9 @@ void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN, bool enableHandleCancel) /* * If we modify the syncmode dynamically, we'll stop wait */ - if ((t_thrd.walsender_cxt.WalSndCtl->sync_master_standalone && !DelayIntoMostAvaSync(false)) || - synchronous_commit <= SYNCHRONOUS_COMMIT_LOCAL_FLUSH) { + if ((t_thrd.walsender_cxt.WalSndCtl->sync_master_standalone && !IS_SHARED_STORAGE_MODE && + !DelayIntoMostAvaSync(false)) || + u_sess->attr.attr_storage.guc_synchronous_commit <= SYNCHRONOUS_COMMIT_LOCAL_FLUSH) { ereport(WARNING, (errmsg("canceling wait for synchronous replication due to syncmaster standalone."), errdetail("The transaction has already committed locally, but might not have been replicated to "