-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lock dirty segs before incrementing ref counts (#12275)
This PR removes a race condition from dirty segments processing by: * ref counting finalized blocks - so they get ignored during open/close * lock the dirty segments on begin transaction The lock prevents the race condition where the retire process reads the refcount and starts processing the reopen of a file, then the view starts a transaction. The view iteration generally happens faster than the file operations - causing a race as the refcount is incremented while the operations is happening. I've tested this by running with race from scratch for amoy - and it now produces no data races, and panics.
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters