Commit 419d07b
refactor(storage): remove Engine abstraction (#365)
* docs(storage): plan concrete RocksDB ownership migration
* fix(runtime): drain RocksDB owners during storage swap
* fix(runtime): let paused monitors observe shutdown
* refactor(storage): use concrete RocksDB ownership
* fix(storage): own RocksDB shutdown lifecycle
Wrap the concrete DB in a non-cloneable shutdown owner so Redis waits for active RocksDB background work before the final handle can be released from a callback thread. Expose only a borrowed DB accessor and cover the active compaction-filter drop race with a real RocksDB regression test.
Tested: cargo +1.95-x86_64-pc-windows-msvc test --package storage --quiet
Tested: 5x cargo +1.95-x86_64-pc-windows-msvc test --package storage --lib dropping_last_owner_waits_for_active_compaction_filter_before_reopen -- --test-threads=1
Tested: rustfmt +1.95-x86_64-pc-windows-msvc --edition 2024 --check src/storage/src/redis.rs src/storage/src/data_compaction_filter.rs src/storage/tests/redis_basic_test.rs src/storage/tests/redis_hash_test.rs src/storage/tests/redis_set_test.rs src/storage/tests/redis_zset_test.rs
Tested: cargo +1.95-x86_64-pc-windows-msvc clippy --package storage --lib -- -D warnings -D clippy::unwrap_used
Co-authored-by: OmX <omx@oh-my-codex.dev>
* refactor(raft): store logs in concrete RocksDB handles
* docs(storage): define the unique RocksDB shutdown owner
* test(storage): harden RocksDB lifecycle coverage
Signal from inside the unique owner Drop before background cancellation so the active-compaction regression cannot pass merely because the drop thread was not scheduled. Route the exported DB/CF macro through Redis::db() and exercise its expansion from an external integration crate.
Tested: 10x cargo +1.95-x86_64-pc-windows-msvc test --package storage --lib dropping_last_owner_waits_for_active_compaction_filter_before_reopen -- --test-threads=1
Tested: cargo +1.95-x86_64-pc-windows-msvc test --package storage --lib --quiet
Tested: cargo +1.95-x86_64-pc-windows-msvc test --package storage --quiet
Tested: rustfmt +1.95-x86_64-pc-windows-msvc --edition 2024 --check src/storage/src/redis.rs src/storage/tests/redis_basic_test.rs
Tested: cargo +1.95-x86_64-pc-windows-msvc clippy --package storage --lib -- -D warnings -D clippy::unwrap_used
Tested: cargo +1.95-x86_64-pc-windows-msvc clippy --package storage --test redis_basic_test --no-deps -- -D warnings -D clippy::unwrap_used
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(raft): drain storage owners before snapshot restore
* refactor(storage): remove the Engine abstraction crate
* docs(raft): plan transactional snapshot installation
* refactor(storage): stage snapshot restore before commit
* fix(raft): gate every hot-swappable storage owner
* fix(raft): persist snapshot install recovery state
* fix(raft): make snapshot pauses cancellation-safe
* docs: plan Python integration hardening
* ci(test): run Python integration tests against Kiwi
Start a dedicated temporary Kiwi instance for Ubuntu integration tests and make server availability a strict pytest gate in CI. Isolated runs flush the dedicated database around every test while ordinary local runs retain skip and prefix-cleanup behavior.
Constraint: Keep lifecycle management in the test harness and do not modify product or test-case code.
Tested: strict unavailable-server failure; ordinary local skip; missing binary, occupied port, and early server exit paths; bash syntax; staged diff check; isolated list sequence reports 2 passed.
Not-tested: Full Python suite depends on the remaining Redis compatibility fixes in later plan tasks.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(resp): encode nulls for negotiated protocol
* fix(resp): encode RESP2 null correctly
* fix(storage): preserve binary string values
* test(storage): cover multi-instance binary mget
* fix(storage): support Redis key glob matching
* fix(storage): make key glob matching binary safe
* test: align Python integration tests with Redis semantics
Correct MSET compatibility expectations and make concurrent observations use one MGET snapshot. Propagate worker failures through futures so pytest cannot silently pass thread assertion errors.
Constraint: Python integration tests only; no Rust, fixture, or CI harness changes.
Rejected: Sequential GET and LLEN/LRANGE comparisons because they observe different command boundaries.
Confidence: high
Scope-risk: Test expectations and concurrency orchestration only.
Tested: py_compile; pytest --collect-only (55 tests); targeted old-binary probe (2 expected atomicity failures, corrected semantic tests pass).
Not-tested: Full Python suite awaits the matching multi-instance storage fix and rebuilt Kiwi binary.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* test: propagate Python worker failures
Let ThreadPoolExecutor futures preserve worker tracebacks, remove the stress-test exception sink, and register exact test keys for unconditional cleanup after failures.
Constraint: Follow-up touches only the four Python integration test files from the prior semantics commit.
Rejected: Prefix-based cleanup and collected exception counters because they can hide worker failures or affect unrelated local keys.
Confidence: high
Scope-risk: Test orchestration and cleanup only.
Tested: WSL venv py_compile; pytest --collect-only (55 tests); git diff --cached --check.
Not-tested: Runtime suite awaits the concurrent Rust storage changes in the shared worktree.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(storage): match Redis glob class edge cases
* fix(storage): serialize multi-instance multi-key commands
* fix(storage): match Redis empty glob edge cases
* test: harden multi-key concurrency coverage
Observe DEL/MSET races with a synchronized MGET worker, namespace every touched Redis key, and bound concurrent and slow tests with pytest-timeout plus future deadlines.
Constraint: Only the four Python integration test files are changed; existing Rust work remains separate.
Rejected: Final-state-only atomicity checks, generic local Redis key names, and unbounded executor waits.
Confidence: high
Scope-risk: Test naming, isolation, synchronization, and timeout behavior only.
Tested: WSL venv py_compile; pytest --collect-only (55 tests); combined Python diff check from 4b43a22^.
Not-tested: Runtime Python suite awaits the final rebuilt Kiwi binary.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(storage): preserve scan allkeys matching
* test: bound Python integration I/O
Bound redis-py connect/read operations and make the DEL/MSET observer handshake wait for a completed mutation before sampling while holding the last mutator until that sample completes.
Constraint: Only tests/python/conftest.py and the MSET concurrency test are changed; Rust work remains separate.
Rejected: Permanently-set activity flags because they do not prove the sample happened before mutation completion.
Confidence: high
Scope-risk: Python test client timeouts and deterministic concurrency synchronization only.
Tested: WSL venv py_compile; pytest --collect-only (55 tests); strict no-server mode exits non-zero without skipping; combined Python diff check.
Not-tested: Runtime suite awaits the final rebuilt Kiwi binary.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(storage): make command visibility gate async
* test: guarantee concurrent mutation observation
Pause both mutators immediately after their first DEL or MSET until the observer validates a single MGET snapshot, then let them finish the remaining iterations before marking mutation completion.
Constraint: Only tests/python/test_mset_concurrent.py changes; client timeout and Rust history remain untouched.
Rejected: End-of-loop overlap gates because they do not force observation before subsequent mutations.
Confidence: high
Scope-risk: Deterministic test synchronization only.
Tested: WSL venv py_compile; pytest --collect-only (55 tests); current and combined Python diff checks.
Not-tested: Runtime suite awaits the final rebuilt Kiwi binary.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(storage): preserve list tail after initial lpush
* fix(storage): preserve binary scan entries
* fix(storage): make snapshot restore durable
* perf(storage): seek binary hscan prefixes
* fix(raft): preserve snapshot cleanup marker
* refactor(cmd): centralize scan option parsing
Share cursor, MATCH, and COUNT parsing across HSCAN, SSCAN, and ZSCAN while preserving binary patterns and existing error semantics. Align the KEYS test module with the project unwrap lint convention.
Constraint: Keep storage scan APIs and command-visible behavior unchanged.
Rejected: Changing MGET locking, snapshot pause handling, Windows durability dependencies, or unrelated review suggestions.
Confidence: high
Scope-risk: Command parser refactor and test lint annotation only.
Tested: WSL Rust 1.95 cargo fmt --check; cargo test -p cmd (105 passed); cargo clippy -p cmd --all-features with warnings and unwrap denied.
Not-tested: Full workspace test suite and remote CI; both will run after push.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix: harden snapshot coordination and glob matching
Split snapshot state and publication coordination so apply resumes after checkpoint while snapshot publication remains serialized. Correct repeated-star matching for empty Redis keys and scan entries, with deterministic cancellation and error-path coverage.
Constraint: Preserve fail-closed snapshot install marker semantics and existing public storage APIs.
Rejected: A single long-held snapshot mutex, fixed-duration concurrency assertions, or public test hooks.
Confidence: high
Scope-risk: Raft snapshot locking and cancellation plus empty-byte glob matching in KEYS, HSCAN, and SSCAN.
Tested: WSL Rust 1.95 workspace clippy with warnings and unwrap denied; cargo test -p raft (106 passed); cargo test -p storage glob_tests (10 passed); cargo test -p cmd (107 passed); Windows and WSL cargo fmt --check; git diff --check.
Not-tested: Full workspace cargo test, Python integration suite, and remote CI.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(storage): restore Redis empty glob semantics
Restore Redis-compatible initial-empty-string handling in the generic glob matcher while retaining the command-level exact single-star special case. Update KEYS, HSCAN, and SSCAN tests to distinguish '*' from repeated-star patterns.
Constraint: Preserve the snapshot coordination fixes, public storage APIs, and all non-empty glob behavior.
Rejected: Updating the existing storage integration tests to accept repeated-star matches, because Redis 8.4 source and a live Redis comparison show that behavior is incompatible.
Confidence: high
Scope-risk: Empty key, hash field, and set member filtering for KEYS, HSCAN, and SSCAN patterns only.
Tested: Live Redis comparison for '*', '**'; WSL Rust 1.95 full workspace cargo test; workspace clippy with warnings and unwrap denied; six focused glob and command tests; cargo fmt --check; git diff --check.
Not-tested: Local address sanitizer instrumentation and remote CI rerun.
Co-authored-by: OmX <omx@oh-my-codex.dev>
---------
Co-authored-by: OmX <omx@oh-my-codex.dev>1 parent 9d94641 commit 419d07b
69 files changed
Lines changed: 7840 additions & 1908 deletions
File tree
- .github/workflows
- docs/superpowers
- plans
- specs
- src
- cmd/src
- common/runtime
- engine
- src
- executor/src
- net/tests
- raft
- src
- grpc
- tests
- resp
- src
- tests
- server/src
- storage
- src
- tests
- tests
- python
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 68 | + | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
0 commit comments