forked from huawei/openGauss-server
修复switchover备升主新主机core的bug
This commit is contained in:
parent
ee30a37bb3
commit
ec386db397
|
|
@ -430,6 +430,15 @@ static void pgarch_MainLoop(void)
|
|||
if (time_to_stop) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* cannot send archive task if we don't acquire an archive slot.
|
||||
*/
|
||||
if (t_thrd.slot_cxt.MyReplicationSlot == NULL) {
|
||||
ereport(LOG, (errmsg("there is no slot to flush, exit the archvier")));
|
||||
break;
|
||||
}
|
||||
|
||||
gettimeofday(&curtime, NULL);
|
||||
const long time_diff = TIME_GET_MILLISEC(curtime) - t_thrd.arch.last_arch_time;
|
||||
XLogRecPtr receivePtr;
|
||||
|
|
|
|||
|
|
@ -2788,7 +2788,8 @@ static int ServerLoop(void)
|
|||
if (g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode) {
|
||||
obs_slot = getObsReplicationSlot();
|
||||
if ((XLogArchivingActive() && pmState == PM_RUN) ||
|
||||
((pmState == PM_RUN || pmState == PM_HOT_STANDBY) && obs_slot != NULL)) {
|
||||
((pmState == PM_RUN || pmState == PM_HOT_STANDBY) && obs_slot != NULL &&
|
||||
get_local_dbstate() == NORMAL_STATE)) {
|
||||
g_instance.pid_cxt.PgArchPID = pgarch_start();
|
||||
}
|
||||
}
|
||||
|
|
@ -5420,7 +5421,8 @@ static void reaper(SIGNAL_ARGS)
|
|||
if (g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode) {
|
||||
obs_slot = getObsReplicationSlot();
|
||||
if ((XLogArchivingActive() && pmState == PM_RUN) ||
|
||||
((pmState == PM_RUN || pmState == PM_HOT_STANDBY) && obs_slot != NULL)) {
|
||||
((pmState == PM_RUN || pmState == PM_HOT_STANDBY) && obs_slot != NULL &&
|
||||
get_local_dbstate() == NORMAL_STATE)) {
|
||||
g_instance.pid_cxt.PgArchPID = pgarch_start();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue