You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A long lock on the subscriptions table makes a node drop every subscription lock #37
A long lock on the subscriptions table makes a node drop every subscription lock. The claim's UPDATE subscriptions runs on the lock connection with no lock_timeout or statement_timeout. If another session holds or waits for a conflicting table lock for longer than the client timeout (:timeout, 15 s by default), for example ALTER TABLE, LOCK TABLE, VACUUM FULL or a non-concurrent CREATE INDEX, the claim blocks the lock server until that timeout, the lock connection disconnects, and every owner on the node gets lock_released; each subscription then waits its retry interval (60 s by default) before claiming again. A row lock on one subscription does the same only to a claim whose advisory lock is free. The probes used a 1 s client timeout (3 of 3 each); that a table lock catches every node claiming while it lasts follows from the same code path. Before #29 the lock connection did not touch the table. Low: it needs a long table lock, but it takes out the whole node.
Fixed by #59. The claim now bounds how long it waits on a lock on subscriptions, so a long table lock no longer stalls the lock connection past its timeout and drops every lock on the node.
Verified with test/advisory_locks_test.exs ("should keep every lock on the node while a table lock outlasts a claim"): it fails against the code before #59 and passes on main.
Activity
yordis commentedon Oct 27, 2026
Fixed by #59. The claim now bounds how long it waits on a lock on
subscriptions, so a long table lock no longer stalls the lock connection past its timeout and drops every lock on the node.Verified with
test/advisory_locks_test.exs("should keep every lock on the node while a table lock outlasts a claim"): it fails against the code before #59 and passes on main.