修复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!
|
BufferDesc *buf = GetBufferDescriptor(rootbuf - 1); // caveat for GetBufferDescriptor for -1!
|
||||||
valid = PinBuffer(buf, NULL);
|
valid = PinBuffer(buf, NULL);
|
||||||
if (valid && TryLockBuffer(rootbuf, BT_READ, false)) {
|
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);
|
RelFileNodeEquals(buf->tag.rnode, rel->rd_node) && (buf->tag.blockNum == rootblkno);
|
||||||
if (!isRootCacheValid) {
|
if (!isRootCacheValid) {
|
||||||
UnlockReleaseBuffer(rootbuf);
|
UnlockReleaseBuffer(rootbuf);
|
||||||
|
@ -905,6 +905,11 @@ restart:
|
|||||||
if (minoff <= maxoff) {
|
if (minoff <= maxoff) {
|
||||||
stats->num_index_tuples += maxoff - minoff + 1;
|
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) {
|
if (deleteNow) {
|
||||||
|
Reference in New Issue
Block a user