修复快速删除、创建归档槽导致归档线程未正确重启的bug

This commit is contained in:
luozihao 2021-12-21 16:44:36 +08:00
parent ee30a37bb3
commit 112023186b
1 changed files with 5 additions and 1 deletions

View File

@ -736,8 +736,12 @@ static void pgarch_ArchiverObsCopyLoop(XLogRecPtr flushPtr, doArchive fun)
}
XLogRecPtr restartLsn = getRestartLsnFromSlot();
/* we need to initialize the archive slot */
if (restartLsn == InvalidXLogRecPtr) {
continue;
ereport(WARNING, (errmsg("the archive slot is not initialized, "
"we should restart the archiver and init the archive slot")));
t_thrd.arch.ready_to_stop = true;
return;
}
uint32 size = isObsSlot() ? OBS_XLOG_SLICE_BLOCK_SIZE : NAS_XLOG_FILE_SIZE;