Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xCluster] Handle race condition between table create and outbound replication group create #20938

Closed
yugabyte-ci opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
jira-originated kind/enhancement This is an enhancement of an existing feature priority/low Low priority

Comments

@yugabyte-ci
Copy link
Contributor

yugabyte-ci commented Feb 5, 2024

Jira Link: DB-9917

@yugabyte-ci yugabyte-ci added jira-originated kind/enhancement This is an enhancement of an existing feature priority/low Low priority labels Feb 5, 2024
hari90 added a commit that referenced this issue Feb 6, 2024
Summary:
As part of creating a new table, also create xCluster stream if the table belongs to a namespace that is part of an xClusterOutboundReplicationGroup.
As part of table creation we create `AddTableToXClusterSourceTask` for each ReplicationGroup that we want to add the table to.
The task invokes `XClusterOutboundReplicationGroup::AddTable` to create a xcluster stream checkpointed to `OpId().Min()` (0,0) so that replication will start from the beginning of the WAL.
We currently skip extending WAL retention of the table since this requires an ALTER Table operation which cannot be performed unless the table creation has completed. #20769 tracks the task which will remove the need for performing ALTER Table in the first place.
#20938 tracks the race conditions when tables are created concurrently with xcluster replication groups
#16971 tracks delete of tables that are under replication

**Upgrade/Rollback safety:**
All the changes are guarded under flag `TEST_enable_xcluster_api_v2`

Fixes #20422
Jira: DB-9415

Test Plan:
TEST_F(XClusterOutboundReplicationGroupMockedTest, AddTable)
TEST_F(XClusterOutboundReplicationGroupTest, AddTable)

Reviewers: mlillibridge, jhe, slingam, xCluster

Reviewed By: mlillibridge

Subscribers: yql, xCluster, ybase, bogdan

Differential Revision: https://phorge.dev.yugabyte.com/D31935
hari90 added a commit that referenced this issue Mar 23, 2024
… dropped

Summary:
If tables are created or dropped during a db scoped checkpoint, the checkpoint will fail. This is to prevent the checkpoint from missing tables that were created or dropped during the checkpoint.
Jira: DB-9917

Test Plan:
XClusterOutboundReplicationGroupMockedTest.AddTableDuringCheckpoint
XClusterOutboundReplicationGroupMockedTest.DropTableDuringCheckpoint

Reviewers: slingam, xCluster

Reviewed By: slingam

Subscribers: xCluster, ybase, bogdan

Differential Revision: https://phorge.dev.yugabyte.com/D33487
hari90 added a commit that referenced this issue Mar 26, 2024
…es are created or dropped

Summary:
Original commit: 987ffc3 / D33487
If tables are created or dropped during a db scoped checkpoint, the checkpoint will fail. This is to prevent the checkpoint from missing tables that were created or dropped during the checkpoint.
Jira: DB-9917

Test Plan:
XClusterOutboundReplicationGroupMockedTest.AddTableDuringCheckpoint
XClusterOutboundReplicationGroupMockedTest.DropTableDuringCheckpoint

Reviewers: slingam, xCluster

Reviewed By: slingam

Subscribers: bogdan, ybase, xCluster

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D33492
@hari90 hari90 closed this as completed Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-originated kind/enhancement This is an enhancement of an existing feature priority/low Low priority
Projects
None yet
Development

No branches or pull requests

2 participants