Repository navigation
Let one record stream carry independent callers safely - #23
Merged
Merged
Conversation
A request carrying only store_name and cancel_index cancels an earlier record without ending the stream, so a stream shared by several callers can release the work of one caller that stops waiting. Also state which requests end a stream, that results are at most one per index, and that record timeouts start when the server reads the request.
A server reads up to RecordWindow records without results per stream, whatever its Store queue holds, so a client within the window never waits to send a cancel request. Also describe cancel requests in the ExecuteRequest fields, reject cancel_index UINT64_MAX, and test that every other field stays unset in a cancel request.
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.
Results now arrive in completion order, and a record the server cannot admit gets its own NOT_STARTED result instead of ending the stream. Clients can therefore multiplex unrelated single-record calls over a few long-lived streams, without one slow or rejected record holding back or failing the others. Because closing a shared stream would hurt every caller on it, each record can carry its own
timeout_micros, and acancel_indexrequest cancels a single record. A caller that gives up still releases its queued work on the server. Native keeps the RPC deadline and RPC cancellation.Locally, sharing streams this way halves Weir's CPU per record (MongoDB 70 → 34 µs, Search 80 → 45 µs) and raises throughput 38–50%. Per-call HTTP/2 stream setup and small writes had dominated the server profile. Unknown-field checks also stop allocating on every validated message.