Disconnect clients when back-processing ends far behind - #939
Draft
sduchesneau wants to merge 1 commit into
Draft
sduchesneau wants to merge 1 commit into
sduchesneau wants to merge 1 commit into
Conversation
When back-processing takes hours, the linear handoff block falls far behind the chain. Disconnecting makes the client's reconnection back-process that gap in parallel instead of linearly on tier1.
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.
When a production-mode request back-processes for hours, the linear handoff block is fixed at the start and ends up far behind the chain, so tier1 processes the gap linearly.
After back-processing, tier1 now compares the handoff block with the last final block rounded down to a segment (capped by the stop block). If it is more than 2 segments behind, the client gets the usual
Unavailable"endpoint is shutting down, please reconnect" error. Reconnecting from its cursor re-plans up to the new final block and back-processes the gap in parallel.SUBSTREAMS_MAX_LINEAR_HANDOFF_LAG_SEGMENTSoverrides the default of 2.substreams guidoes not reconnect on its own yet; that is on thegui-reconnectbranch.