Skip to content

Commit

Permalink
fix(restore_test): assume 'repair' to be default tombstone_gc mode
Browse files Browse the repository at this point in the history
Up to this point we didn't specifically set tombstone_gc mode in tests and expected it to be 'timeout'. Since tablet tables need to have tombstone_gc 'repair', we should change the default expectation to it.
Note that this 'assumption' should be removed in the future in favor of something more robust.
  • Loading branch information
Michal-Leszczynski committed Jun 4, 2024
1 parent afec93b commit 6aeb3d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/service/restore/service_restore_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1603,8 +1603,8 @@ func (h *restoreTestHelper) validateRestoreSuccess(dstSession, srcSession gocqlx
if baseTable(srcSession, t.Keyspace, t.Table) != "" {
continue
}
if mode, err := tombstoneGCMode(dstSession, t.Keyspace, t.Table); mode != "timeout" || err != nil {
h.T.Fatalf("Expected 'timeout' tombstone_gc mode, got: %s, with err: %s", mode, err)
if mode, err := tombstoneGCMode(dstSession, t.Keyspace, t.Table); mode != "repair" || err != nil {
h.T.Fatalf("Expected 'repair' tombstone_gc mode, got: %s, with err: %s", mode, err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/testutils/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ func RawWriteData(t *testing.T, session gocqlx.Session, keyspace string, startin

var (
ksStmt = "CREATE KEYSPACE IF NOT EXISTS %q WITH replication = %s"
tStmt = "CREATE TABLE IF NOT EXISTS %q.%q (id int PRIMARY KEY, data blob)"
tStmt = "CREATE TABLE IF NOT EXISTS %q.%q (id int PRIMARY KEY, data blob) WITH tombstone_gc = {'mode':'repair'}"
insertStmt = "INSERT INTO %q.%q (id, data) VALUES (?, ?)"
)
if !compaction {
tStmt += " WITH compaction = {'enabled': 'false', 'class': 'NullCompactionStrategy'}"
tStmt += " AND compaction = {'enabled': 'false', 'class': 'NullCompactionStrategy'}"
}

ExecStmt(t, session, fmt.Sprintf(ksStmt, keyspace, replication))
Expand Down

0 comments on commit 6aeb3d0

Please sign in to comment.