[WIP, DNM] storage: correctly determine cases where intent history is… #94802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… 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