Skip to content

Commit

Permalink
try to reproduce #1045, update go.mod, small refactoring integration_…
Browse files Browse the repository at this point in the history
…test.go to pass TestIntegrationEmbedded

Signed-off-by: Slach <[email protected]>
  • Loading branch information
Slach committed Nov 17, 2024
1 parent d4fa94d commit 9d56f61
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ require (
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/genproto v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/grpc v1.68.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvx
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f h1:zDoHYmMzMacIdjNe+P2XiTmPsLawi/pCbSPfxt6lTfw=
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f/go.mod h1:Q5m6g8b5KaFFzsQFIGdJkSJDGeJiybVenoYFMMa3ohI=
google.golang.org/genproto v0.0.0-20241104194629-dd2ea8efbc28 h1:KJjNNclfpIkVqrZlTWcgOOaVQ00LdBnoEaRfkUx760s=
google.golang.org/genproto v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:mt9/MofW7AWQ+Gy179ChOnvmJatV8YHUmrcedo9CIFI=
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU=
google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo=
Expand Down
7 changes: 6 additions & 1 deletion pkg/backup/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,12 @@ func (b *Backuper) downloadTableMetadata(ctx context.Context, backupName string,
}
return nil
})
if err != nil {
// sql file could be not present in incremental backup
if err != nil && strings.HasSuffix(localMetadataFile, ".sql") {
log.Warn().Str("localMetadataFile", localMetadataFile).Err(err).Send()
continue
}
if err != nil && strings.HasSuffix(localMetadataFile, ".sql") {
return nil, 0, err
}

Expand Down
2 changes: 2 additions & 0 deletions test/integration/config-azblob-embedded-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ general:
- " information_schema.*"
- "_temporary_and_external_tables.* "
restore_schema_on_cluster: "{cluster}"
retries_on_failure: 1
retries_pause: 1s
clickhouse:
host: clickhouse
port: 9440
Expand Down
2 changes: 2 additions & 0 deletions test/integration/config-azblob-embedded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ general:
- " information_schema.*"
- "_temporary_and_external_tables.* "
restore_schema_on_cluster: "{cluster}"
retries_on_failure: 1
retries_pause: 1s
clickhouse:
host: clickhouse
port: 9440
Expand Down
6 changes: 3 additions & 3 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2795,12 +2795,12 @@ func testBackupSpecifiedPartitions(t *testing.T, r *require.Assertions, env *Tes
// we just replace partition in exists table, and have incremented data in 2 tables
checkRestoredDataWithPartitions(100)

out, err = env.DockerExecOut("clickhouse-backup", "bash", "-ce", "clickhouse-backup -c /etc/clickhouse-backup/"+backupConfig+" restore_remote --partitions=\"0-20220101\" "+incrementBackupName)
out, err = env.DockerExecOut("clickhouse-backup", "bash", "-ce", "clickhouse-backup -c /etc/clickhouse-backup/"+backupConfig+" restore_remote --partitions=\"(0,'2022-01-01')\" "+incrementBackupName)
log.Debug().Msg(out)
r.NoError(err)
r.NotContains(out, "DROP PARTITION")
// we recreate tables, and have ONLY one partition in one table
checkRestoredDataWithPartitions(10)
// we recreate tables, and have ONLY one partition in two tables
checkRestoredDataWithPartitions(20)

log.Debug().Msg("delete local > download > restore --partitions > restore")
env.DockerExecNoError(r, "clickhouse-backup", "clickhouse-backup", "-c", "/etc/clickhouse-backup/"+backupConfig, "delete", "local", fullBackupName)
Expand Down

0 comments on commit 9d56f61

Please sign in to comment.