Repository navigation
docs(remote): write down what bounds one history reply - #861
Merged
Merged
Conversation
The page byte budget (512 KiB) exists to stay under NATS's 1 MiB payload limit, but it is a soft bound: it sheds whole oldest exchanges and stops when only the newest one is left, so a single exchange larger than 512 KiB is not deferred. Measured on a real session, a non-chunked newest page came within 15.6 KB of the limit and was relayed intact; the same page is 114,222 bytes for a lean client, which is what keeps it away. Record the whole chain where the budget is described: the soft bound and its single-exchange residual, that a lean page deliberately fills the budget (511,841 of 524,288 observed), that oversize is an explicit `remote_reply_too_large` rather than a silent NATS drop, and that the phone takes the chunked path so no single record approaches the limit. Found while closing a follow-up from the real-broker verification: the near-limit page was worth confirming over an actual nats-server, and it passes (three samples, liveEqual/historyEqual both true on the real broker).
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.
The page byte budget (
BACKWARD_HISTORY_PAGE_BYTES, 512 KiB) exists to stay under NATS's 1 MiB payload limit — but it is a soft bound, and the layers that make it safe were not written down. This records them beside the budget they belong to.Why now
Closing a follow-up from the real-broker verification, which flagged that one sample's undeclared paged reply sat ~8.6 KB from the broker's default
max_payload. Re-measured on a realnats-serverv2.15.0 (--samples 3 --broker both, all threeliveEqual/historyEqual: true):So the near-limit page is real, is relayed intact, and the trim is what keeps it away.
What the doc now says
encode_reply_payloadchecksMAX_PLAINTEXT(1 MiB − header − tag, sized so a sealed record is exactly ≤ 1 MiB) and answersremote_reply_too_large.requestReadPage(chunkedRead: true) and reassemble ≤192 KiB chunks, so no single record is near the limit.Docs only — no code, no behavior.
python3 scripts/docs/check-docs.py— 205 docs OK.