Repository navigation
Race between two deletions and one (re)declaration can leak QQ members #17459
Replies: 3 comments 1 reply
|
@michalovits quorum queues are not supposed to be churned. See #16758 (reply in thread). There are known scenarios under churn that do not need another bandaid, they need a fundamental solution like the introduction of node UUIDs was for certain other scenarios. |
1 reply
|
Continuation of the related discussion: #16758 (reply in thread) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Two deletions and a declaration can interleave against a QQ as follows: the first delete removes the Ra cluster and queue record; the second delete sees no Ra cluster; the declare makes a new queue record and starts a new Ra cluster; the second delete removes the new record. Any further queue operations fail. Declaring again, we bump into the leaked Ra cluster with N *
ra: failed to start a server ... failed_to_start_child ... already_startedand thenra: failed to form a new cluster.There essentially needs to be one deletion to remove the old queue's record and allow the declaration to go through, and another to remove the new queue's record. The queue's lifetime could be arbitrarily long up to that point.
The end state is similar to that of #17137, but this race can happen in a stable network, with the three operations appearing to complete successfully and no failed force-delete.
Diagrammatically:
Log for a reproduction on main (collated from a three-node local cluster): repro.log.
Reproduction steps
cluster_not_formedin the declaring connectionExpected behavior
The queue metadata and Ra cluster are in a consistent state. The queue can be redeclared and used.
Additional context
Our thinking is that since
rabbit_db_queue:delete_if/3can do a compare+swap, we could remember the Ra member uids from the original record whentrack_qq_members_uidsis enabled, and detect if the record to delete is for a newer incarnation. Though we also want to avoid:And for that a similar compare+swap for Ra deletion seems necessary?
All reactions