-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
110085: streamingccl: correctly resume stream from partial initial scan r=msbutler a=stevendanna When starting a subscription, we pass an initial timestamp and a previous replicated timestamp. If the previous replicated timestamp is zero, the produce assumes we've completed the initial scan and streams only incremental changes from the given replicated timestamp. When resuming a restarted job, we use a persisted frontier checkpoint to find the minimum timestamp replicated time for a set of spans and use that rather than the overall replicated time to attempt to reduce the amount of duplicated work. Since data is split across many ranges, some portions of our keyspace may complete their initial scan before others. As a result, the persisted frontier checkpoint during the initial scan may have some spans at zero-valued timestamps and others at non-zero timestamps. Unfortunately, the code to find the minimum timestamp incorrectly handled portions of the frontier that had zero-valued timestamps, returning the lowest non-zero value rather than zero. As a result, if we resumed during an initial scan but after some portions of the key space have recorded progress, we would use a non-zero previous replicated timestamp to resume a stream even if some of the spans still required their initial scans to complete. He we fix the bug so that the minimum timestamp for a set of spans is zero if any of the given spans is currently at zero. Fixes #109957 Release note: None Epic: none Co-authored-by: Steven Danna <danna@cockroachlabs.com>
- Loading branch information
Showing
3 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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