Skip to content

feat: Add global memory-budgeted MappingManager with serverless support#5

Merged
nknize merged 1 commit intomainfrom
enhance/reduceMemory
Feb 2, 2026
Merged

feat: Add global memory-budgeted MappingManager with serverless support#5
nknize merged 1 commit intomainfrom
enhance/reduceMemory

Conversation

@nknize
Copy link
Member

@nknize nknize commented Feb 2, 2026

  • Implement global singleton MappingManager with 4GB default mmap budget
  • Add memory-based LRU eviction with 10% hysteresis headroom
  • Add read-only checkpoint mode for fast serverless reader startup
  • Add forceCheckpoint() for clean writer shutdown before reader handoff
  • Environment variable config: XTREE_MMAP_BUDGET, XTREE_MMAP_WINDOW_SIZE

Serverless pattern now works:

  • Writer: insert → forceCheckpoint() → exit
  • Reader: open(read_only=true) → query (no WAL replay, ~0ms startup)

Test fixes:

  • OTCheckpointTest: add mark_live_commit() after allocate()
  • CheckpointCoordinatorTest: fix SizeBasedTrigger assumptions

Known limitation: Multi-field scaling limited by pinned mmap windows
(512MB per field). Lazy remapping needed for 1000+ field workloads.

  - Implement global singleton MappingManager with 4GB default mmap budget
  - Add memory-based LRU eviction with 10% hysteresis headroom
  - Add read-only checkpoint mode for fast serverless reader startup
  - Add forceCheckpoint() for clean writer shutdown before reader handoff
  - Environment variable config: XTREE_MMAP_BUDGET, XTREE_MMAP_WINDOW_SIZE

  Serverless pattern now works:
  - Writer: insert → forceCheckpoint() → exit
  - Reader: open(read_only=true) → query (no WAL replay, ~0ms startup)

  Test fixes:
  - OTCheckpointTest: add mark_live_commit() after allocate()
  - CheckpointCoordinatorTest: fix SizeBasedTrigger assumptions

  Known limitation: Multi-field scaling limited by pinned mmap windows
  (512MB per field). Lazy remapping needed for 1000+ field workloads.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize added the feature label Feb 2, 2026
@nknize nknize merged commit 3c18d7c into main Feb 2, 2026
5 of 7 checks passed
@nknize nknize deleted the enhance/reduceMemory branch February 2, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant