!2859 [共享存储]修复failover发生后主机在回放阶段淘汰了从备机要到的需要flush的页面, 导致磁盘上页面漏刷的问题
Merge pull request !2859 from cchen676/1207master
This commit is contained in:
@ -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.
|
||||
|
||||
@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user