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

Restore: skip new entities in DESC SCHEMA WITH INTERNALS #4058

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions pkg/service/restore/restore_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ func TestRestoreSchemaRoundtripIntegration(t *testing.T) {
m3 = map[query.DescribedSchemaRow]struct{}{}
)
for _, row := range srcSchema {
// Scylla 6.3 added roles and service levels to the output of
// DESC SCHEMA WITH INTERNALS (https://github.com/scylladb/scylladb/pull/20168).
// Those entities do not live in any particular keyspace, so that's how we identify them.
// We are skipping them until we properly support their restoration.
if row.Keyspace == "" {
continue
}
m1[row] = struct{}{}
if opt, ok := objWithOpt[row.Name]; ok {
if !strings.Contains(row.CQLStmt, opt) {
Expand All @@ -200,10 +207,14 @@ func TestRestoreSchemaRoundtripIntegration(t *testing.T) {
t.Fatalf("Src schema: %v, is missing created objects: %v", m1, objWithOpt)
}
for _, row := range dstSchemaSrcBackup {
m2[row] = struct{}{}
if row.Keyspace != "" {
m2[row] = struct{}{}
}
}
for _, row := range srcSchemaDstBackup {
m3[row] = struct{}{}
if row.Keyspace != "" {
m3[row] = struct{}{}
}
}
Print("Validate that all schemas are the same")
if !maputil.Equal(m1, m2) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/service/restore/schema_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ func (w *schemaWorker) restoreFromSchemaFile(ctx context.Context) error {

var createdKs []string
for _, row := range *w.describedSchema {
if row.Keyspace == "" {
// Scylla 6.3 added roles and service levels to the output of
// DESC SCHEMA WITH INTERNALS (https://github.com/scylladb/scylladb/pull/20168).
// Those entities do not live in any particular keyspace, so that's how we identify them.
// We are skipping them until we properly support their restoration.
continue
}
if row.Keyspace == "system_replicated_keys" {
// See https://github.com/scylladb/scylla-enterprise/issues/4168
continue
Expand Down
Loading