Repository navigation
Conversation
SubscribeOk.largest is decoded off the wire and then dropped: outside its
own codec and tests it has no readers, and `request.accept(...)` carries no
location, so nothing downstream can observe it.
It is the only thing that can answer "where is the publisher's live edge"
before the first group arrives, which is what a NEXT_GROUP_START anchor
needs. `Subscriber.largest()` cannot: its own doc says it reads the groups
buffered for this subscriber, so it is undefined before anything arrives
and again after eviction -- exactly the window the anchor asks about.
Surface it as `Info.publisherLargest`. Three notes on the shape:
- Not named `largest`. `Subscriber.largest()` already exists and means the
weaker buffered-edge value; a caller reaching for the wrong one would
anchor against undefined and silently fall back, which never raises.
- A snapshot, not a live edge: fixed at accept time and never updated,
which is what lets it sit beside the other accept-time properties. The
"maps 1:1 onto TRACK_INFO" sentence on Info is amended to name it as the
exception -- the moq-lite path has no equivalent wire field and leaves it
unset, where every other Info field is defaulted.
- Not a Location. `PublishedLocation` is {group, object} because the second
component is an Object ID, not a frame index; a publisher may number its
objects with gaps, so this does not count what precedes it.
Both wire fields are u62 and the API carries numbers, so a value past 2^53
is dropped with a debug log rather than rounded: `undefined` already means
"the publisher did not say", which every caller handles, and a silently
wrong anchor does not.
Two tests. The first asserts the value reaches the consumer before any
group is handled AND that `largest()` is still undefined at that moment --
asserting both together is what pins the distinction. The second pins that
an omitted field stays distinguishable from a stated one. Dropping the
single line from accept() turns the first red and leaves the second green.
Collaborator
|
Thanks for this, and for spelling out the motivation. We're closing it in favor of a different shape, planned in #5379 (
That should cover the NEXT_GROUP_START anchor use case without a stale snapshot. Happy to hear if it misses something you need. (Written by Claude Opus 5.5) |
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.
Problem
SubscribeOk.largest is decoded from the wire and then dropped. Outside its codec and tests it has no readers, request.accept carries no location, and downstream code cannot observe it.
It is the only value that can answer where the publisher live edge is before the first group arrives, which is needed for a NEXT_GROUP_START anchor. Subscriber.largest reads groups buffered for this subscriber, so it is undefined before anything arrives and again after eviction.
Approach
Surface the value as Info.publisherLargest.
Impact
Alternatives
Extending Subscriber.largest to fall back to SUBSCRIBE_OK was rejected because it would conflate two different questions behind one name.
Follow-ups
None.
Tests
One test asserts the value reaches the consumer before any group is handled and that largest remains undefined then. A second test pins that an omitted field stays distinguishable from a stated one. Dropping the accept-time assignment turns the first test red.
Need help on this PR? Tag
@codesmith-botwith what you need.