[kv] Implement KvTablet RocksDB Lazy Open#2914
Open
platinumhamburg wants to merge 1 commit intoapache:mainfrom
Open
[kv] Implement KvTablet RocksDB Lazy Open#2914platinumhamburg wants to merge 1 commit intoapache:mainfrom
platinumhamburg wants to merge 1 commit intoapache:mainfrom
Conversation
d50f88a to
85126d0
Compare
Defer RocksDB open to first access and auto-release idle tablets to reduce memory usage on tablet servers with many KV buckets. Key design: - Sentinel pattern: lightweight KvTablet shell with RocksDBState hot-swapped via single volatile write - 6-state lifecycle (LAZY/OPENING/OPEN/RELEASING/FAILED/CLOSED) with generation+epoch fencing - Guard/Pin mechanism: lock-free fast path for OPEN state, blocking slow path triggers on-demand open - Idle release: periodic scan releases tablets idle beyond timeout, preserving local SST files for fast reopen - Cold-to-hot reopen loads local RocksDB + replays incremental logs, falls back to full snapshot download on failure Configs: kv.lazy-open.enabled (default false), kv.lazy-open.idle-timeout (default 24h). Metrics: kvTabletOpenCount, kvTabletLazyCount, kvTabletFailedCount (Gauge).
85126d0 to
a162972
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Defer RocksDB open to first access and auto-release idle tablets to reduce memory usage on tablet servers with many KV buckets.
Key design:
Configs: kv.lazy-open.enabled (default false), kv.lazy-open.idle-timeout (default 24h).
Metrics: kvTabletOpenCount, kvTabletLazyCount, kvTabletFailedCount (Gauge).
Purpose
Linked issue: close #2913 2913
Brief change log
Tests
API and Format
Documentation