release: v0.8.1 — deploy-safe busy-poll (O3) + single-shard tuning preset#393
Conversation
…ip conf/moon-standalone.conf Deliver the best single-shard tuning as one flag and one file, and retire the pinned-cores-only caveat that the O3 contention governor made obsolete. `--profile standalone` already filled `--shards 1`, `--io-busy-poll-us 40`, and `--io-driver epoll`. It now additionally drops the jemalloc arena cap to 2 on `--features jemalloc` builds: a single-shard instance has one hot allocator thread, so the baked-in `narenas:8` (sized for the multi-shard thread-per-core layout) is oversized, and 2 arenas cut the allocator's per-arena metadata + dirty-page RSS baseline with no contention cost at this concurrency. The arena cap is resolved where it must be — in the pre-clap allocator re-spawn scan (`malloc_respawn::scan_argv`), the only path that reaches jemalloc before its one-time init. `apply_profile` mirrors the value into the config struct (gated to jemalloc builds) purely so the startup transparency log stays accurate; on non-jemalloc builds the profile makes no claim about an arena cap it cannot affect. Precedence is preserved end to end: an explicit `--memory-arenas-cap` always beats the profile fill, in both the pre-clap scan (`arenas_flag_seen` gate) and `apply_profile` (`flag_was_explicit`). Because the scan runs before the conf file is merged, a conf-file `profile standalone` sets the other three flags but not the arena cap — consistent with the existing CLI-only rule for the two allocator flags. New `conf/moon-standalone.conf`: an annotated, editable moon.conf shipping the same tuning (durability on) for operators who want to keep port / maxmemory / persistence settings alongside the preset. It documents the CLI-only arena caveat inline. Docs: tuning.md gains a "contention governor (auto-gating)" section and drops the "pinned cores only" warnings from the busy-poll and Profiles sections; configuration.md documents `--memory-thp`, `MOON_SPIN_ADAPTIVE`, and `MOON_SPIN_MAX_PREEMPTS_PER_SEC`; the guides/configuration, README, and scale-ha-architecture docs are updated to say the busy-poll is now safe on any host. Tests: scan_argv gains profile-fill + explicit-cap-wins coverage (5 cases, both flag spellings, malformed-explicit-suppresses-fill); apply_profile gains a jemalloc-gated explicit-cap-wins test and asserts the arena fill. Verified green on both the default (mimalloc) and runtime-tokio,jemalloc matrices; the conf file was smoke-tested end to end (PING / CONFIG GET / SET-GET, resolved shards=1 / epoll / busy-poll 40 / appendonly everysec). Refs #392 (O3 governor), docs/guides/tuning.md author: Tin Dang <tindang.ht97@gmail.com>
… CPU-cache digest closed Patch release folding the PRs merged after the v0.8.0 tag (#361–#392) plus the single-shard tuning preset shipped in this cycle. No new runtime code beyond the preset — bump, ledger roll, and doc flips only. Roll-up highlights: - Performance / CPU (the CPU-cache digest, adjudicated end to end by measurement): O3 per-shard contention governor makes --io-busy-poll-us deploy-safe on any host (#392); auxiliary threads re-pinned off shard cores (O5, #388); --memory-thp added as permanently-opt-in (O4, #387) after a soak DISQUALIFIED a default flip (#390); value-line prefetch (O1, #389) and a lock-free Notify swap (O2, #391) both rejected by measurement and recorded as dead ends. Idle-tick CPU trimmed to ~0.5–0.9% (#375/#378). - Correctness: multi-shard SWAPDB durable + abort-safe before +OK (#385); cold recovery re-attaches spilled keys to their own database (#383); SCAN stable-key guarantee + O(COUNT) hot pages + cold range-resume under offload (#379/#380/#382); data-dir instance lock (#363); DBSIZE/SCAN cold-plane visibility under offload (#362/#367); DashTable double-NeedsSplit recovery panic fixed. - Single-shard tuning: --profile standalone broadened + conf/moon-standalone.conf; tuning/configuration/README docs updated for the now-safe-everywhere busy-poll. Release gate: crash-matrix nightly full 46-cell matrix + ITERS=20 soak dispatched on the RC via workflow_dispatch, both green before merge (soak-first-then-tag). This patch touches no crash/persistence path, but the gate is run to hold the ritual. - Cargo.toml/Cargo.lock: 0.8.0 → 0.8.1 - CHANGELOG.md: [Unreleased] rolled to [0.8.1] — 2026-07-19 - RELEASES.md: v0.8.1 ledger entry (lag 0) - ROADMAP: current-release header + release-train row Refs RELEASES.md, docs/roadmap/ROADMAP.md author: Tin Dang <tindang.ht97@gmail.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughMoon v0.8.1 adds a single-shard standalone configuration preset, updates busy-polling guidance for shared hosts, applies a CLI-only jemalloc arena-cap default with explicit precedence, and updates release metadata and documentation. ChangesStandalone profile behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant scan_argv
participant ServerConfig
CLI->>scan_argv: Pass --profile standalone
scan_argv->>scan_argv: Detect explicit --memory-arenas-cap
scan_argv->>ServerConfig: Provide arena cap 2 when no explicit flag exists
ServerConfig->>ServerConfig: Apply standalone profile fields
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/config.rs (1)
331-339: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffRefactor to adhere to the 1500-line file size limit.
This file currently exceeds 2900 lines. As per coding guidelines, each Rust file must be kept at or below 1500 lines. Consider splitting the configuration logic into smaller, dedicated modules to improve maintainability and strictly adhere to this limit.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/config.rs` around lines 331 - 339, Split the configuration logic in config.rs into dedicated Rust modules so every resulting file is at or below the 1500-line limit. Preserve the existing public configuration API, behavior, profile handling, and startup validation while relocating cohesive logic and updating module references accordingly.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/config.rs`:
- Around line 331-339: Split the configuration logic in config.rs into dedicated
Rust modules so every resulting file is at or below the 1500-line limit.
Preserve the existing public configuration API, behavior, profile handling, and
startup validation while relocating cohesive logic and updating module
references accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b3dc4a42-0906-418a-a938-bbbc7ad4edc4
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (12)
CHANGELOG.mdCargo.tomlREADME.mdRELEASES.mdconf/moon-standalone.confdocs/configuration.mddocs/guides/configuration.mddocs/guides/tuning.mddocs/roadmap/ROADMAP.mddocs/roadmap/scale-ha-architecture.mdsrc/config.rssrc/malloc_respawn.rs
…for conf-file profiles Adversarial review of the standalone-preset commit found a HIGH-severity defect (empirically reproduced): when `profile standalone` is set as a KEY in a moon.conf, `apply_profile` still filled `memory_arenas_cap = 2` and logged "set --memory-arenas-cap=2", but the pre-clap allocator re-spawn (`malloc_respawn::scan_argv`) only sees the RAW command line — never the conf-merged token stream — so jemalloc actually stayed at narenas:8. That produced two contradictory startup log lines (the profile claim, then `warn_if_conf_only_overrides` firing "has NO effect") and falsified the commit/docs claim that a conf-file profile does not set the arena cap. Root cause: clap reports both CLI- and conf-sourced `--profile` as `CommandLine` on the merged argv, so apply_profile cannot distinguish them — only the raw pre-merge scan can. Fix: `apply_profile` no longer touches `memory_arenas_cap` at all. The allocator re-spawn is the single source of truth for the arena cap (it correctly honors only the CLI form, since jemalloc initialises before the conf file is parsed). This removes the false claim and the spurious warning, and makes the docs accurate. It also dissolves the review's secondary literal-drift finding: `STANDALONE_PROFILE_ARENAS` (malloc_respawn) is now the sole `2`, no longer mirrored across the lib/bin crate boundary. Behaviour after the fix (verified on a runtime-tokio,jemalloc build): - `moon --profile standalone` (CLI): re-spawn sets `_RJEM_MALLOC_CONF=narenas:2`, `MOON_ARENAS_CAP_APPLIED=1` — jemalloc really runs 2 arenas; no false log, no warning. - `profile standalone` as a conf key: no re-spawn env, jemalloc stays at 8, no arena-cap claim, no spurious warning — matching the docs. Docs: the tuning.md startup-log example drops the arena-cap field (it was never in the fields list); `conf/moon-standalone.conf` gains an explicit note that `profile standalone` as a conf key does not apply the arena cap; the config.rs profile doc comment states the cap is applied by the re-spawn on the CLI form only. Tests: `test_profile_standalone_fills_unset_fields` now asserts `apply_profile` leaves the cap at its default and never lists it in the fields log; the obsolete jemalloc-mirroring test is removed (arena precedence is covered by `scan_argv`'s own tests). Refs review of 7ba7762 author: Tin Dang <tindang.ht97@gmail.com>
Patch release folding the post-v0.8.0 perf/correctness train (#361–#392) plus a single-shard tuning preset shipped this cycle.
What's in it
Single-shard tuning preset (new work this PR)
--profile standalonebroadened: on--features jemallocbuilds it now also drops the jemalloc arena cap to2(single-shard has one hot allocator thread; 8 arenas are oversized). Resolved in the pre-clap allocator re-spawn scan — the only path that reaches jemalloc before init — so it's CLI-only; explicit--memory-arenas-capalways wins.conf/moon-standalone.confshipping the same tuning (durability on) as an editable config file.tuning.mdgains a contention-governor (auto-gating) section and drops the "pinned cores only" caveat from the busy-poll + Profiles sections;configuration.mddocuments--memory-thp,MOON_SPIN_ADAPTIVE,MOON_SPIN_MAX_PREEMPTS_PER_SEC; README + guides + architecture updated to say the busy-poll is safe on any host.Rolled up from #361–#392
--memory-thpopt-in (perf(config): --memory-thp — jemalloc transparent huge pages for the value heap (O4) #387) with the default flip disqualified by soak (docs(config): --memory-thp permanently opt-in — RSS-drift soak disqualifies the default flip #390); O1 prefetch (bench(storage): DashTable cache-exceeding probe benchmark; value-line prefetch rejected by measurement (O1) #389) + O2 Notify swap (docs(runtime): record the O2 Notify null result — flume stays, lock-free swap rejected by measurement #391) rejected by measurement. Idle-tick CPU → ~0.5–0.9% (perf(persistence): idle-tick cheap wins — O(1) pagecache resident counter + cached-clock checkpoint trigger (#373 phase 1) #375/perf(shard): adaptive idle park — stretch the 1ms tick to 10ms after proven quiet (#373 phase 2) #378).Release mechanics
0.8.0 → 0.8.1; CHANGELOG[Unreleased] → [0.8.1] — 2026-07-19; RELEASES.md ledger (lag 0); ROADMAP current-release + train row.Gate (soak-first-then-tag)
Crash-matrix nightly full 46-cell matrix +
ITERS=20probabilistic soak dispatched on this RC viaworkflow_dispatch, both green before merge. This patch touches no crash/persistence path, but the gate is run to hold the ritual.Verification
runtime-tokio,jemalloc.conf/moon-standalone.confsmoke-tested end to end (resolved shards=1 / epoll / busy-poll 40 / appendonly everysec; PING/SET/GET).unsafe.Summary by CodeRabbit
New Features
conf/moon-standalone.confand--profile standalonefor deploy-safe single-shard setups.Bug Fixes
--memory-arenas-capexplicitly overrides any standalone-implied arena-cap, even with tricky argument forms.Documentation
Release