Skip to content

storage: remove readOnlyCmdMu#28813

Closed
benesch wants to merge 1 commit intocockroachdb:masterfrom
benesch:rmrocm
Closed

storage: remove readOnlyCmdMu#28813
benesch wants to merge 1 commit intocockroachdb:masterfrom
benesch:rmrocm

Conversation

@benesch
Copy link
Copy Markdown
Contributor

@benesch benesch commented Aug 19, 2018

I can't prove that this lock provides any necessary synchronization. It
was introduced in the days before prop-eval KV and finer-grained
dependency tracking in the command queue.

I'm not actually suggesting that we land this PR in the 2.1 timeframe,
but I wanted to get a CI run and a conversation started.

Release note: None

@benesch benesch requested a review from a team August 19, 2018 16:53
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@benesch benesch added the do-not-merge bors won't merge a PR with this label. label Aug 19, 2018
I can't prove that this lock provides any necessary synchronization. It
was introduced in the days before prop-eval KV and finer-grained
dependency tracking in the command queue.

I'm not actually suggesting that we land this PR in the 2.1 timeframe,
but I wanted to get a CI run and a conversation started.

Release note: None
@benesch
Copy link
Copy Markdown
Contributor Author

benesch commented Aug 20, 2018

The more I look into this, the more confidence I gain in this change. Anywhere we were blocking reads with this mutex, we needed to block writes, too—and we invented separate mechanisms for doing so as we played whack-a-mole with the resulting serializability violations. See #17109 for one such example.

More details in #core.

@benesch benesch requested review from nvb and tbg August 20, 2018 10:37
Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

This change LGTM but I don't know enough about this BlockReads option to know whether it's protecting something subtle or what we need to do to prove that it's not (no longer?) necessary.

Copy link
Copy Markdown
Contributor

@bdarnell bdarnell left a comment

Choose a reason for hiding this comment

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

I don't think the propEvalKV command queue changes made this mutex obsolete - it's not about KV-level read/write conflicts, it's about the timestamp cache (which is mutated by reads). However, I think the combination of #17109 (for leases) and the move to a store-level timestamp cache (as opposed to replica-level, which means splits no longer copy the timestamp cache or otherwise have special interactions with it) may have done the trick.

Reviewed 9 of 9 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@benesch
Copy link
Copy Markdown
Contributor Author

benesch commented Sep 10, 2018

Yes, I agree. I consider #17109 to be part of the move to prop-eval KV since things prop-eval KV was incorrect without it. :)

I'll update the commit message to be more precise before I merge. I'm not going to merge for a while yet since I won't be able to own the fallout, if any, until range merges are little more stable. If someone else would like to take responsibility for this change, though, feel free to commandeer this PR and merge.

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

I agree with Ben's comment. Please add an explanation of the scenarios in an appropriate place, for example the split trigger. (I know you're just letting this sit for now, so no rush).

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@nvb
Copy link
Copy Markdown
Contributor

nvb commented Nov 26, 2018

There's some discussion in #32583 that questions the safety of this change.

@benesch
Copy link
Copy Markdown
Contributor Author

benesch commented Dec 7, 2018

Ok, sounds like this isn't safe after all!

@benesch benesch closed this Dec 7, 2018
@benesch benesch deleted the rmrocm branch December 7, 2018 16:07
@knz
Copy link
Copy Markdown
Contributor

knz commented Jan 8, 2019

Discussed this with tobias today -- a solution would be to have the span latch manager take over the concern using a fake mvcc request at timestamp 0. Will need to investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge bors won't merge a PR with this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants