Skip to content

Versioned Secondary Indexes — HEAD/TAIL buffer for MVCC isolation - #97

Merged
nockawa merged 1 commit into
mainfrom
feature/58-versioned-secondary-indexes
Feb 24, 2026
Merged

nockawa merged 1 commit into
mainfrom
feature/58-versioned-secondary-indexes

Conversation

@nockawa

@nockawa nockawa commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces TAIL version-history buffers for AllowMultiple secondary indexes, fixing two MVCC snapshot isolation bugs (stale reads and phantom reads)
  • Adds VersionedIndexEntry struct (Active/Tombstone sign-encoded entries) and IndexBufferExtraHeader for typed HEAD→TAIL linkage
  • Extends VariableSizedBufferSegment with generic <T, TExtraHeader> subclass for domain-specific extra headers without polluting the general-purpose root header
  • Implements write path (TAIL appends on create/update/delete), read path (TemporalIndexQuery), and GC (TailGarbageCollector)
  • Adds IBTree.Add overload with out bufferRootId to avoid redundant TryGet on create path

Closes #58, closes #59

Test plan

  • 1450 existing tests pass with 0 failures
  • 18 new versioned index tests covering all phases (infrastructure, write path, temporal query, GC)
  • VariableSizedBufferRootHeader back to 32 bytes — non-index VSBS users unaffected
  • ManagedPagedMMFTests deletion range verified for restored root header size

@nockawa
nockawa merged commit 2fbc587 into main Feb 24, 2026
5 checks passed
@nockawa
nockawa deleted the feature/58-versioned-secondary-indexes branch February 24, 2026 22:22
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.

Versioned Secondary Indexes — HEAD/TAIL buffer, fix MVCC violations Tier 6: Versioned Secondary Indexes

1 participant