forked from huawei/openGauss-server
fix archive slot could not flush lsn
Offering: openGaussDev More detail: Modify slot advance part Match-id-3060b2f1218e72eb5ffc28d1742fbc15360ef534
This commit is contained in:
parent
704eed3368
commit
1062a1c1f6
|
|
@ -2172,18 +2172,22 @@ void AdvanceArchiveSlot(XLogRecPtr restart_pos)
|
|||
ReplicationSlot *slot = &t_thrd.slot_cxt.ReplicationSlotCtl->replication_slots[*slot_idx];
|
||||
SpinLockAcquire(&slot->mutex);
|
||||
if (slot->in_use == true && slot->archive_config != NULL) {
|
||||
t_thrd.slot_cxt.MyReplicationSlot = slot;
|
||||
slot->data.restart_lsn = restart_pos;
|
||||
extra_content = slot->extra_content;
|
||||
SpinLockRelease(&slot->mutex);
|
||||
} else {
|
||||
SpinLockRelease(&slot->mutex);
|
||||
ereport(WARNING,
|
||||
(errcode_for_file_access(), errmsg("slot idx not valid, obs slot %X/%X not advance ",
|
||||
(uint32)(restart_pos >> 32), (uint32)(restart_pos))));
|
||||
}
|
||||
SpinLockRelease(&slot->mutex);
|
||||
|
||||
if (extra_content == NULL) {
|
||||
ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("archive thread could not get slot extra content when advance slot.")));
|
||||
}
|
||||
ReplicationSlotMarkDirty();
|
||||
log_slot_advance(&slot->data, extra_content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue