perf: remove two redundant object-store calls in datasets metadata fetch - #1760
perf: remove two redundant object-store calls in datasets metadata fetch#1760prabhaks wants to merge 1 commit into
Conversation
…etch get_manifest_list fetched the base stream.json unconditionally, but on Query/Prism-mode nodes that result was never read since those modes merge every ingestor's stream.json instead. Move the fetch into the branch that actually needs it (Mode::All). get_first_and_latest_event_from_storage awaited its two independent extract_timestamp_for_date calls sequentially. Run them concurrently with try_join! instead. Both are part of the object-store I/O behind POST /api/prism/v1/datasets, which has been observed taking 50s+ on multi-TB, multi-day deployments.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe query code now loads the base stream JSON only for non-Query/Prism modes. The storage code now performs minimum-date and maximum-date timestamp lookups concurrently while preserving error propagation. ChangesQuery manifest loading
Storage timestamp lookup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR removes a redundant object-store request and parallelizes two independent reads to reduce dataset metadata latency while preserving successful-path behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Summary
Two small, low-risk fixes in the object-store I/O behind
POST /api/prism/v1/datasets, which has been observed taking 50s+ to respond on multi-TB, multi-day deployments even on a 44 vCPU / 192GB query node.get_manifest_list(src/query/mod.rs) unconditionally fetched the basestream.jsonviaget_stream_json, but onMode::Query/Mode::Prismnodes that result is never read (those modes merge every ingestor'sstream.jsoninstead viaget_all_stream_jsons). Moved the fetch into theelsebranch that actually needs it (Mode::All).get_first_and_latest_event_from_storage(src/storage/object_storage.rs) awaited its two independentextract_timestamp_for_datecalls sequentially. Replaced withtokio::try_join!to run them concurrently, matching the existingtokio::join!pattern already used one call up the stack inget_prism_logstream_info.Both changes are behavior-preserving on the success path (same I/O, fewer/faster round trips). Two notes worth flagging for review:
get_manifest_listchange means a failed/corrupt basestream.jsonon a Query-mode node no longer short-circuits the whole call — it now proceeds toget_all_stream_jsonsinstead, which can succeed where the old code would fail. This seems like a desirable side effect but is a real change in failure-path behavior, not just a speedup./datasetslatency (bundles stats/retention/hottier/info/counts/query per stream); the dominant cost — a manifest-list scan that's unbounded by stream history when no retention policy is configured — needs a larger catalog-level change and is intentionally not part of this PR. Happy to open a separate issue for that once there's an associated tracking issue for this one (the Parseable team mentioned they'd be opening one).Test plan
cargo test --lib— 426 passed, 0 failed (full existing suite, no regressions)cargo fmt --check— cleancargo clippy --lib— cleanSummary by CodeRabbit