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

CURATOR-724. Fix LeaderLatch recover on reconnected and missing leaderPath #515

Merged
merged 3 commits into from
Dec 21, 2024

Conversation

tisonkun
Copy link
Member

No description provided.

@tisonkun tisonkun requested a review from kezhuw December 18, 2024 03:24
Copy link
Member

@kezhuw kezhuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I guess we could write a test for this.

// (2) Scale it back.
//
// See also https://issues.apache.org/jira/browse/CURATOR-724
reset();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, before #430, the leaderLatch calls reset method after reconnection, and reset will whatever create the missing parent path nodes. So I didn't find this issue in the old versions. -- CURATOR-724

Just for sure, so, in case of RECONNECTED, we have no idea what happened to the cluster and getChildren is a conservative option comparing to reset.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Updated add a test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also ensure that the test failed without this fix.

}
getChildren();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it doesn't hurt we always call getChildren to check our leadership. It's not reset now anyway.

Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
@tisonkun tisonkun merged commit dd67936 into apache:master Dec 21, 2024
10 checks passed
@tisonkun tisonkun deleted the fix-724 branch December 21, 2024 20:29
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.

2 participants