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

Dont wait on a disconnected follower #874

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spuun
Copy link
Member

@spuun spuun commented Dec 11, 2024

WHAT is this pull request doing?

While testing clustering stuff I noticed that the leader sometimes wait for a disconnected follower to be fully in sync. This PR prevents at least some of these cases.

HOW can this pull request be tested?

Manually run a cluster and stop follower in different stage. No "Waiting for follower to be in sync" should be logged.

There is no need to wait for a disconnected follower to be synced.
@spuun spuun requested a review from a team as a code owner December 11, 2024 08:58
rescue ex : IO::Error
Log.warn { "Follower disonnected: #{ex.message}" }
socket.close
ensure
follower.try &.close
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't Follower#close close the socket?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be done by the action loop once it's drained. But we should probably close the socket there is no lag or if we get a timeout waiting for the follower to sync. I guess we could add an ensure statement and always close the socket in #close.

@spuun spuun requested a review from carlhoerberg December 17, 2024 06:53
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