Commit bd9f4cf0 authored by Peter Geoghegan's avatar Peter Geoghegan

Demote pg_unreachable() in heapam to an assertion.

Commit d168b666, 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.
parent 0c8a40b3
......@@ -7579,7 +7579,7 @@ index_delete_sort_cmp(TM_IndexDelete *deltid1, TM_IndexDelete *deltid2)
return (pos1 < pos2) ? -1 : 1;
}
pg_unreachable();
Assert(false);
return 0;
}
......
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