Skip to content

feat: normalize stream record sequence numbers to backend-specified w… - #353

Merged
jcshepherd merged 14 commits into
mainfrom
fix/streams-sequence-normalization
Sep 22, 2026
Merged

jcshepherd merged 14 commits into
mainfrom
fix/streams-sequence-normalization

Conversation

@jcshepherd

Copy link
Copy Markdown
Collaborator

What

Stream record sequence numbers are normalized (padded) to a fixed width specified by the backend, with default.

Why

Current backends use simple sequence numbers for stream records, and have default to a 21-char fixed width left-padded (with 0's) string. Cassandra doesn't support simple sequence numbers and uses a logical clock instead for stream seq numbers. It needs a slightly wider padded value (23 chars instead of 21). This enables the backend to specify the width it needs, and defaults to 21 chars for existing backends.

Closes #

Testing done

unit test for padding
cargo test --workspace
devtools/run-tests --extenddb --pytest (on PostgreSQL)

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

robinnsc
robinnsc previously approved these changes Sep 19, 2026
Base automatically changed from fix/hlc-instance-id-wiring to main September 21, 2026 22:44
@jcshepherd
jcshepherd dismissed robinnsc’s stale review September 21, 2026 22:44

The base branch was changed.

@jcshepherd
jcshepherd added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 998c12b Sep 22, 2026
29 checks passed
@jcshepherd
jcshepherd deleted the fix/streams-sequence-normalization branch September 22, 2026 00:33
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.

3 participants