Skip to content

Export node State to NotifyLeave callback #321

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

corhere
Copy link

@corhere corhere commented Apr 16, 2025

The node State was exported to the application in #223, but only the MergeDelegate is passed Node values with the State field initialized. The actual state of each node as tracked by the local memberlist is hidden from the application in the non-exported nodeState struct which embeds Node. Remove the State field from nodeState so that the State field on the embedded Node is instead used to track the node state. This has the effect of making the actual state of the node (Left vs. Dead) available to NotifyLeave callbacks as a pointer to the nodeState's embedded Node struct is passed to EventDelegate callbacks.

The node State was exported to the application in commit
1c2989e, but only the MergeDelegate is
passed Node values with the State field initialized. The actual state of
each node as tracked by the local memberlist is hidden from the
application in the non-exported nodeState struct which embeds Node.
Remove the State field from nodeState so that the State field on the
embedded Node is instead used to track the node state. This has the
effect of making the actual state of the node (Left vs. Dead) available
to NotifyLeave callbacks as a pointer to the nodeState's embedded Node
struct is passed to EventDelegate callbacks.
@corhere corhere requested a review from a team as a code owner April 16, 2025 20:56
Copy link

hashicorp-cla-app bot commented Apr 16, 2025

CLA assistant check
All committers have signed the CLA.

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.

Checking the state of the Node in NotifyLeave Feature request: Update state of node in memberlist
1 participant