Skip to content

[RocksDB][Minor] Metric modifications#4467

Open
AhmedSoliman wants to merge 7 commits intomainfrom
pr4467
Open

[RocksDB][Minor] Metric modifications#4467
AhmedSoliman wants to merge 7 commits intomainfrom
pr4467

Conversation

@AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Mar 9, 2026

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Test Results

  7 files    7 suites   2m 49s ⏱️
 47 tests  47 ✅ 0 💤 0 ❌
200 runs  200 ✅ 0 💤 0 ❌

Results for commit 20b2f89.

♻️ This comment has been updated with latest results.

Extract two generic, reusable utilities into restate-futures-util:

**monotonic_token**: A lightweight mechanism for a producer to signal
completion of a prefix of sequentially issued work items. Provides
Token<T>, TokenOwner<T>, Tokens<T>, and TokenListener<T> types with
a phantom type parameter to prevent mixing tokens from different domains.
Uses atomics (Relaxed/Release/Acquire) for lock-free operation — no
RwLock or watch overhead.

**waiter_queue**: A priority-drainable queue (WaiterQueue<K, V>) designed
for the common case where entries arrive in key-order. Uses an adaptive
strategy: push_back for in-order inserts (O(1)), binary-search insert for
out-of-order (rare). Drain is always a simple front-pop. Includes a
Criterion benchmark comparing four strategies (naive, compact,
adaptive, sorted-insert).

Both modules include comprehensive documentation and tests. Neither
references any specific use-case — they are general-purpose building
blocks.
…closed

This makes turning off loglet workers cleaner (next PR).
- Priority-queue based writer allowing seal messages to jump the queue
- Deduplication of seal messages and store messages
- Improved metrics for the write path (counting bytes, stores, and store status)
- Loglet workers will shutdown when quiescent and release resources
- Writer task limits the batch based on the memtable size as a reasonable guidance and removing the need for `write-batch-commit-count` config.
- Removed the returned WriteBatch in the error case since write errors are terminal. This reduces the size of the returned Result.
Replace raw usize/NonZeroUsize types with type-safe NonZeroByteCount
for all RocksDB memory budget configurations across the codebase.

Key changes:
- CommonOptions: make rocksdb_total_memory_size private behind a getter
  that enforces a 256 MiB minimum; rename rocksdb_actual_total_memtables_size
  to rocksdb_total_memtables_size with a 32 MiB floor; remove the 5% safety
  margin (rocksdb_safe_total_memtables_size); clamp memtables ratio to
  [0.1, 1.0] instead of [0.0, 1.0]
- LogServerOptions: remove data_service_memory_limit config (memory pool
  capacity is now derived from rocksdb_data_memtables_budget); fix metadata
  memtables budget to a constant 8 MiB instead of a ratio; enforce 40 MiB
  (32 MiB data + 8 MiB metadata) minimum for log-server memory budget
- MetadataServerOptions/StorageOptions: change rocksdb_memory_budget return
  types from usize to NonZeroByteCount with per-component minimums
- ByteCount: add arithmetic ops (Add, Mul, saturating_add/mul), Default,
  and TryFrom<u64> for NonZeroByteCount
- Remove unnecessary runtime assertions that were checking for non-zero on
  already non-zero types
Move db-level properties (is-write-stopped, background-errors,
num-running-compactions, actual-delayed-write-rate) from the per-CF set
to the per-DB set since they are database-wide. Also fix the unit of
actual-delayed-write-rate to Bytes and add blob-db metrics
(live-blob-file-size, live-blob-file-garbage-size) and
obsolete-sst-files-size for log-server observability.
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.

1 participant