Skip to content

Can't restore schema if DC names of original and restored clusters are not the same #4345

Open
@mikliapko

Description

@mikliapko

Preconditions:

  • Backup snapshot created with Scylla 2024.2 and has the next keyspace cql_stmt in schema.json file:
"cql_stmt":"CREATE KEYSPACE \"10gb_sizetiered_2024_2\" WITH replication = {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'eu-west': '3'} AND durable_writes = true AND tablets = {'enabled': false};"

where replication is defined as {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'eu-west': '3'} (dc name is eu-west).

Steps:

  1. Restore schema to the new cluster where datacenter name differs from the name in snapshot (for example, eu-west-1).
  2. Monitor the restore task progress

Result:
Schema restore fails because of dc names mismatch - schema cql statement has the dc name eu-west whereas in the restore cluster it is eu-west-1:

Restore progress
Run:		711229c2-115c-11f0-8f78-0a7e0b70e983
Status:		ERROR (restoring backed-up data)
Cause:		restore data: create "10gb_sizetiered_2024_2" ("10gb_sizetiered_2024_2") with CREATE KEYSPACE "10gb_sizetiered_2024_2" WITH replication = {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'eu-west': '3'} AND durable_writes = true AND tablets = {'enabled': false}: Unrecognized strategy option {eu-west} passed to org.apache.cassandra.locator.NetworkTopologyStrategy for keyspace 10gb_sizetiered_2024_2
Start time:	04 Apr 25 13:55:18 UTC
End time:	04 Apr 25 13:55:18 UTC
Duration:	0s
Progress:	0% | 0%
Snapshot Tag:	sm_20241203091417UTC
Bandwidth:
  - Download:    unknown
  - Load&stream: unknown

╭───────────────┬──────────┬────────────┬─────────┬────────────┬────────╮
│ Keyspace      │ Progress │       Size │ Success │ Downloaded │ Failed │
├───────────────┼──────────┼────────────┼─────────┼────────────┼────────┤
│ system_schema │  0% | 0% │ 393.173KiB │      0B │         0B │     0B │
╰───────────────┴──────────┴────────────┴─────────┴────────────┴────────╯

Expected result:
I believe, we should have an opportunity to handle such cases in Manager.
In recent release 3.5.0 we introduced the new flag --dc-mapping.
It works only in restore tables mode. Perhaps, we can enhance it and make to work in the scenario described above for schema restore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions