Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbit_peer_discovery: Pass inetrc config file to temporary hidden node (backport #10904) #11086

Merged
merged 5 commits into from Apr 25, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Apr 25, 2024

Why

As shown in #10728, in an IPv6-only environment, kernel name resolution must be configured through an inetrc file.

The temporary hidden node must be configured exactly like the main node (and all nodes in the cluster in fact) to allow communication. Thus we must pass the same inetrc file to that temporary hidden node. This wasn’t the case before this patch.

How

We query the main node’s kernel to see if there is any inetrc file set and we use the same on the temporary hidden node’s command line.

While here, extract the handling of the proto_dist module from the TLS code. This parameter may be used outside of TLS like this IPv6-only environment.

V2: Accept inetrc filenames as atoms, not only lists. kernel seems to accept them. This makes a better user experience for users used to Bourne shell quoting not knowing that single quotes have a special meaning in Erlang.

Note: This is the same pull request as #10759 which was merged and backported when it was still a draft.

References #10840.
Fixes #10728.


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

… "DB ready" state

[Why]
When peer discovery runs on initial boot, the database layer is not
ready when peer discovery is executed. Thus if the node selects itself
as the node to "join", it shouldn't pay attention to the database
readyness otherwise it would wait forever.

(cherry picked from commit 54f5ab5)
[Why]
As shown in #10728, in an IPv6-only environment, `kernel` name
resolution must be configured through an inetrc file.

The temporary hidden node must be configured exactly like the main node
(and all nodes in the cluster in fact) to allow communication. Thus we
must pass the same inetrc file to that temporary hidden node. This
wasn’t the case before this patch.

[How]
We query the main node’s kernel to see if there is any inetrc file set
and we use the same on the temporary hidden node’s command line.

While here, extract the handling of the `proto_dist` module from the TLS
code. This parameter may be used outside of TLS like this IPv6-only
environment.

V2: Accept `inetrc` filenames as atoms, not only lists. `kernel` seems
    to accept them. This makes a better user experience for users used
    to Bourne shell quoting not knowing that single quotes have a
    special meaning in Erlang.

Fixes #10728.

(cherry picked from commit 8425afa)
…idden node

[Why]
We want to make sure that the queried remote node doesn't know about the
querying node. That's why we use a temporary hidden node in the first
place.

In fact, it is possible to start the temporary hidden node and
communicate with it using an alternative connection instead of the
regular Erlang distribution. This further ensures that the two RabbitMQ
nodes don't connect to each other while properties are queried.

[How]
We use the `standard_io` alternative connection. We need to use
`peer:call/4` instead of `erpc:call/4` to run code on the temporary
hidden node.

While here, we add assertions to verify that the three node didn't form
a full mesh network at the end of the query code.

(cherry picked from commit 27b9027)
… hidden node

... used by peer discovery.

(cherry picked from commit dbf9dfb)
@mergify mergify bot added the bazel label Apr 25, 2024
@dumbbell dumbbell merged commit d9ad9c6 into v3.13.x Apr 25, 2024
18 checks passed
@dumbbell dumbbell deleted the mergify/bp/v3.13.x/pr-10904 branch April 25, 2024 14:15
@dumbbell dumbbell added this to the 3.13.2 milestone Apr 25, 2024
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.

None yet

1 participant