-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2.20][#18479] CDCSDK: Report tablet split as soon as we det…
…ect it Summary: Original commit: c30499b / D28415 For CDCSDK, whenever a tablet split occurs, it is reported to the client as soon as we read the WAL records and hit a `SPLIT_OP`, the client then retrieves the children tablets and polls on them. This diff changes the mechanism so that now we check in every `GetChanges` call whether a tablet has been split, if it has we communicate the split to the client as soon as we detect the tablet being polled is split. Now when the children tablets are being polled, we can have duplicate data since the WAL is duplicated. To overcome that, while iterating over the records in the WAL, we retrieve the hash_key of the key being read and check if it is within the bounds of the tablet being polled, if it is then we stream the record, otherwise we ignore. **Summary of changes in this diff:** 1. Changed the time at which split is reported to client. Earlier it was reported when we hit the `SPLIT_OP` in WAL, now we report it as soon as we detect it on the tablet. 2. Modified the logic to get the children tablets using `tablet_peer` rather than iterating over the complete list. 3. Added and modified tests to comply with the new changes. **2.20 specific changes:** Few conflicts were there while cherry picking the original commit because of D30724, they were resolved in the files `cdcsdk_tablet_split-test` and `cdcsdk_consistent_stream-test`. Jira: DB-7447 Test Plan: Run tests to ensure no regression. Reviewers: skumar, asrinivasan, stiwary, jhe Reviewed By: skumar Subscribers: ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D30999
- Loading branch information
1 parent
bd6e3ac
commit f3c7647
Showing
7 changed files
with
460 additions
and
209 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
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
Oops, something went wrong.