Repository navigation
Balance spine batch events; document the stamp invariant - #940
Merged
Merged
Conversation
The spine merges two present spans without work when at least one carries no batch. Such a merge is born complete, and `complete_at` logged no completion for it, so a consumer adding one batch per `BatchEvent` and removing one per completed merge and drop counted those spans forever. `insert_at` now logs the completion, which restores the events of 0.25.1. A consumer that counts only batches with updates also balances, before and after. The logging types now state this contract, and `tests/logging.rs` checks both consumers. `Collection` and `Arranged::stream` state the unchecked assumption that each update's time is greater or equal to some time in its message's stamp. `OrdValBuilder::with_capacity` and `OrdKeyBuilder::with_capacity` are public, so wrapping builders can pre-size. Also corrects two comments that described one capability per message, and one that named a caller `drop_batches` no longer has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the differential items from Materialize's report on the
master-nextport that we chose to take.Changes
complete_atlogged no completion for it. A consumer adding one batch perBatchEventand removing one per completedMergeEventand perDropEvent(asdiagnosticsdoes) counted those spans forever.insert_atnow logs the completion, which restores the events of 0.25.1.CollectionandArranged::streamstate the unchecked assumption that each update's time is greater or equal to some time in its message's stamp, so a message with an empty stamp carries no updates.OrdValBuilder::with_capacityandOrdKeyBuilder::with_capacityare public, so wrapping builders can pre-size.drop_batchesno longer has.Tests
tests/logging.rsarranges 100 rounds, most without updates, drops the trace, and checks that both consumers return to zero. Without the spine change the first consumer ends at 79.🤖 Generated with Claude Code