-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql/opt: row-level locking and wait policy modes not propagated to index or lookup joins #56941
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I was unable to automatically find someone to ping. If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
cc @nvanbenschoten i think you might be familiar with the SFU locking behavior |
Thanks @rafiss. I'm taking a look. For me and others:
|
I'm able to reproduce. The issue appears to be that the index join present in the second query is not using the correct wait policy (or locking mode). So we're scanning the secondary index correctly, but not the primary index.
|
… inverted joins Fixes cockroachdb#56941. This commit updates the execbuilder to propagate row-level locking modes through transformations from standard Scan and Join operations to specialized IndexJoin, LookupJoin, and InvertedJoin operations. This is a WIP and needs some additional testing. I won't be able to get to that before the upcoming stability period starts, so this likely won't land in v21.1 unless someone else wants to pick this up.
I pushed a WIP fix for this to #60719, which likely won't land for the next release. This issue reveals an interesting change in expectations for SELECT FOR UPDATE. Before the addition of NOWAIT, it was mostly fine if locking policy propagation was best-effort because locking modes were just a performance optimization, so we didn't bother supporting it in all cases. Now that users have access to NOWAIT, they'll expect the wait policy to be propagated correctly in all cases. |
…ted joins Fixes cockroachdb#56941. This commit updates the execbuilder to propagate row-level locking modes through transformations from standard Scan and Join operations to specialized IndexJoin, LookupJoin, and InvertedJoin operations. Release note (sql change): table scans performed as a part of index joins, lookup joins, and inverted joins now respect the row-level locking strength and wait policy specified by the optional FOR SHARE/UPDATE [NOWAIT] clause on SELECT statements.
…ted joins Fixes cockroachdb#56941. This commit updates the execbuilder to propagate row-level locking modes through transformations from standard Scan and Join operations to specialized IndexJoin, LookupJoin, and InvertedJoin operations. Release note (sql change): table scans performed as a part of index joins, lookup joins, and inverted joins now respect the row-level locking strength and wait policy specified by the optional FOR SHARE/UPDATE [NOWAIT] clause on SELECT statements.
…ted joins Fixes cockroachdb#56941. This commit updates the execbuilder to propagate row-level locking modes through transformations from standard Scan and Join operations to specialized IndexJoin, LookupJoin, and InvertedJoin operations. Release note (sql change): table scans performed as a part of index joins, lookup joins, and inverted joins now respect the row-level locking strength and wait policy specified by the optional FOR SHARE/UPDATE [NOWAIT] clause on SELECT statements.
…ted joins Fixes cockroachdb#56941. This commit updates the execbuilder to propagate row-level locking modes through transformations from standard Scan and Join operations to specialized IndexJoin, LookupJoin, and InvertedJoin operations. Release note (sql change): table scans performed as a part of index joins, lookup joins, and inverted joins now respect the row-level locking strength and wait policy specified by the optional FOR SHARE/UPDATE [NOWAIT] clause on SELECT statements.
Describe the problem
I tried to use select for update nowait, but this statement got stuck. There was no result returned and no error was reported.
To Reproduce
4. See error
Expected behavior
You should report an error instead of being stuck
Environment:
Jira issue: CRDB-2890
The text was updated successfully, but these errors were encountered: