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] Slow SetupReplication requests when using too many tables #10611

Closed
nspiegelberg opened this issue Nov 16, 2021 · 1 comment
Closed
Assignees
Labels
area/docdb YugabyteDB core features

Comments

@nspiegelberg
Copy link
Contributor

Description

Similar to #10065, yb-admin setup_replication also times out when using too many tables. We had a customer who used 100 tables as command input. The current workaround is to batch into multiple entries with ~10 tables. A performance issue with the command, not the feature.

@nspiegelberg nspiegelberg added the area/docdb YugabyteDB core features label Nov 16, 2021
@nspiegelberg
Copy link
Contributor Author

nspiegelberg commented Dec 10, 2021

It looks like the culprit here is AddCDCStreamToUniverseAndInitConsumer, which calls UpdateCDCStream while holding a Universe WriteLock, so it is a serialized RPC per table. We should instead handle this RPC as a batch update when all CDC Streams have been processed.

Update: This is handle in batch, so we're fine here. We were creating new network connections per table within this code, which became expensive when connection costs are high.

nspiegelberg added a commit that referenced this issue Feb 16, 2022
… tables

Summary:
Currently, setup_replication times out when using too many tables.  The workaround is to
batch into multiple entries with ~10 tables.  When investigating, found that we were serially
creating a YBClient object, per table, that required 5 sec to startup.  Modified to use a cached
object and added 2 basic unit tests to run the setup_replication command with 100 tables and verify
a reasonable runtime.

Test Plan:
TwoDCTestParams/TwoDCTest.BootstrapAndSetupLargeTableCount/0 -n 10
TwoDCTestParams/TwoDCTest.SetupUniverseReplicationLargeTableCount/0 -n 10

Reviewers: jhe, rahuldesirazu

Reviewed By: rahuldesirazu

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D15256
@bmatican bmatican closed this as completed Mar 4, 2022
jayant07-yb pushed a commit to jayant07-yb/yugabyte-db that referenced this issue Mar 8, 2022
…too many tables

Summary:
Currently, setup_replication times out when using too many tables.  The workaround is to
batch into multiple entries with ~10 tables.  When investigating, found that we were serially
creating a YBClient object, per table, that required 5 sec to startup.  Modified to use a cached
object and added 2 basic unit tests to run the setup_replication command with 100 tables and verify
a reasonable runtime.

Test Plan:
TwoDCTestParams/TwoDCTest.BootstrapAndSetupLargeTableCount/0 -n 10
TwoDCTestParams/TwoDCTest.SetupUniverseReplicationLargeTableCount/0 -n 10

Reviewers: jhe, rahuldesirazu

Reviewed By: rahuldesirazu

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D15256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features
Projects
None yet
Development

No branches or pull requests

2 participants