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