Skip to content

Balance spine batch events; document the stamp invariant - #940

Merged
frankmcsherry merged 3 commits into
master-nextfrom
master-next-port-fixes
Oct 16, 2026
Merged

frankmcsherry merged 3 commits into
master-nextfrom
master-next-port-fixes

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

Addresses the differential items from Materialize's report on the master-next port that we chose to take.

Changes

  • 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. A consumer adding one batch per BatchEvent and removing one per completed MergeEvent and per DropEvent (as diagnostics does) counted those spans forever. insert_at now logs the completion, which restores the events of 0.25.1.
  • The logging types state that contract. Batches without updates are counted, and report a length of zero. A consumer that counts only batches with updates (as Materialize now does) also balances.
  • 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, so a message with an empty stamp carries no updates.
  • OrdValBuilder::with_capacity and OrdKeyBuilder::with_capacity are public, so wrapping builders can pre-size.
  • Corrects two comments that described one capability per message, and one that named a caller drop_batches no longer has.

Tests

tests/logging.rs arranges 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

frankmcsherry and others added 3 commits October 16, 2026 16:40
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>
@frankmcsherry
frankmcsherry merged commit 0b41ba7 into master-next Oct 16, 2026
6 checks passed
@frankmcsherry
frankmcsherry deleted the master-next-port-fixes branch October 16, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant