On Sat, Feb 4, 2023 at 2:57 AM Andres Freund <and...@anarazel.de> wrote: > > Is there a good way to make breakage in the page recycling mechanism > visible with gist? I guess to see corruption, I'd have to halt a scan > before a page is visited with gdb, then cause the page to be recycled > prematurely in another session, then unblock the first? Which'd then > visit that page, thinking it to be in a different part of the tree than > it actually is? >
In most cases landing on one extra page will not affect the scan. Worst case that I can imagine - scan is landing on a page that is the new parent of the deleted page. Even then we cannot end up with infinite index scan - we will just make one extra loop. Although, IndexScan will yield duplicate tids. In case of interference with concurrent insertion we will get a tree structure departed from optimal, but that is not a problem. Best regards, Andrey Borodin.