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

[docdb] Splitting: Disable automatic splitting for 2DC enabled tables #8256

Closed
bmatican opened this issue May 1, 2021 · 3 comments
Closed
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature

Comments

@bmatican
Copy link
Contributor

bmatican commented May 1, 2021

After we have #8234, it should be very easy to expand the set of constraints on what to enable/disable splitting on.

Until we have #5373, we should at least disable automatic splitting on such tables.

@nspiegelberg
Copy link
Contributor

Thoughts:

  1. We should add this as a step to 'setup_universe_replication'.
  2. This should ensure that both the Producer and Consumer have splitting disabled (if we have each cluster responsible for disabling, we could have mixed version issues).
  3. I think we can make this stateless (e.g. don't worry about re-enable logic if we delete_universe_replication), just have the user manually enable it.

@bmatican
Copy link
Contributor Author

bmatican commented Jun 8, 2021

@nspiegelberg Can you elaborate a bit more on 1) do you mean disable splitting as part of replication setup, via an extra flag in the command, or just automatically set some property which disables splitting?

For 2) maybe I'm missing something, but when you say mixed versions, are you worried about

  • Producer is on version X different from consumer on version Y
  • OR that during a software upgrade on either side, we'd have different versions?

What I was thinking, for version compatibility, is that whatever fix we generate here, will be in the version that enables tablet splitting by default. So there would only be 2 states of the world

  • Old: Cluster without tablet splitting -- nothing to worry about
  • New: Cluster with tablet splitting -- should include this fix, thus this particular cluster won't do splitting for xCluster tables

I was kind of hoping for something stateless AND not requiring new explicit user intervention, eg: since the master (CatalogManager) is responsible for whether or not to trigger a split for a tablet, if it knew that this tablet belongs to a table which is either a consumer or a producer in xCluster, then that would be a very cheap and self-contained fix.

@nspiegelberg
Copy link
Contributor

My original solution is to just have the CLI command also handle a splitting disable on the tables involved in the command. You're suggesting a solution that checks the in-memory table state at split request time. For that:

  1. Consumer : See ConsumerRegistryPB. It is forwarded to the Consumer Tablets on heartbeats and tells which tablets need CDCPollers setup to scrape data from the Producers.
  2. Producer : See SysCDCStreamEntryPB. This is less straightforward. It is a mapping of stream_id:table_id. We could probably add some logic to scrape this on startup. Note that this applies to all CDC streams, not just 2DC. There is a CDCStreamOptionsPB that records the consumer source type.

@hulien22 hulien22 assigned hulien22 and unassigned rahuldesirazu Jul 20, 2021
hulien22 added a commit that referenced this issue Jul 22, 2021
…enabled tables

Summary:
Adding new gflag `enable_tablet_split_of_xcluster_replicated_tables` that by default is false, and
will disable tablet splitting for tables that are a part of an xcluster replication setup. This
includes tables that haves a cdc stream (ie producer tables), and also consumer tables which are
being replicated to.
Main changes include adding in a map/set for keeping better track of which tables are involved in
xcluster replication/cdc streams.

Test Plan:
```
ybd --cxx_test tablet-split-itest --gtest-filter NotSupportedTabletSplitITest.SplittingWithCdcStream
ybd --cxx_test tablet-split-itest --gtest-filter NotSupportedTabletSplitITest.SplittingWithXClusterReplicationOnProducer
ybd --cxx_test tablet-split-itest --gtest-filter NotSupportedTabletSplitITest.SplittingWithXClusterReplicationOnConsumer
```

Reviewers: bogdan, nicolas, rsami

Reviewed By: rsami

Subscribers: timur, rsami, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D12258
@ttyusupov ttyusupov added the kind/enhancement This is an enhancement of an existing feature label Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants