From 763c7dc6d016638b85f252ead8b58da223bad475 Mon Sep 17 00:00:00 2001 From: congzhou2603 Date: Thu, 1 Aug 2024 19:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bugfix=E3=80=91=E4=BF=AE=E5=A4=8Dswitc?= =?UTF-8?q?hover=E5=8D=87=E4=B8=BB=E5=AE=8C=E6=88=90=E5=89=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8E=A7=E5=88=B6=E6=96=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/access/transam/xlog.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gausskernel/storage/access/transam/xlog.cpp b/src/gausskernel/storage/access/transam/xlog.cpp index 31b2b8ab9..9fc74f6e0 100755 --- a/src/gausskernel/storage/access/transam/xlog.cpp +++ b/src/gausskernel/storage/access/transam/xlog.cpp @@ -10152,7 +10152,14 @@ void StartupXLOG(void) } t_thrd.shemem_ptr_cxt.ControlFile->time = (pg_time_t)time(NULL); /* No need to hold ControlFileLock yet, we aren't up far enough */ - if (!SS_STANDBY_FAILOVER && SS_ONDEMAND_REALTIME_BUILD_DISABLED) { + /** + * When enable_dms, the following conditions shouldn't update control file here, + * because standby node has read the control file from primary node. + * 1. standby node failover promoting. + * 2. standby node switchover promoting. + * 3. standby node start ondemand realtime build. + */ + if (!SS_STANDBY_FAILOVER && !SS_STANDBY_PROMOTING && SS_ONDEMAND_REALTIME_BUILD_DISABLED) { UpdateControlFile(); }