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

SwitchWrites: improve performance of sequence initialisation steps #17871

Open
rohit-nayak-ps opened this issue Feb 26, 2025 · 0 comments
Open

Comments

@rohit-nayak-ps
Copy link
Contributor

rohit-nayak-ps commented Feb 26, 2025

Feature Description

While switching primary write traffic, for sharded keyspaces, if require, we update the sequence backing table with the largest value found for existing data, after stopping writes.

Currently we do multiple tabletmanager calls, one set each per table to

  • get the current max auto-increment value from the data tables.
  • create sequence tables, if required.
  • update the sequence in the backing tables. We always call the update regardless of whether the sequence needs to be updated or not.

Depending on the number of tables and shards this can take very long since there can be several thousands of queries / rpc calls. This can cause timeouts preventing the workflow from switching traffic.

Even if the process is successful, since these are happening after we stop writes, it increases the downtime while switching traffic.

We should try and minimise this by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant