修复vacuum在调用UBTreeVacuumPage时可能出现的不回收问题
This commit is contained in:
@ -165,7 +165,7 @@ Buffer UBTreeGetRoot(Relation rel, int access)
|
||||
BufferDesc *buf = GetBufferDescriptor(rootbuf - 1); // caveat for GetBufferDescriptor for -1!
|
||||
valid = PinBuffer(buf, NULL);
|
||||
if (valid && TryLockBuffer(rootbuf, BT_READ, false)) {
|
||||
isRootCacheValid = buf->tag.forkNum == MAIN_FORKNUM &&
|
||||
isRootCacheValid = (!IS_EXRTO_STANDBY_READ) && (buf->tag.forkNum == MAIN_FORKNUM) &&
|
||||
RelFileNodeEquals(buf->tag.rnode, rel->rd_node) && (buf->tag.blockNum == rootblkno);
|
||||
if (!isRootCacheValid) {
|
||||
UnlockReleaseBuffer(rootbuf);
|
||||
|
@ -905,6 +905,11 @@ restart:
|
||||
if (minoff <= maxoff) {
|
||||
stats->num_index_tuples += maxoff - minoff + 1;
|
||||
}
|
||||
|
||||
if(vstate->cycleid !=0 && opaque->btpo_cycleid == vstate->cycleid
|
||||
&& !(opaque->btpo_flags & BTP_SPLIT_END) && !P_RIGHTMOST(opaque) && opaque->btpo_next < origBlkno){
|
||||
recurseTo = opaque->btpo_next;
|
||||
}
|
||||
}
|
||||
|
||||
if (deleteNow) {
|
||||
|
Reference in New Issue
Block a user