From e2c3d0f7b30a67a5e57375a8531c26e193584e4c Mon Sep 17 00:00:00 2001 From: Lamaric Date: Thu, 1 Aug 2024 16:20:55 +0800 Subject: [PATCH] =?UTF-8?q?cherry=20pick=20a032fff=20from=20https://gitee.?= =?UTF-8?q?com/cbd123cbd/openGauss-server/pulls/5921=20=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=B1=A0=E5=8C=96=E5=AD=98=E5=82=A8=E5=A4=8D=E5=88=B6=E5=A4=87?= =?UTF-8?q?=E9=9B=86=E7=BE=A4=E6=B2=A1=E6=9C=89remove=20xlogfile=E7=9A=84?= =?UTF-8?q?=E9=9C=80=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/access/transam/xlog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gausskernel/storage/access/transam/xlog.cpp b/src/gausskernel/storage/access/transam/xlog.cpp index 1b8a05dcb..30bb8c6fc 100755 --- a/src/gausskernel/storage/access/transam/xlog.cpp +++ b/src/gausskernel/storage/access/transam/xlog.cpp @@ -6876,6 +6876,10 @@ static XLogSegNo GetOldestXLOGSegNo(const char *workingPath) (void)closedir(xlogDir); if (sscanf_s(oldestXLogFileName, "%08X%08X%08X", &tli, &xlogReadLogid, &xlogReadLogSeg) != 3) { + if (SS_DORADO_STANDBY_CLUSTER) { + /* ss standby cluster does not actually need to remove xlog file. */ + return (XLogSegNo)0; + } ereport(ERROR, (errcode_for_file_access(), errmsg("failed to translate name to xlog in GetOldestXLOGSegNo."))); } segno = (uint64)xlogReadLogid * XLogSegmentsPerXLogId + xlogReadLogSeg - 1;