db: clear range key count during Batch Reset#1563
Conversation
a77a07b to
1728325
Compare
Previously, if a Batch was Reset its running count of range keys was not reset.
1728325 to
64b084d
Compare
jbowens
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @erikgrinaker and @nicktrav)
batch.go, line 947 at r1 (raw file):
b.commit = sync.WaitGroup{} b.commitErr = nil atomic.StoreUint32(&b.applied, 0)
I wanted to refactor this to clear the entire struct, except for what's explicitly copied, eg *b = Batch{/* ... */} but the race detector flags the nonatomic write to b.applied. I'm not sure if anything can done about that.
nicktrav
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @erikgrinaker)
|
Thanks! I see we're pooling batches, so this makes sense. |
jbowens
left a comment
There was a problem hiding this comment.
TFTRs!
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @erikgrinaker)
Previously, if a Batch was Reset its running count of range keys was not reset.