postgres.git / summary / log / commit / refs

commit    5f55fc5a346e1ab54f3d756e368d276b95be8c4a
Author:   Peter Geoghegan <pg@bowt.ie>
Date:     Fri Oct 29 17:53:48 2021 +0000
First released in: 15.0, 14.1

    Demote pg_unreachable() in heapam to an assertion.
    
    Commit d168b66682, which overhauled index deletion, added a
    pg_unreachable() to the end of a sort comparator used when sorting heap
    TIDs from an index page.  This allows the compiler to apply
    optimizations that assume that the heap TIDs from the index AM must
    always be unique.
    
    That doesn't seem like a good idea now, given recent reports of
    corruption involving duplicate TIDs in indexes on Postgres 14.  Demote
    to an assertion, just in case.
    
    Backpatch: 14-, where index deletion was overhauled.


src/backend/access/heap/heapam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 2da2be16969..fecb9728683 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -7586,7 +7586,7 @@ index_delete_sort_cmp(TM_IndexDelete *deltid1, TM_IndexDelete *deltid2) return (pos1 < pos2) ? -1 : 1; } - pg_unreachable(); + Assert(false); return 0; } [parent: a2a731d6c9db]