Repository navigation
feat(cyclestore): add opt-in logical-expiry controller - #631
Conversation
Use an implicit Euler-tour treap and binary lifting; add focused tests and the actual S0 three-way differential harness.
Preserve zero-side-effect receipt replay, refresh root incarnation on safe fence reset, compare graph identity independently, register PYTHONPATH, and enforce writer domains in Debug builds.
Keep default-OFF generic dfkv targets independent of test/cyclestore and register S1/S2/S3 targets with the module's own includes, hermetic dependencies and CTest entries.
Cover invalid-parent links and stale/non-leaf prune probes, count them in random traces, and preserve causally valid minimized failure projections for replay.
Hold the release-started event before PreparedRead::Commit while checking that replacement promotion is rejected. Then wait for physical removal to prove commit released the final send-pin before expecting promotion to succeed.
Retry only empty Linux argv reads until publication with a bounded one-second deadline. Preserve early-exit handling, strict argv matching, and detailed failure diagnostics. Add deterministic regressions for publication, timeout, exit, read failure, and argv mismatch.
|
Cross-reference: shared #633 adds a small, independent fixture-side opt-in for the two deliberate I compared the exact candidates using a virtual Git tree from The fixes are complementary:
If #633 integrates first, please preserve its helper forwarding and the two explicit opt-ins when replaying this PR's bounded-capture logic. If #631 integrates first, I will rebase #633 on the actual resulting main and re-run the combined harness and CI rather than treating this virtual-tree run as the final result. No force-push, branch takeover, or resource stop is being requested. #633 remains unqueued pending public CI and independent post-test/overlap review. |
|
Correction: the combined harness execution log now exists and is non-empty. My earlier cross-reference linked For the actual recaptured invocation, use: That log was captured with ordinary stdout+stderr redirection from the two harness files extracted from the same immutable virtual tree The complementary integration conclusion is unchanged: keep the bounded live-argv publication logic and the two explicit expected-natural-exit opt-ins, with all healthy argv checks and cleanup semantics retained. This remains a virtual-tree compatibility test, not actual approval or #630 whole-suite acceptance. Public CI on #633 still must complete before any queue. If #631 merges first, #633 will rebase on that actual base and rerun the combined harness and CI; if #633 merges first, the bounded capture replay on #631 should preserve these two opt-ins and re-run the combined tests on the resulting tree. |
Keep local checkpoint descriptors out of canonical business digests. Publish C<index> and CLATEST only after checkpoint verification succeeds. Filter shared-CF scans by record kind and reject empty keys explicitly.
- Detect creation with O_EXCL and fsync the parent before acknowledging a new journal. - Inject fsync failures in the journal unit test and verify existing appends skip directory sync.
- Stop and reap a live child when argv startup validation fails. - Cover timeout and missing-argv paths with real local process lifetime checks.
…op snapshots - Reject missing TTLs and duplicate persistent unique-index keys before business persistence. - Bind business checkpoints to braft's live applied index and ordered leadership term. - Cover replicated invalid-command recovery, first-no-op snapshots, and durable store faults.
|
Review gate: please do not merge the current head as-is. Independent source review found substantive issues, not merely a pending-maintenance delay: local checkpoint metadata contaminated replica canonical digests and could publish an unvalidated CLATEST; missing requested_ttl and duplicate unique keys could turn ordinary bad evidence into replicated StateMachineError; new journal creation lacked parent-directory fsync; leader no-op could leave snapshot term/index inconsistent; metadata scans mixed checkpoint and shard records; and argv publication failure could escape owned-process cleanup. The corresponding scoped fixes now have individual focused evidence, and combined-main verification is in progress. The previous public CI 13/13 does not cover the new substantive validation. A fresh head will still need independent review and real public CI before merge. No auto-merge, force push, or administrator bypass has been enabled. |
|
Review-fix update on the new head |
|
Merged through the repository-required native merge queue. Actual main/merge commit is |
Overview
Add the opt-in S1-S3 CycleStore foundation for logical cache expiry. The controller is a separate CPU-side component; it is not enabled on an existing production path.
dfkv_cycle_controllerusing braft/brpc for fixed-shard replication. Adds the protobuf interface, replicated apply/read-barrier read model, snapshot/fence/lease/receipt identity and three-replica fault handling.Dependency versions are locked and built into a controller-private static stack. The default remains
DFKV_BUILD_CYCLESTORE=OFF; CycleStore sources and tests are excluded from the existing dfkv/core/test globs, so existing server/MDS/client libraries do not inherit the controller's braft/brpc/RocksDB dependencies.Not included: S4 adapters, capability record kinds, perf branches or engine integration. This is not a rollout, a charging-model change, or a public service-entry switch.
Verification on this exact HEAD
1300000,1620001,1702000, with token/prune high-water1822000and explicit requested-TTL values.status=runevidence rather than being silently adjusted as one count.The original 1024 x 20,000 durability rollup is complete: 1,024 seeds, plus the deterministic cases, with 0 inconsistencies. Its 1,035 total cases collected 28,329,058 semantic events, 541,164,186 projection commands, 1,023,854,036 comparisons and 818,374 invalid-primitive probes. Summary SHA-256:
929ba4eab84a88dc4f5a72b5a68996b910c853d9796d10a7477177d7ba36af8f.Exit-status boundary: the durability client exit code is UNOBSERVED. The assertion here is specifically the complete rollup's 0 mismatch, not an exit code of 0.
Boundaries
This change does not enable production traffic or alter charging/deployment. It does not claim multi-group routing, cross-datacenter replication, production authentication/TLS, real-model/full-rank/P-D compatibility, engine adapters, or p99/RTO/SLA guarantees. Test-only controller/admin fixtures are not a production API or authority boundary.
GitHub CI and normal code review are still required before merge; this PR does not enable auto-merge.
Follow-up: test release gate
The releasing callback is held until the original false assertion executes, then checks the actual send-pinned disconnect. This is test-only synchronization, not a production-timing change. The targeted grant/quarantine case passes ordinary and true ThreadSanitizer runs; the ordinary
RdmaServerMwsuite is 14/14 PASS. These counts do not imply a Soft-RoCE environment passed.Gate result on
7428170d3ed6cfd620b6241f06c094e6de5d35c8CI run 46233662613 completed: 12/13 jobs succeeded, including RDMA datapath (Soft-RoCE loopback + TSan) and ThreadSanitizer (race detection).
build & test (g++)failed inpython_storage_activation_controls: 1,656 Passed / 99 Skipped / 1 Failed among 1,756 reported CTest results. The single reported Python error isOwnedPythonLifetimeTest.test_preexisting_control_daemon_exit_is_not_successful_cleanup: the harness observedactual argv mismatch for python-child: ['']instead of the expected command. The checked-in change is confined totest/transport/rdma_loopback_test.cc; this does not prove the separate harness check has no defect or is timing-only. No retry or harness modification was made by this check.Lifecycle argv-publication wait, head
cbf3f99d44c94faaef78f591bb31db6f96df2af0: only the two test harness paths changed.OwnedProcess.startretries solely while a live process has a zero-byte/proc/<pid>/cmdline(1 ms, maximum 1 s); any non-empty argv must match immediately and strictly. Read failures and publication timeout are harness errors, natural zombie exit is reaped and rejected by default, and the explicitallow_early_exitexception alone retainsactual_argv=None. Exact-HEAD review repeated the focused lifecycle/helper tests 11/11, the full Python module 45/45, and the formerly failing lifetime case 50/50, all with exit status 0. New CI run 46238412474 is 13/13 successful;python_storage_activation_controlspassed and its g++ CTest reported 1,684 Passed / 99 Skipped / 0 Failed (1,783), while the RDMA Soft-RoCE loopback + TSan gate also passed. Local review did not run real etcd/MDS/server acceptance and makes no production/performance claim; the earlier failed run remains recorded above, and auto-merge is not enabled.