-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 #10904
Conversation
bcf0da7
to
99fa593
Compare
ct:pal("Peers: ~p", [Peers]), | ||
Peers. | ||
|
||
determine_hostname(PeerOptions) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than modifying the system /etc/hosts
file, would it possibly be easier to use the inetrc
file itself?
https://www.erlang.org/doc/apps/erts/inet_cfg#user-configuration-example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would interfere with the testscases actually testing the inetrc
file option.
I've played with this PR using
|
99fa593
to
f65b9b4
Compare
There is a clause added in the first commit that addresses the following message from node 2:
This makes sure that a node that selects itself can continue to boot (otherwise we have a dead lock). Are you sure you used the latest commit from this branch? Edit: It was probably related to the fact the CI fails to build docker images, and thus the latest one for this branch is old. |
f65b9b4
to
4e20ccb
Compare
Indeed, I was using the wrong image. I've tested the latest and it works well for me |
d153b48
to
9e95233
Compare
… "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.
[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.
…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.
… hidden node ... used by peer discovery.
9e95233
to
dbf9dfb
Compare
rabbit_peer_discovery: Pass inetrc config file to temporary hidden node (backport #10904)
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.