Conversation
|
Reviewed 2 of 2 files at r1. storage/replica_command.go, line 1400 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 1 unresolved discussion. storage/replica_command.go, line 1400 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, all discussions resolved. storage/replica_command.go, line 1400 [r1] (raw file): Comments from the review on Reviewable.io |
storage/replica.go
Outdated
There was a problem hiding this comment.
readMu sounds confusingly similar to the RLock of the embedded RWMutex. Maybe call it readOnlyCmdMu?
I'd add more detail to the comment: "Held in read mode during read-only commands. Held in exclusive mode to prevent read-only commands from executing. Acquired before the embedded RWMutex"
|
Can you add a test that deliberately races a split with a read-only command? It doesn't have to consistently trigger the issue but it would be good to have a more reliable and explicit test than the rare failure of sql.TestConcurrentIncrements. (which only triggered this issue because of the non-obvious fact that table creation leads to an asynchronous split) |
|
I'll see what I can do about the test. |
eba97ba to
08a4168
Compare
|
Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions. storage/replica_command.go, line 481 [r1] (raw file): Comments from the review on Reviewable.io |
|
PTAL @bdarnell. I added a test that's flaky as hell before this fix, and also took into account the fact that the |
|
Reviewed 2 of 2 files at r2, 2 of 2 files at r3, 1 of 1 files at r4, 2 of 2 files at r5. storage/client_split_test.go, line 790 [r3] (raw file): Comments from the review on Reviewable.io |
|
LGTM Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 2 of 2 files at r3, 1 of 1 files at r4. storage/replica_command.go, line 481 [r1] (raw file): Comments from the review on Reviewable.io |
previously, concurrent reads during the execution of the splitTrigger could add updates to the timestamp cache on the old range after it had already been copied to the new range. With this change, reads happen atomically with respect to commit triggers. fixes cockroachdb#3148.
previously, concurrent reads during the execution of the
splitTrigger could add updates to the timestamp cache
on the old range after it had already been copied to
the new range. With this change, reads happen atomically
with respect to commit triggers.
fixes #3148.