feat(derive): New BatchStream Stage for Holocene#566
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
This is a good start. Small preference for BatchStream rather than BatchSpan, as a dumb naming nit.
I think there's a few things we need to think about architecturally here, though. The way I think about this is that we need to be able to stream single batches from the span batch into the BatchQueue, one at a time. This means that, from holocene forward, every batch sent into the BatchQueue is a SingleBatch. We need to retain next_batch(...) -> PipelineResult<Batch>, to keep that backwards compatibility, but the new stage should enforce that.
What this looks like in my head is something like:

The things I'm trying to optimize for here is:
- The
BatchQueuecurrently performs thecheck_batchcall. But it does it onBatch, which wraps bothSingleBatch+SpanBatch. After holocene, basically, theBatchQueueshould never receive aSpanBatch. This way, we can do the span batch prefix check in theBatchStream, and just reuse theSingleBatchcheck in the BQ. - The
BatchStreamstage basically acts as a buffer ofSingleBatches, derived from aSpanBatch. So it holds all of theSingleBatches from a span batch in-memory, and gets drained by theBatchQueueasSingleBatches are read. It can eventually land onEof, signaling that it needs to fetch a new batch from theChannelReader.
Notably this means that the stage will always be present - no need for a active flag, just forwards batches from the ChannelReader directly pre-holocene. Otherwise, it acts as an in-memory buffer of SingleBatches, and also owns the job of validating the span batch's prefix per the spec.
65fbf51 to
5e95560
Compare
clabby
left a comment
There was a problem hiding this comment.
Good start! Let's get this in and keep iterating.
35ee4d2 to
0cec9fe
Compare
* feat(derive): new batch span stage for holocene * small fix
* feat(derive): new batch span stage for holocene * small fix
* feat(derive): new batch span stage for holocene * small fix

Description
Adds a new
BatchStreamstage for holocene.Makes progress towards #559