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

Merge pull request !2859 from cchen676/1207master
This commit is contained in:
opengauss-bot
2023-02-03 06:44:37 +00:00
committed by Gitee
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()) {