修复failover发生后主机在回放阶段淘汰了从备机要到的需要flush的页面, 导致磁盘上页面漏刷的问题

This commit is contained in:
arcoalien@qq.com
2023-02-02 15:47:58 +08:00
parent a0498a5701
commit 053aadfa38
2 changed files with 10 additions and 0 deletions

View File

@ -620,6 +620,11 @@ static volatile BufferDesc *PageListBufferAlloc(SMgrRelation smgr, char relpersi
/* Pin the buffer and then release the buffer spinlock */
PinBuffer_Locked(buf);
if (!SSPageCheckIfCanEliminate(buf)) {
UnpinBuffer(buf, true);
return NULL;
}
/*
* At this point, the victim buffer is pinned
* but no locks are held.

View File

@ -704,6 +704,11 @@ BufferDesc *SegBufferAlloc(SegSpace *spc, RelFileNode rnode, ForkNumber forkNum,
SegPinBufferLocked(buf, &new_tag);
if (!SSPageCheckIfCanEliminate(buf)) {
SegUnpinBuffer(buf);
continue;
}
if (old_flags & BM_DIRTY) {
/* backend should not flush dirty pages if working version less than DW_SUPPORT_NEW_SINGLE_FLUSH */
if (!backend_can_flush_dirty_page()) {