-
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.
[#24033] xCluster: correctly take sequences_data streams into account…
… for xCluster safe time Summary: In this diff, I expand the primary key for the safe time table to distinguish between sequence_data tablets belonging to different streams/replication namespaces. This is necessary to prevent confusion between different streams with the same replication group and tablet ID. (Recall that we are already using sequence aliases for table IDs to distinguish between the tables belonging to different streams; unfortunately, because there are no aliases for tablet IDs, more work is required.) To preserve backward compatibility as much as possible, I encode the new information into the existing tablet_id column of the table. In particular, the new value for this column is: * (non-sequences_data tablet) tablet_id * (sequences_data tablet) tablet_id,replication_namespace This means that we can correctly read rows from existing semi-automatic xCluster replication ongoing during an upgrade and that we do not produce data using semi automatic mode with the new code that cannot be read by the old code. I assume that we will have an auto flag guarding the use of automatic mode replication that will prevent us writing rows containing a "," then rolling back to the previous code. I have created an abstraction, ProducerTabletKey, to encode how this works; it is currently in code/yugabyte-db/src/yb/common/xcluster_util.h because it needs to be used by both src/yb/master/xcluster/xcluster_safe_time_service.cc and src/yb/master/xcluster/xcluster_safe_time_service.cc. Likely we will move it elsewhere after refactoring later. Jira: DB-12923 Test Plan: I have added several tests to make sure that xCluster time is being computed correctly; in particular, slowness in the sequences_data tablet for one namespace should not affect the xCluster safe time for a different namespace. This make sure the xCluster safe time for the two different name spaces are being kept separate and managed correctly. ``` ybd --cxx-test xcluster_sequences-test --test-args '' >& /tmp/generic.mdl.log ``` Added several unit tests for the new SafeTimeTablePK type: ``` ybd --cxx-test xcluster_safe_time_service-test --test-args '' >& /tmp/generic.mdl.log ``` Reviewers: hsunder, xCluster Reviewed By: hsunder Subscribers: ycdcxcluster, ybase Differential Revision: https://phorge.dev.yugabyte.com/D39715
- Loading branch information
Showing
11 changed files
with
418 additions
and
84 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
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.