Skip to content

Commit

Permalink
Remove lock check assertion for reorder
Browse files Browse the repository at this point in the history
A previous commit (7e30ed6) added an assertion check to the reoder
code's `swap_relation_files` to ensure that proper locks are held on
the relations when updating their pg_class entries, per new
requirements in recent PostgreSQL releases. However, this check failed
because the function could be called on indexes as well as tables, and
indexes have different locking requirements.

The assertions aren't strictly needed because heap_update() has a
check of its own that will raise a warning if locking requirements are
not met (assuming the code is compiled with assertions enabled).
  • Loading branch information
erimatnor committed Nov 20, 2024
1 parent c278f3d commit 5c4314e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tsl/src/reorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,6 @@ swap_relation_files(Oid r1, Oid r2, bool swap_toast_by_content, bool is_internal
Oid swaptemp;
char swptmpchr;

AssertSufficientPgClassUpdateLockHeld(r1);
AssertSufficientPgClassUpdateLockHeld(r2);

/* We need writable copies of both pg_class tuples. */
relRelation = table_open(RelationRelationId, RowExclusiveLock);

Expand Down

0 comments on commit 5c4314e

Please sign in to comment.