-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Fix a bug where OnErrorRecoveryBegin()
is not called before auto-recovery
#12860
Conversation
@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@hx235 has updated the pull request. You must reimport the pull request before landing. |
@hx235 has updated the pull request. You must reimport the pull request before landing. |
@@ -289,7 +289,8 @@ class DbStressListener : public EventListener { | |||
} | |||
} | |||
|
|||
void OnErrorRecoveryCompleted(Status /* old_bg_error */) override { | |||
void OnErrorRecoveryEnd( |
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.
To use the later API
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.
Check that recovery is successful?
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.
The current stuff we do in this crash test listener is intended to be done even when recovery is not successful.
@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
My understanding is this auto recovery applies to when error handler delegates error handling to |
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, thanks for the fix!
db/error_handler.cc
Outdated
@@ -466,10 +466,13 @@ void ErrorHandler::SetBGError(const Status& bg_status, | |||
Status bg_err(new_bg_io_err, severity); | |||
CheckAndSetRecoveryAndBGError(bg_err); | |||
recover_context_ = context; | |||
bool auto_recovery = true; |
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 this taken into account the value of max_bgerror_resume_count since autorecovery may not be enabled?
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 - fixed.
@hx235 has updated the pull request. You must reimport the pull request before landing. |
@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Context/Summary:
*auto_recovery
needs to be set true in order forOnErrorRecoveryBegin()
to be called before auto-recoveryrocksdb/db/event_helpers.cc
Lines 64 to 66 in 3db030d
Currently it's set false for auto-recovery. This PR fixes it.
Test plan: