"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> This patch is utterly wrong. Please revert it.
>
> This is entirely likely to find the same non-BM_VALID buffer that was
> assigned in the first iteration.
>
Yes, Tom is right. A relation extension might find a non-BM_VALID buffer
left by previous failed relation extension.
Regards,
Qingqing