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

raft topology: cdc: make CDC_GENERATIONS_V3 table single-partition, timeuuid-sorted #15163

Closed
kbr-scylla opened this issue Aug 25, 2023 · 1 comment · Fixed by #15319
Closed

Comments

@kbr-scylla
Copy link
Contributor

As discussed in #13962 (comment), we'll need a mechanism to clear obsolete CDC generation data so that raft-topology snapshot size does not grow endlessly as we introduce new generations over time.

The first step to do that is to turn the system.cdc_generations_v3 table into a single-partition table, where different generations are described through different clustering keys (as opposed by different partition keys, as it is today). Then turn generation IDs into timeuuids (currently they are just regular UUIDs), giving them a time-based order.

Thanks to these changes, it will be easy to efficiently clear old generations -- e.g. by inserting a range tombstone covering all timeuuids < current_gen_timeuuid.

We should do this when while we can still change CDC_GENERATIONS_V3 table schema in backward incompatible ways (i.e. before we GA topology-on-raft).

cc @margdoc @gleb-cloudius

@patjed41 patjed41 self-assigned this Sep 5, 2023
kbr-scylla added a commit that referenced this issue Sep 13, 2023
…uid-sorted' from Patryk Jędrzejczak

We make the `CDC_GENERATIONS_V3` table single-partition and change the
clustering key from `range_end` to `(id, range_end)`. We also change the
type of `id` to `timeuuid` and ensure that a new generation always has
the highest `id`. These changes allow efficient clearing of obsolete CDC
generation data, which we need to prevent Raft-topology snapshots from
endlessly growing as we introduce new generations over time.

All this code is protected by an experimental feature flag. It includes
the definition of `CDC_GENERATIONS_V3`. The table is not created unless
the feature flag is enabled.

Fixes #15163

Closes #15319

* github.com:scylladb/scylladb:
  system_keyspace: rename cdc_generation_id_v2
  system_keyspace: change id to timeuuid in CDC_GENERATIONS_V3
  cdc: generation: remove topology_description_generator
  cdc: do not create uuid in make_new_generation_data
  system_kayspace: make CDC_GENERATIONS_V3 single-partition
  cdc: generation: introduce get_common_cdc_generation_mutations
  cdc: generation: rename get_cdc_generation_mutations
@mykaul mykaul added this to the 5.4 milestone Oct 19, 2023
@kbr-scylla
Copy link
Contributor Author

experimental raft topology, not backport needed

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

Successfully merging a pull request may close this issue.

5 participants