-
Notifications
You must be signed in to change notification settings - Fork 454
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
Remove nested read lock to prevent deadlock #2128
Conversation
notes from our chat:
|
src/dbnode/storage/shard.go
Outdated
@@ -385,8 +385,12 @@ func (s *dbShard) RetrievableBlockColdVersion(blockStart time.Time) (int, error) | |||
// BlockStatesSnapshot implements series.QueryableBlockRetriever | |||
func (s *dbShard) BlockStatesSnapshot() series.ShardBlockStateSnapshot { | |||
s.RLock() | |||
defer s.RUnlock() | |||
return s.blockStatesSnapshotWithRLock() |
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.
is it safe to acquire the flushState RLock while holding the shard RLock?
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.
Yep, I checked usages of the flushState Rlock and they don't conflict have a relationship anywhere else in the code, so this should be good.
Codecov Report
@@ Coverage Diff @@
## master #2128 +/- ##
=========================================
- Coverage 69.9% 51.2% -18.8%
=========================================
Files 1001 828 -173
Lines 86476 75886 -10590
=========================================
- Hits 60478 38863 -21615
- Misses 21715 33702 +11987
+ Partials 4283 3321 -962
Continue to review full report at Codecov.
|
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, good stuff
What this PR does / why we need it:
Fixes #2127
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: