-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Reduce logging noise when stepping down as master before state recovery #39950
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
Reduce logging noise when stepping down as master before state recovery #39950
Conversation
|
Pinging @elastic/es-distributed |
|
|
||
| @Override | ||
| public void onNoLongerMaster(String source) { | ||
| logger.debug("stepped down as master before recovering state [{}]", source); |
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.
Why do not we call resetRecoveredFlags here?
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.
good catch!
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.
I requested one change and asked a question too.
|
|
||
| @Override | ||
| public void onNoLongerMaster(String source) { | ||
| logger.debug("stepped down as master before recovering state [{}]", source); |
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.
I think this needs a call to resetRecoveredFlags() too.
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.
correct
| // that resets it to false while a new recover is already running? | ||
| GatewayService.this.onFailure("state recovery failed: " + e.getMessage()); | ||
| logger.warn("state recovery failed", e); | ||
| resetRecoveredFlags(); |
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.
Should we resetRecoveredFlags() on failure of the scheduled task a few lines above this too?
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.
sure, added in 9de5c0e
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
Reduces the logging noise from the state recovery component when there are duelling elections.
Relates to #32006