fix(collector): reseed replay-safe segments after warmup - #357
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe archiver separates scheduled seed eligibility from current-segment replay safety, adds a sequence-gap requirement to seed readiness, and tests that a later rotation seeds successfully after an initially incomplete segment. ChangesReplay-safe segment seeding
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@rust_hft/tools/collector/src/bin/binance-lob-archiver.rs`:
- Around line 4691-4701: Immediately after the initial rotate_segment call in
the test, assert that next.is_replay_safe() is false before any snapshots,
diffs, or trades mutate the scenario. Keep this assertion at the first-rotation
boundary to verify the unseeded, replay-unsafe startup behavior.
- Around line 1442-1446: Add a scheduled-rotation test case alongside the
existing sequence-gap coverage, setting reason to "scheduled" and
process_state.sequence_gaps to 1, then assert that no segment_open checkpoint is
emitted. Keep the existing stream-health setup and verify the new guard in
streams_healthy/depth_streams_healthy checkpoint eligibility independently of
reason.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 220b1d7b-3b79-4b5b-8628-9c4487e1da2a
📒 Files selected for processing (1)
rust_hft/tools/collector/src/bin/binance-lob-archiver.rs
Change contract: allow the Rust Binance market-tape collector to emit a replay-safe segment after an incomplete startup/warmup segment, while retaining fail-closed sequence-gap and stream-health checks.
Acceptance evidence:
cargo test -p hft-collector(all collector tests pass).cargo clippy -p hft-collector --bin binance-lob-archiver -- -D warningspasses.Out of scope: production cutover, shadow-gate policy, snapshot/research logic, historical backfill, and any relaxation of sequence-gap/reconnect checks.
Dependency / merge order: based on merged collector/control-plane release
76107013aa6e58de2e1053b9d5cb1befd4a8b3d9; merge before building the next ECS candidate.Focused validation: Rust collector unit/integration tests and targeted clippy. Full workspace format check remains blocked by pre-existing unrelated formatting drift; no unrelated files were changed.
Rollout / rollback impact: no production service changes on merge. Build the candidate, install it as shadow only, rerun the short test-only gate, and keep the old production collector active until a formal gate passes. Roll back by retaining the current production release and not promoting the candidate.
Summary by CodeRabbit