Skip to content

Mark recovery_in_prog_ to false whenever recovery thread joins - #11890

Closed
jowlyzhang wants to merge 2 commits into
meta:mainfrom
jowlyzhang:fix_recovery_in_prog
Closed

jowlyzhang wants to merge 2 commits into
meta:mainfrom
jowlyzhang:fix_recovery_in_prog

Conversation

@jowlyzhang

@jowlyzhang jowlyzhang commented Sep 25, 2023 •

Copy link
Copy Markdown
Contributor

Make the RecoverFromRetryableBGIOError function always mark recovery_in_prog_ to false when it returns.
Otherwise, in below code snippet, when db closes and the error_handler_.CancelErrorRecovery() call successfully joined the recovery thread, the immediately following while loop will incorrectly think the error recovery is still in progress and loops in bg_cv_.Wait().

https://github.com/facebook/rocksdb/blob/1c871a4d8682ea260ba3b18ed43cd525a2141733/db/db_impl/db_impl.cc#L542-L545

This is the issue #11440

@jowlyzhang jowlyzhang changed the title Mark recovery_in_prog_ to false whenever auto recovery thread joins Mark recovery_in_prog_ to false whenever recovery thread joins Sep 26, 2023

@anand1976 anand1976 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch. Thanks for fixing it!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jowlyzhang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jowlyzhang

Copy link
Copy Markdown
Contributor Author

Good catch. Thanks for fixing it!

Thank you for the quick review!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jowlyzhang merged this pull request in 7ea6e72.

@jowlyzhang
jowlyzhang deleted the fix_recovery_in_prog branch September 26, 2023 16:48
ajkr pushed a commit that referenced this pull request Oct 19, 2023
Summary:
Make the `RecoverFromRetryableBGIOError` function always mark `recovery_in_prog_` to false when it returns.
Otherwise, in below code snippet, when db closes and the `error_handler_.CancelErrorRecovery()` call successfully joined the recovery thread, the immediately following while loop will incorrectly think the error recovery is still in progress and loops in `bg_cv_.Wait()`.

https://github.com/facebook/rocksdb/blob/1c871a4d8682ea260ba3b18ed43cd525a2141733/db/db_impl/db_impl.cc#L542-L545

This is the issue #11440

Pull Request resolved: #11890

Reviewed By: anand1976

Differential Revision: D49624216

Pulled By: jowlyzhang

fbshipit-source-id: ee10cf6527d95b8dd4705a326eb6208d741fe002
Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
…11890)

Summary:
Make the `RecoverFromRetryableBGIOError` function always mark `recovery_in_prog_` to false when it returns.
Otherwise, in below code snippet, when db closes and the `error_handler_.CancelErrorRecovery()` call successfully joined the recovery thread, the immediately following while loop will incorrectly think the error recovery is still in progress and loops in `bg_cv_.Wait()`.

https://github.com/facebook/rocksdb/blob/532d907d7f90ca621b4cd64b2a334eb18a594fd0/db/db_impl/db_impl.cc#L542-L545

This is the issue meta#11440

Pull Request resolved: meta#11890

Reviewed By: anand1976

Differential Revision: D49624216

Pulled By: jowlyzhang

fbshipit-source-id: ee10cf6527d95b8dd4705a326eb6208d741fe002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants