From 371bca48a71acbb7ded0409def215f0e668f8b34 Mon Sep 17 00:00:00 2001 From: shenzhengntu <503699317@qq.com> Date: Thu, 15 Jun 2023 12:24:41 +0800 Subject: [PATCH] auto vacuum stop failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code Source From: Self Code Description: 【Optional】 Jira: #【Optional】 市场项目编号(名称):【Optional】 --- src/backend/access/transam/xlog.c | 14 +++++++++----- src/backend/storage/smgr/smgr.c | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 01a54b8..760851e 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -14742,11 +14742,15 @@ producerXLogParallelBatchRead(XLogReaderState *xlogreader, XLogRecPtr startPtr, maxFlushedUpto = readedUpto + 8 * 16 * 1024; } else { //reConnect to master - if (consumerFailedNum >= 8 && ring_buffer_is_empty(gRingBufferManger)) { - if (!XLogRecPtrIsInvalid(reStartPtr)) { - readedUpto = reStartPtr; - consumerFailedNum = 0; - ReConnectPrimaryDB(); + if (consumerFailedNum >= 8) { + if (ring_buffer_is_empty(gRingBufferManger)) { + if (!XLogRecPtrIsInvalid(reStartPtr)) { + readedUpto = reStartPtr; + maxFlushedUpto = reStartPtr; + consumerFailedNum = 0; + failedCount = 0; + ReConnectPrimaryDB(); + } } } else { if (readedUpto < flushedUpto) { diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 5feb688..bf683bc 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -802,7 +802,8 @@ smgrtruncatelsn(SMgrRelation reln, ForkNumber *forknum, int nforks, BlockNumber do { sleep(1); minApplyLsn = He3DBQueryMinLsnFromAllStanby(); - printf("====pushlsn=%lx==lsn==%lx==\n",minApplyLsn,lsn); + elog(LOG,"====pushlsn=%lx==lsn==%lx==\n",minApplyLsn,lsn); + CHECK_FOR_INTERRUPTS(); } while(minApplyLsn