Dev/node to site#30
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new public API to retrieve a node→site mapping, adds an ETS select/2 helper that waits for table restoration, and extends the test suite to validate the new behavior across cluster lifecycle events.
Changes:
- Add
classy:node_to_site/0API and internal implementation inclassy_node. - Add
classy_table:select/2wrapper and migrate membership ETS selects to use it. - Extend
t_091_node_of_siteto validatenode_to_site/0in singleton, clustered, and disconnected-peer scenarios.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/classy_SUITE.erl |
Adds assertions covering classy:node_to_site/0 behavior before/after join and after peer shutdown. |
src/classy.erl |
Exposes node_to_site/0 as a public API with cluster-membership gating. |
src/classy_table.erl |
Adds select/2 helper mirroring lookup/2’s “wait until restored” behavior. |
src/classy_node.erl |
Implements node_to_site/0 via a match-spec select over ?site_info. |
src/classy_membership.erl |
Replaces direct ets:select/2 with classy_table:select/2 for safety during restoration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+412
to
+414
| -doc """ | ||
| Run @code{ets:select} on the table after making sure it's open. | ||
| """. |
Comment on lines
+132
to
+134
| Kick intent is an arbitrary term passed to @ref{classy:pre_kick/2} @ref{classy:on_kick_decided/2} and @ref{classy:post_leave/2} hooks. | ||
| @code{pre_kick} may match on intent to prevent node from leaving the cluster in certain cases, | ||
| while to @code{post_kick} this value is merely informational. | ||
| while to @code{post_leave} this value is merely informational. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.