Repository navigation
Conversation
|
Please hold off on merging this, until this code refactor move lands? #3416 |
|
@jgraettinger okay 👍🏽 |
The preview-next fixture feeder parsed every line into a serde_json::Value, cloned it, rebuilt it as a HeapNode, archived, validated and keyed it, all on one task. TPC-DS benchmark runs were bound by it at ~85K docs/s while the runtime and connector idled. Streamed document lines are now batched and prepared on scoped worker threads, parsed once straight into a HeapNode with simd-doc, then pushed in fixture order, so blocks and clocks are unchanged. segments::push_binding keeps its signature and shares prepare_binding / push_prepared with the parallel path. --fixture-validate=false flags streamed documents valid unchecked, for generated fixtures known to be valid.
c5b4a2c to
6d54b29
Compare
Strix Security Review✅ No open security findings. PR summary: This PR speeds up the streaming `--fixture` feeder of `flowctl raw preview-next` by parsing each fixture line once straight into a `HeapNode` and preparing it into shuffle-log `Append`s on worker threads (then pushing them in fixture order). It also splits the segment writer into a state-free `build_append` and a stateful `push_append`, and adds a `--fixture-validate` flag (default on) that lets an operator skip schema validation for fixtures already known to be valid. Review summaryReviewed all three changed files in the diff: the new Ruled out (3)
Review history (3)
Review 3 on this PR · Reviewed by Strix |
The fixture feeder emulates the live slice, which reads a journal document into a shuffle::log_request::Append. Name the parallel step after it: segments::build_append returns an Append, push_append routes and buffers it, and a feeder worker is an AppendBuilder.
|
This PR has been rebased on latest changes and is ready for review again now that #3416 has been merged. Only affects runtime-local and preview_next |
| let first_seconds = txn.take_doc_seconds(batch.len() as u64); | ||
| let chunk = batch.len().div_ceil(builders.len()); | ||
|
|
||
| let built: Vec<anyhow::Result<Vec<Append>>> = std::thread::scope(|scope| { |
There was a problem hiding this comment.
I'm learning a little about Rust here. Does this hold a tokio worker without letting other tasks schedule, even when the task blocks on I/O?
OTOH, this seems to be CPU bound, so probably better to let it burn without interruption?
Description:
The
preview-nextfixture feeder parsed every streamed line into aserde_json::Value, cloned it, rebuilt it as aHeapNode, then archived, validated and keyed it, all on one task. Benchmark runs were bound by it: a TPC-DS scale 1 fixture through a no-op materialization ran at 84K docs/s with the runtime and connector mostly idle.shuffle::log_request::Appends on scoped worker threads, as the live slice builds them from journal reads: parsed once with simd-doc straight into aHeapNode, stamped with the synthetic UUID, archived, validated and keyed. The Appends are then routed and pushed in fixture order, so blocks and document clocks match a serial feeder.runtime_local::segmentssplits that work intobuild_append(no transaction state, safe to run in parallel) andpush_append(routing and serial block and frontier accounting).push_bindingkeeps its signature and uses both, so eager fixtures and catalog tests share one implementation.--fixture-validate=falseflags streamed documents valid unchecked, for generated fixtures known to be valid.Same TPC-DS run on a c3-standard-22: 84K → 142K docs/s.
Workflow steps:
flowctl raw preview-next --fixture <fifo> [--fixture-validate=false]. Output is unchanged.Documentation links affected:
None.
Notes for reviewers:
built_appends_match_the_value_pathchecks that the simd-doc path builds the same Appends as theserde_json::Valuepath;batches_write_the_same_log_on_any_number_of_workerschecks that 1, 4 and 7 workers write identical segments and frontiers.