Commit d1f0aa76 authored by Tomas Vondra's avatar Tomas Vondra

Fix pg_visibility regression failure with CLOBBER_CACHE_ALWAYS

Commit 8e03eb92 reverted a bit too much code, reintroducing one of the
issues fixed by 39b66a91 - a page might have been left partially empty
after relcache invalidation.

Reported-By: Tom Lane
Author: Masahiko Sawada
Discussion: https://postgr.es/m/822752.1623032114@sss.pgh.pa.us
Discussion: https://postgr.es/m/CAD21AoA%3D%3Df2VSw3c-Cp_y%3DWLKHMKc1D6s7g3YWsCOvgaYPpJcg%40mail.gmail.com
parent bfeede9f
...@@ -407,6 +407,7 @@ RelationGetBufferForTuple(Relation relation, Size len, ...@@ -407,6 +407,7 @@ RelationGetBufferForTuple(Relation relation, Size len,
* target. * target.
*/ */
targetBlock = GetPageWithFreeSpace(relation, targetFreeSpace); targetBlock = GetPageWithFreeSpace(relation, targetFreeSpace);
}
/* /*
* If the FSM knows nothing of the rel, try the last page before we * If the FSM knows nothing of the rel, try the last page before we
...@@ -420,7 +421,6 @@ RelationGetBufferForTuple(Relation relation, Size len, ...@@ -420,7 +421,6 @@ RelationGetBufferForTuple(Relation relation, Size len,
if (nblocks > 0) if (nblocks > 0)
targetBlock = nblocks - 1; targetBlock = nblocks - 1;
} }
}
loop: loop:
while (targetBlock != InvalidBlockNumber) while (targetBlock != InvalidBlockNumber)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment