feat(server): run the receiver data write path on the resolved Store (RFC 0019 slice 2c) - #298
Conversation
…(slice 2c) The receiver's RFC 0014 write path was pinned to a local Store: ReceiverConfig took a bucket_root PathBuf and serve() built Store::local from it, so main() fail-fast-rejected the receiver on s3. The pipeline (ParquetRecordSink) is already Store-based, so this just threads the resolved Store through: ReceiverConfig now takes an opened Store, serve() uses it directly (the server pre-creates the local root + opens the store in its preflight), and main() clones the one opened store into the receiver and the compactor. Ingest now lands Parquet on local or S3. The WAL stays local regardless (§3.6). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthrough
Receiver Store Unification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 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.
Actionable comments posted: 1
🤖 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 `@crates/ourios-server/src/main.rs`:
- Around line 331-342: Receiver startup wiring is not covered: add a focused
test around the server’s receiver setup path that verifies `receiver::serve`
receives the correct `ReceiverConfig.store` for both `StoreConfig::Local` and
`StoreConfig::S3`. Place the test near `receiver.rs` or the server module and
exercise the code that builds `ReceiverConfig` in
`build_receiver_config`/`receiver::serve`, asserting the store is threaded
through unchanged for both backends.
🪄 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: c35b4bda-2abe-4664-8514-a55d27264cd5
📒 Files selected for processing (2)
crates/ourios-server/src/main.rscrates/ourios-server/src/receiver.rs
There was a problem hiding this comment.
Pull request overview
This PR updates the ourios-server binary so the OTLP receiver’s RFC 0014 data write path uses the already-resolved ourios_parquet::Store (local or S3) instead of hardcoding a local filesystem root. This aligns the receiver with the existing Store-based parquet sink and removes the prior “receiver on S3” startup restriction.
Changes:
- Replace
ReceiverConfig.bucket_root: PathBufwithReceiverConfig.store: Storeand wire the receiver sink directly to that store. - Remove receiver-side local-root creation +
Store::local(...)bootstrap, relying on server startup preflight to open the store. - In
main, share the preflight-openedStorewith the receiver viastore.clone()and drop the receiver-on-S3 fail-fast.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/ourios-server/src/receiver.rs | Receiver config now carries an opened Store; receiver sink writes via the resolved backend (local/S3). |
| crates/ourios-server/src/main.rs | Store is preflight-opened once and cloned into the receiver; receiver no longer rejects S3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… fixes Review: add a focused receiver::serve test (local backend) covering the new ReceiverConfig.store plumbing — binds :0, drives the store-backed sink, shuts down cleanly (multi-thread runtime, since serve uses block_in_place); S3 is the slice-3 localstack e2e. Also: the receiver writes data+manifest objects (not the audit stream — that's the compactor's still-local sink); and the preflight store is shared by receiver+compactor, while the querier opens its own handle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Threads the resolved
Store(local or S3) through the receiver's RFC 0014 data write path, so OTLP ingest lands Parquet on either backend (RFC 0019 slice 2c). This removes the receiver-on-s3 fail-fast that slice 2b (#297) added.The pipeline was already Store-based —
ParquetRecordSink::new(store, …)— but the receiver hardcoded local:ReceiverConfigtook abucket_root: PathBufandserve()builtStore::localfrom it. Now:ReceiverConfigtakes an openedStoreinstead ofbucket_root.serve()uses it directly — dropping its owncreate_dir_all+Store::local(the server already pre-creates the local root and opens the store in its startup preflight).main()opens the store once (the existing preflight) and clones it into the receiver (StoreisArc-backed, cheap) while moving the original intoCompactor::new— receiver, querier, and compactor all share the one store. The receiver-on-s3 fail-fast is removed.Invariants (CLAUDE.md §3.4 / §3.6)
wal.rootand snapshots underwal.root/snapshotson local disk, regardless of backend.rfc0013_6_wal_stays_local(binary-spawn, local backend) still passes.Scope / follow-ups
ParquetAuditSink) is still local-only → on s3 the compactor uses a no-op sink (logged). That's slice 2d, the last code seam before the slice-3 e2e flips RFC 0019green.Tests
ReceiverConfigis binary-internal (thereceivermodule is private), so onlymain()constructs it — no test churn. Allourios-servertests pass (34/0; incl. the binary-spawningrfc0013_6_wal_stays_local). No test asserted the removed fail-fast.Local gate
cargo fmt --all --check,cargo clippy -p ourios-server --all-targets --all-features -D warnings,RUSTDOCFLAGS=-D warnings cargo doc -p ourios-server,cargo test -p ourios-server— all green.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Correction (per review):
main()shares the one preflight-openedStorebetween the receiver (cloned) and the compactor (moved); the querier opens its own handle from the sameStoreConfiginsidequerier::serve. (Comment inmain.rscorrected accordingly.)