Skip to content

Sl sql integration#111478

Closed
michae2 wants to merge 2 commits intocockroachdb:masterfrom
michae2:sl-sql-integration
Closed

Sl sql integration#111478
michae2 wants to merge 2 commits intocockroachdb:masterfrom
michae2:sl-sql-integration

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented Sep 29, 2023

No description provided.

arulajmani and others added 2 commits September 28, 2023 21:36
Previously, FOR SHARE and FOR KEY SHARE would use non-locking KV scans.
Now that the lock table supports shared locks, we can use lock.Shared as
the locking strength for KV scans. This patch does that, and in doing
so, wires up SHARED locks end to end.

By default, we turn off this functionality for serializable transactions.
Instead, it's gated behind a session setting called
`enable_shared_locking_for_serializable`.

Informs cockroachdb#91545

Release note (sql change): SELECT FOR SHARE and SELECT FOR UPDATE
previously did not acquire any locks. Users issuing these statements
would expect them to acquire shared locks (multiple readers allowed,
no writers though). This patch switches over the behavior to acquire
such read locks.

For serializable transactions, we default to the old behaviour, unless
the `enable_shared_locking_for_serializable` session setting is set
to true. We'll probably switch this behavior in the future, but for
now, given shared locks are a preview feature, we gate things behind
a session setting.
Have fun on your trip, Arul!
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

Thanks so much!! 🙏

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

@michae2 michae2 closed this Sep 29, 2023
@michae2 michae2 deleted the sl-sql-integration branch September 29, 2023 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants