Skip to content

Extra tests: QQ: delete leaked Ra members, and mark a queue as being deleted - #18428

Open
michalovits wants to merge 4 commits into
rabbitmq:qq-deleting-statefrom
michalovits:incarnations-extra-tests
Open

michalovits wants to merge 4 commits into
rabbitmq:qq-deleting-statefrom
michalovits:incarnations-extra-tests

Conversation

@michalovits

@michalovits michalovits commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Working through and tracing some scenarios for #18345 (wrt #18187). So with the new changes we aim for something like:

partition     X X | X
delete X      . . | X   {left over: uid 123}
declare X     Y Y | X   {left over: uid 123} so generate a new ra name Y
delete X      . . | X   {left over: uid 123}
declare X     Z Z | X   {left over: uid 123}
heal          Z Z   X    Z, X are different ra names - ok

For one, since recreating the vhost will get rid of the queue record, I'm concerned about the following scenario (test below):

partition     X X | X
delete vhost  . . | X   {left over: uid 123}
create vhost   -         -
declare X     X X | X    - so use the standard ra name X
heal          X X   X    X, X are the same ra name - leaked member becomes leader

@michalovits
michalovits force-pushed the incarnations-extra-tests branch 2 times, most recently from c147034 to 3f9d157 Compare November 20, 2026 15:26
@mergify mergify Bot added the make label Nov 20, 2026
@michalovits
michalovits force-pushed the incarnations-extra-tests branch from ff311d8 to 21dac07 Compare November 20, 2026 16:54
@michalovits

michalovits commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

The other scenarios I've been working through have to do with membership changes. Because the current solution uses the initial set of member UIds for fencing, we can elide the new protections with some badly timed membership changes.

For example:

claim {uid 111, uid 222} to delete
add uid 333
delete 111, 222...
...333 does not get to apply delete_cluster in time and the leader is force deleted
...333 leaks

Then we're back to the usual issues, say at any time later

  • There is a network partition and the queue is redeclared on the side without 333
  • The queue is redeclared with a lower group size and 333's node is excluded

With possible message loss ensuing.

@michalovits

Copy link
Copy Markdown
Contributor Author

@kjnilsson can confirm the reproducer from #17459 looks clean now

@michalovits
michalovits force-pushed the incarnations-extra-tests branch 2 times, most recently from e40c032 to 8cf2dfd Compare November 20, 2026 19:07
@michalovits
michalovits marked this pull request as ready for review November 20, 2026 19:08
@michalovits

Copy link
Copy Markdown
Contributor Author

expected failures from ct-quorum_queue on the gaps described above

@kjnilsson

Copy link
Copy Markdown
Contributor

The other scenarios I've been working through have to do with membership changes. Because the current solution uses the initial set of member UIds for fencing, we can elide the new protections with some badly timed membership changes.

For example:

claim {uid 111, uid 222} to delete
add uid 333
delete 111, 222...
...333 does not get to apply delete_cluster in time and the leader is force deleted
...333 leaks

Then we're back to the usual issues, say at any time later

  • There is a network partition and the queue is redeclared on the side without 333
  • The queue is redeclared with a lower group size and 333's node is excluded

With possible message loss ensuing.

see e383f60

@michalovits

Copy link
Copy Markdown
Contributor Author

@kjnilsson Taking the train of thought around group sizes to its conclusion:

Suppose for example we have a setup with nodes = 5 / group = 3. We could see the following.

partition 	. . X | X X
delete		. . . | X X	{left over: uid 222 333}
declare		Y Y Y | X X

Once we're in this state all sorts of things can go wrong with inconsistent state, message loss and so on. Adding a test. 1-member ra clusters show it easiest but a 5-node / 3-member case will be useful to have too.

@michalovits
michalovits force-pushed the incarnations-extra-tests branch 3 times, most recently from fa9601a to a7161a6 Compare November 24, 2026 19:28
@michalovits

michalovits commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

This one is tricky. I suppose we should fail the deletion if we fail to wipe out a queue member majority (stricter than node majority, which is the current logic).

BTW seeing test failures / split brain as described.

@michalovits

Copy link
Copy Markdown
Contributor Author
  • Small groups / queue delete case seems in scope for QQ: delete leaked Ra members, and mark a queue as being deleted #18345:
    • Assume a partition. The queue can be put in the deleting state given a Khepri majority; then, the leftovers can be a queue majority if the group size is smaller; then, after redeclaring there can be two functioning Ra clusters.
    • We could fix it by failing the delete if we have more leftovers than half the members, keeping the deleting state, and failing declarations while there are too many leftovers.
  • VHost recreation case should probably not be undersold (given that network partitions can be long-lasting, that tools like amqpprox make it possible to remap vhosts between brokers, and generally since it's a correctness gap). But it could be addressed eventually with the introduction of a binary uid or through the "high initial term" pathway.

@michalovits
michalovits force-pushed the incarnations-extra-tests branch from a7161a6 to 7ade176 Compare November 27, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants