From b440e0b89d0240fdca3c81dd047de5df4b06b91c Mon Sep 17 00:00:00 2001 From: luozihao <1165977584@qq.com> Date: Mon, 24 May 2021 10:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BC=96=E8=AF=91=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=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 | 3 --- src/gausskernel/storage/replication/walrcvwriter.cpp | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gausskernel/storage/access/transam/xlog.cpp b/src/gausskernel/storage/access/transam/xlog.cpp index 414285367..422428c34 100644 --- a/src/gausskernel/storage/access/transam/xlog.cpp +++ b/src/gausskernel/storage/access/transam/xlog.cpp @@ -2478,9 +2478,6 @@ static bool XLogArchiveCheckDone(const char *xlog) static bool HasBeenArchivedOnHaMode(const char* xlog) { load_server_mode(); - if (!t_thrd.xlog_cxt.server_mode == PRIMARY_MODE && !t_thrd.xlog_cxt.server_mode == STANDBY_MODE) { - return true; - } int mode = t_thrd.xlog_cxt.server_mode; XLogRecPtr minium_lsn = PG_UINT64_MAX; for (int i = 0; mode == PRIMARY_MODE && i < g_instance.attr.attr_storage.max_wal_senders; i++) { diff --git a/src/gausskernel/storage/replication/walrcvwriter.cpp b/src/gausskernel/storage/replication/walrcvwriter.cpp index b819c3691..33cd9e7ac 100644 --- a/src/gausskernel/storage/replication/walrcvwriter.cpp +++ b/src/gausskernel/storage/replication/walrcvwriter.cpp @@ -140,8 +140,6 @@ static void XLogWalRcvWrite(WalRcvCtlBlock *walrcb, char *buf, Size nbytes, XLog * would otherwise have to reopen this file to fsync it later */ if (recvFile >= 0) { - char xlogfname[MAXFNAMELEN]; - /* * XLOG segment files will be re-read by recovery in startup * process soon, so we don't advise the OS to release cache @@ -157,6 +155,7 @@ static void XLogWalRcvWrite(WalRcvCtlBlock *walrcb, char *buf, Size nbytes, XLog * Create .done file forcibly to prevent the restored segment from * being archived again later. */ + char xlogfname[MAXFNAMELEN]; XLogFileName(xlogfname, recvFileTLI, recvSegNo); XLogArchiveForceDone(xlogfname); #endif