Skip to content

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Oct 8, 2025

Previously if the peer discovery backend returned an error from failing to discover nodes, the service_discovery_nodes/0 helper returned an empty list. During cleanup this would mean that any nodes unreachable during a partition would have destructive action taken against them: rabbit_db_cluster:forget_member/2 and rabbit_quorum_queue:shrink_all/1. The list_nodes/0 callback can fail transiently, though, and a failure shouldn't mean that the cluster is empty. It's safer to avoid cleaning up any nodes when the peer discovery backend fails to return the intended set of nodes.

I also raised the log level of the error from debug to info. Maybe we could go to warning without too much log spam as this cleanup action happens on a timer measured in seconds.


Opening this as a draft for now - I'd like to write a test case for this. I've seen this in the wild when rabbitmq_aws fails to refresh its session token (because of a transient timeout) -> unauthorized request to get EC2 metadata -> list_nodes/0 returns the error tuple -> any node with the bad luck of being unreachable at that moment is forgotten and has its QQ data deleted. Especially if a broker is underprovisioned and overloaded, the session token refresh can fail around the same time that nodes mistakenly think they are partitioned from one another due to busy_dist_port / clogged internode communication.


This is an automatic backport of pull request #14606 done by Mergify.

Including this info in the error report can help with sanity checks in
debugging `?awaitMatch/4` failures.

(cherry picked from commit a28a5f7)
(cherry picked from commit f11198a)
Previously if the peer discovery backend returned an error from failing
to discover nodes, the `service_discovery_nodes/0` helper returned an
empty list. During cleanup this would mean that any nodes unreachable
during a partition would have destructive action taken against them:
`rabbit_db_cluster:forget_member/2` and `rabbit_quorum_queue:shrink_all/1`.
The `list_nodes/0` callback can fail transiently, though, and a failure
shouldn't mean that the cluster is empty. It's safer to avoid cleaning
up any nodes when the peer discovery backend fails to return the
intended set of nodes.

(cherry picked from commit 2d4f19c)
@michaelklishin michaelklishin added this to the 4.2.0 milestone Oct 8, 2025
@michaelklishin michaelklishin merged commit 0012652 into v4.2.x Oct 8, 2025
572 of 576 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-14606 branch October 8, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants