!1451 【轻量级 PR】bugfix: 修复PITR测试发现的在不同的恢复终止条件下的2个问题

Merge pull request !1451 from cchen676/master1
This commit is contained in:
opengauss-bot 2022-01-17 12:44:00 +00:00 committed by Gitee
commit 266517b751
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 7 deletions

View File

@ -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)

View File

@ -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];