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

[java] optimize the logic of LogAdapter to determine whether the stream is closed. #1608

Conversation

WorkingChen
Copy link
Contributor

@WorkingChen WorkingChen commented Jun 4, 2024

The purpose of this optimization is to quickly detect when the stream is closed, and then enter the election phase. In the scenario of leader.gracefulClose(), it shortens the time for cluster election.

…tion more quickly, instead of waiting to detect the RecordingSignal.STOP signal in the slowTickWork method.
@WorkingChen WorkingChen closed this Jun 4, 2024
@WorkingChen WorkingChen reopened this Jun 4, 2024
@mikeb01
Copy link
Contributor

mikeb01 commented Jun 6, 2024

Unfortunately closing based on EOS in the consensus module could result in data not being completely written to the archive. By waiting until the Image has closed, means that the other subscription reading that image (i.e. the Archive) has also received the EOS and closed the recording. We feel that it is cleaner to allow the archive to complete the writing of the data it has received instead of closing early and relying on replication/catch up during the election process to back fill that data.

@mikeb01 mikeb01 closed this Jun 6, 2024
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