From 004db0252922e417511b7869af51ee345eb9c90c Mon Sep 17 00:00:00 2001 From: "arcoalien@qq.com" Date: Wed, 5 Jan 2022 11:18:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3PITR=E6=8C=89recovery=5Ftar?= =?UTF-8?q?get=5Ftime=E6=9D=A1=E4=BB=B6=E6=B5=8B=E8=AF=95=E6=97=B6?= =?UTF-8?q?=EF=BC=8CStartup=E7=BA=BF=E7=A8=8B=E5=8D=A1=E5=9C=A8RequestChec?= =?UTF-8?q?kpoint=E5=A4=84=E6=97=A0=E6=B3=95=E7=BB=A7=E7=BB=AD=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=A7=8B=E7=BB=88=E5=A4=84=E4=BA=8E=E6=81=A2=E5=A4=8D=E7=8A=B6?= =?UTF-8?q?=E6=80=81=202.=E8=A7=A3=E5=86=B3PITR=E6=8C=89recovery=5Ftarget?= =?UTF-8?q?=5Flsn=E6=9D=A1=E4=BB=B6=E6=B5=8B=E8=AF=95=E6=97=B6=EF=BC=8CSta?= =?UTF-8?q?rtup=E7=BA=BF=E7=A8=8B=E6=B2=A1=E6=9C=89=E5=9C=A8=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E7=9A=84lsn=E4=BD=8D=E7=BD=AE=E5=81=9C=E6=AD=A2=203.?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=BB=E7=BA=BF=E5=9B=9E=E5=90=88=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9C=AA=E6=B7=BB=E5=8A=A0=E5=AF=B9t=5Fthrd.?= =?UTF-8?q?syncrep=5Fcxt.SyncRepConfig=E7=9A=84=E5=88=A4=E7=A9=BA=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4,=E5=AF=BC=E8=87=B4=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/access/transam/xlog.cpp | 14 ++++++++------ src/gausskernel/storage/replication/slot.cpp | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gausskernel/storage/access/transam/xlog.cpp b/src/gausskernel/storage/access/transam/xlog.cpp index 841468fbc..1eb62e986 100755 --- a/src/gausskernel/storage/access/transam/xlog.cpp +++ b/src/gausskernel/storage/access/transam/xlog.cpp @@ -7844,11 +7844,13 @@ static bool recoveryStopsHere(XLogReaderState *record, bool *includeThis) if (IS_DISASTER_RECOVER_MODE) update_recovery_barrier(); } - } else if (XLogRecGetRmid(record) == RM_XLOG_ID && record_info == XLOG_RESTORE_POINT) { - xl_restore_point *recordRestorePointData = (xl_restore_point *)XLogRecGetData(record); - recordXtime = recordRestorePointData->rp_time; - rc = strncpy_s(recordRPName, MAXFNAMELEN, recordRestorePointData->rp_name, MAXFNAMELEN - 1); - securec_check(rc, "", ""); + } else if (XLogRecGetRmid(record) == RM_XLOG_ID) { + if (record_info == XLOG_RESTORE_POINT) { + xl_restore_point *recordRestorePointData = (xl_restore_point *)XLogRecGetData(record); + recordXtime = recordRestorePointData->rp_time; + rc = strncpy_s(recordRPName, MAXFNAMELEN, recordRestorePointData->rp_name, MAXFNAMELEN - 1); + securec_check(rc, "", ""); + } } else { return false; } @@ -8510,7 +8512,7 @@ static void EndRedoXlog() EndDispatcherContext(); } ResourceManagerStop(); - XLogWaitFlush(t_thrd.xlog_cxt.LogwrtResult->Write); + XLogWaitFlush(t_thrd.xlog_cxt.XactLastRecEnd); } int XLogSemas(void) diff --git a/src/gausskernel/storage/replication/slot.cpp b/src/gausskernel/storage/replication/slot.cpp index bd5b8b8aa..201da0eb6 100755 --- a/src/gausskernel/storage/replication/slot.cpp +++ b/src/gausskernel/storage/replication/slot.cpp @@ -911,7 +911,7 @@ void ReplicationSlotsComputeRequiredLSN(ReplicationSlotState *repl_slt_state) repl_slt_state->max_required = max_required; if (*standby_slots_list == InvalidXLogRecPtr) { repl_slt_state->quorum_min_required = InvalidXLogRecPtr; - } else { + } else if (t_thrd.syncrep_cxt.SyncRepConfig != NULL) { for (i = t_thrd.syncrep_cxt.SyncRepConfig->num_sync - 1; i >= 0; i--) { if (standby_slots_list[i] != InvalidXLogRecPtr) { repl_slt_state->quorum_min_required = standby_slots_list[i];