-
Notifications
You must be signed in to change notification settings - Fork 14.7k
MINOR: simplify last known elr update #20629
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent : Thanks for the PR. The code LGTM. Waiting for the CI to complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I just have one small comment left
if (!useLastKnownLeaderInBalancedRecovery || !eligibleLeaderReplicasEnabled) return; | ||
if (record.isr() != null && record.isr().isEmpty() && (partition.lastKnownElr.length != 1 || | ||
partition.lastKnownElr[0] != partition.leader)) { | ||
if (record.leader() == NO_LEADER && (partition.lastKnownElr.length == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could remove the redundant ()
. for example: (record.leader() == NO_LEADER && partition.lastKnownElr.length == 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chia7712 Thanks. Updated.
will merge it tomorrow if @junrao has no further reviews |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent : Thanks for the updated PR. LGTM
Simplify the last known elr update logic. This way can make a more robust logic. Reviewers: Jun Rao <[email protected]>, Chia-Ping Tsai <[email protected]>
Backport #20629 to 4.1 branch Simplify the last known elr update logic. This way can make a more robust logic. Reviewers: Jun Rao <[email protected]>, Chia-Ping Tsai <[email protected]>
Simplify the last known elr update logic. This way can make a more
robust logic.
Reviewers: Jun Rao [email protected], Chia-Ping Tsai
[email protected]