Skip to content

Commit

Permalink
fix(backup): don't allow for incomplete backup
Browse files Browse the repository at this point in the history
Backward compatibility is less important than correctness.
It forces us to skip backup of system_traces and system_distributed
keyspaces when testing a single dc backup.

Fixes #3922
  • Loading branch information
Michal-Leszczynski committed Sep 17, 2024
1 parent 8f2e302 commit cabb5ff
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
15 changes: 0 additions & 15 deletions pkg/service/backup/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,21 +539,6 @@ type tokenRangesValidator struct {
}

func (v tokenRangesValidator) validate(ks, tab string, ring scyllaclient.Ring) error {
// Skip validation for SimpleStrategy when all hosts from backed up dcs are live
// in order to preserve backward compatibility (#3922).
if ring.Replication == scyllaclient.SimpleStrategy {
missingHost := false
for h, dc := range ring.HostDC {
if v.dcs.Has(dc) && !v.liveNodes.Has(h) {
missingHost = true
break
}
}
if !missingHost {
return nil
}
}

for _, rt := range ring.ReplicaTokens {
if !v.liveNodes.HasAny(rt.ReplicaSet...) {
return errors.Errorf("%s.%s: the whole replica set %v is filtered out, so the data owned by it can't be backed up", ks, tab, rt.ReplicaSet)
Expand Down
21 changes: 0 additions & 21 deletions pkg/service/backup/testdata/get_target/filter_dc.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,13 @@
],
"all_tables": true
},
{
"keyspace": "system_distributed",
"tables": [
"cdc_generation_timestamps",
"cdc_streams_descriptions_v2",
"service_levels",
"view_build_status"
],
"all_tables": true
},
{
"keyspace": "system_distributed_everywhere",
"tables": [
"cdc_generation_descriptions_v2"
],
"all_tables": true
},
{
"keyspace": "system_traces",
"tables": [
"node_slow_log_time_idx",
"node_slow_log",
"events",
"sessions_time_idx",
"sessions"
],
"all_tables": true
},
{
"keyspace": "system_schema",
"tables": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dc": ["dc1"], "location": ["s3:backuptest-get-target"]}
{"dc": ["dc1"], "location": ["s3:backuptest-get-target"], "keyspace": ["*", "!system_traces", "!system_distributed"]}

0 comments on commit cabb5ff

Please sign in to comment.