Skip to content

db/kv, db/state: fall back to the backing tx when in-mem history is disabled - #24243

Merged
AskAlexSharov merged 3 commits into
mainfrom
lupin012/overlay_history_fallback
Sep 23, 2026
Merged

AskAlexSharov merged 3 commits into
mainfrom
lupin012/overlay_history_fallback

Conversation

@lupin012

Copy link
Copy Markdown
Contributor

Closes #23500.

With in-memory history disabled, TemporalMemBatch cannot answer historical reads. It now says so
with kv.ErrInMemHistoryDisabled instead of an ad-hoc error, so overlay read views can tell that
condition apart from a reader failure: GetAsOf and HistorySeek on both MemoryMutation and
OverlayTemporalReadView treat the sentinel as a miss and read the backing temporal transaction.
Every other DomainReader error still reaches the caller.

Receipt-domain reads keep coming from memory.

Note for review: for a ts inside the not-yet-flushed window the backing transaction holds no
history, so the fallback answers with the value as of the last flush. Restricting the fallback to
ts below the batch boundary would need a new accessor on TemporalMemBatch — happy to add it if
preferred.

…isabled

TemporalMemBatch returns kv.ErrInMemHistoryDisabled instead of an ad-hoc error, so overlay read views
can tell "no history in memory" apart from a reader failure. Both MemoryMutation and
OverlayTemporalReadView treat that sentinel as a miss on GetAsOf and HistorySeek and read the backing
temporal transaction; every other DomainReader error still reaches the caller.
@lupin012
lupin012 marked this pull request as ready for review September 22, 2026 20:27
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit c655ac8 Sep 23, 2026
140 checks passed
@AskAlexSharov
AskAlexSharov deleted the lupin012/overlay_history_fallback branch September 23, 2026 01:29
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.

db: fall back when overlay in-memory history is disabled

2 participants