Skip to content

Conversation

the-mikedavis
Copy link
Collaborator

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.

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.
@the-mikedavis the-mikedavis self-assigned this Sep 25, 2025
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.

1 participant