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

Disconnect of a node from a cluster of global nodes #6264

Conversation

rickard-green
Copy link
Contributor

@rickard-green rickard-green commented Aug 31, 2022

Make it possible to disconnect a node from a cluster of global nodes without causing problems. Proposed API:

  • global:disconnect() -> [node()]

    Disconnect from all other nodes known to global. A list of node names (in an unspecified order) is returned which corresponds to the nodes that were disconnected. All disconnect operations performed have completed when global:disconnect/0 returns.

    The disconnects will be made in such a way that only the current node will be removed from the cluster of global nodes. If prevent_overlapping_partitions is enabled and you disconnect, from other nodes in the cluster of global nodes, by other means, global on the other nodes may partition the remaining nodes in order to ensure that no overlapping partitions appear. Even if prevent_overlapping_partitions is disabled, you should preferably use global:disconnect/0 in order to remove current node from a cluster of global nodes, since you otherwise likely will create overlapping partitions which might cause problems.

    Note that if the node is going to be halted, there is no need to remove it from a cluster of global nodes explicitly by calling global:disconnect/0 before halting it. The removal from the cluster is taken care of automatically when the node halts regardless of whether prevent_overlapping_partitions is enabled or not.

    If current node has been configured to be part of a global group, only connected and/or synchronized nodes in that group are known to global, so global:disconnect/0 will only disconnect from those nodes. If current node is not part of a global group, all connected visible nodes will be known to global, so global:disconnect/0 will disconnect from all those nodes.

    Note that information about connected nodes does not instantaneously reach global, so the caller might see a node part of the result returned by nodes() while it still is not known to global. The disconnect operation will, however, still not cause any overlapping partitions when prevent_overlapping_partitions is enabled. If prevent_overlapping_partitions is disabled, overlapping partitions may form in this case.

    Note that when prevent_overlapping_partitions is enabled, you may see warning reports on other nodes when they detect that current node has disconnected. These are in this case completely harmless and can be ignored.

@rickard-green rickard-green added team:VM Assigned to OTP team VM enhancement fix testing currently being tested, tag is used by OTP internal CI labels Aug 31, 2022
@rickard-green rickard-green added this to the OTP-25.1 milestone Aug 31, 2022
@rickard-green rickard-green self-assigned this Aug 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2022

CT Test Results

       2 files       65 suites   58m 39s ⏱️
1 336 tests 1 202 ✔️ 133 💤 1
1 503 runs  1 339 ✔️ 163 💤 1

For more details on these failures, see this check.

Results for commit 014bd58.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@rickard-green rickard-green force-pushed the rickard/global-disconnect/maint/OTP-18232 branch 2 times, most recently from 1f76a4e to 770318b Compare September 7, 2022 17:40
…d/global-disconnect/24.2/OTP-18232

* rickard/global-disconnect/23.3.4/OTP-18232:
  [kernel] Introduce global:disconnect/0
…global-disconnect/maint/OTP-18232

* rickard/global-disconnect/24.2/OTP-18232:
  [kernel] Introduce global:disconnect/0
@rickard-green rickard-green force-pushed the rickard/global-disconnect/maint/OTP-18232 branch from 770318b to 014bd58 Compare September 8, 2022 11:35
@rickard-green rickard-green merged commit 63c808a into erlang:maint Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant