Skip to content
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

[WIP, DNM] storage: correctly determine cases where intent history is… #94802

Closed
wants to merge 1 commit into from

Conversation

arulajmani
Copy link
Collaborator

… required

Read-only requests that drop their latches early, before evaluation, scan the lock table to resolve conflicts in
ScanConflictingIntentsForDroppingLatchesEarly. A request needs to determine if it needs access to the intent history during the scan phase. Typically, this happens if the lock table scan uncovers an intent from the same transaction but at a higher sequence number. However, we may also find intents at lower sequence numbers but at higher timestamps (e.g, the intent was pushed by a conflicting transaction) -- these intents need to be read, and to correctly do that during the scan phase, we need access to the intent history.

Note that this only applies to intents at strictly higher timestamps. Previously, we would determine we needed access to the intent history even if the intent history was at the same timestamp as the read request. In practice, this is quite common, which ends up meaning that we default back to the intent interleaving iterator more often than we need to. This patch fixes this behaviour.

References #94337 -- see explanation for "what's the deal with pg_sleep.

Epic: none

Release note: None

… required

Read-only requests that drop their latches early, before evaluation,
scan the lock table to resolve conflicts in
`ScanConflictingIntentsForDroppingLatchesEarly`. A request needs to
determine if it needs access to the intent history during the scan
phase. Typically, this happens if the lock table scan uncovers an
intent from the same transaction but at a higher sequence number.
However, we may also find intents at lower sequence numbers but
at higher timestamps (e.g, the intent was pushed by a conflicting
transaction) -- these intents need to be read, and to correctly do
that during the scan phase, we need access to the intent history.

Note that this only applies to intents at strictly higher timestamps.
Previously, we would determine we needed access to the intent history
even if the intent history was at the same timestamp as the read
request. In practice, this is quite common, which ends up meaning
that we default back to the intent interleaving iterator more often
than we need to. This patch fixes this behaviour.

References cockroachdb#94337 -- see explanation for "what's the deal with
`pg_sleep`.

Epic: none

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@arulajmani arulajmani closed this Mar 16, 2023
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.

2 participants