Skip to content

Commit cac12ff

Browse files
-- do not merge to master -- skip cleanup on refresh for 1-1 restore
1 parent 04d7962 commit cac12ff

File tree

8 files changed

+44
-11
lines changed

8 files changed

+44
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/scylladb/scylla-manager/backupspec v1.0.2
3434
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250506140140-b1b310d3a2e7
3535
github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20250310104639-18257b71bb48
36-
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250502123045-ee6af14e22db
36+
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250515154242-04d796222d35
3737
github.com/spf13/cobra v1.8.0
3838
github.com/spf13/pflag v1.0.5
3939
github.com/stoewer/go-strcase v1.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250506140140-b1
10681068
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250506140140-b1b310d3a2e7/go.mod h1:BGRcEJClLt1ipw6XM/zIf82+MHNCiTrmNqlLgobr3Cc=
10691069
github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20250310104639-18257b71bb48 h1:2iJMWV073twoCG2L/F5DBzQApxVX8kKEEeke3qvSitM=
10701070
github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20250310104639-18257b71bb48/go.mod h1:VKqHSrDj9zfgCKilpbdpmqV1TjmSglt/df79eIg6wuI=
1071-
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250502123045-ee6af14e22db h1:Ij7Zw/AqHpTDH5sELQOBC1uE1Fh1fmSJEqdy7D+yyAs=
1072-
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250502123045-ee6af14e22db/go.mod h1:nCN5P0jiWL0W7jbcZ9p0ndtZAPoyEWXefddx/nbyFes=
1071+
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250515154242-04d796222d35 h1:igLRCWgbgAKHK2qVkCgGLdNknksBAb+RwHIF5fHHFyQ=
1072+
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250515154242-04d796222d35/go.mod h1:nCN5P0jiWL0W7jbcZ9p0ndtZAPoyEWXefddx/nbyFes=
10731073
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 h1:8qmTC5ByIXO3GP/IzBkxcZ/99VITvnIETDhdFz/om7A=
10741074
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
10751075
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=

pkg/scyllaclient/client_scylla.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ func (c *Client) TableDiskSizeReport(ctx context.Context, hostKeyspaceTables Hos
10651065
}
10661066

10671067
// AwaitLoadSSTables loads sstables that are already downloaded to host's table upload directory.
1068-
func (c *Client) AwaitLoadSSTables(ctx context.Context, host, keyspace, table string, loadAndStream, primaryReplicaOnly bool) error {
1068+
func (c *Client) AwaitLoadSSTables(ctx context.Context, host, keyspace, table string, loadAndStream, primaryReplicaOnly, skipCleanup bool) error {
10691069
c.logger.Info(ctx, "First try on loading sstables",
10701070
"host", host,
10711071
"keyspace", keyspace,
@@ -1088,7 +1088,7 @@ func (c *Client) AwaitLoadSSTables(ctx context.Context, host, keyspace, table st
10881088
firstCallCtx := ctx
10891089
firstCallCtx = customTimeout(firstCallCtx, firstCallTimeout)
10901090
firstCallCtx = noRetry(firstCallCtx)
1091-
err := c.loadSSTables(firstCallCtx, host, keyspace, table, loadAndStream, primaryReplicaOnly)
1091+
err := c.loadSSTables(firstCallCtx, host, keyspace, table, loadAndStream, primaryReplicaOnly, skipCleanup)
10921092
if err == nil {
10931093
return nil // Return on success
10941094
}
@@ -1123,7 +1123,7 @@ func (c *Client) AwaitLoadSSTables(ctx context.Context, host, keyspace, table st
11231123

11241124
retryCallCtx := ctx
11251125
retryCallCtx = withShouldRetryHandler(retryCallCtx, dontRetryOnAlreadyLoadingSSTablesRetryHandler)
1126-
err = c.loadSSTables(retryCallCtx, host, keyspace, table, loadAndStream, primaryReplicaOnly)
1126+
err = c.loadSSTables(retryCallCtx, host, keyspace, table, loadAndStream, primaryReplicaOnly, skipCleanup)
11271127
if err == nil {
11281128
return nil // Return on success
11291129
}
@@ -1140,13 +1140,14 @@ func (c *Client) AwaitLoadSSTables(ctx context.Context, host, keyspace, table st
11401140
// - It returns nil when called on an empty upload dir
11411141
// loadSSTables does not perform any special error, timeout or retry handling.
11421142
// See AwaitLoadSSTables for a wrapper with those features.
1143-
func (c *Client) loadSSTables(ctx context.Context, host, keyspace, table string, loadAndStream, primaryReplicaOnly bool) error {
1143+
func (c *Client) loadSSTables(ctx context.Context, host, keyspace, table string, loadAndStream, primaryReplicaOnly, skipCleanup bool) error {
11441144
_, err := c.scyllaOps.StorageServiceSstablesByKeyspacePost(&operations.StorageServiceSstablesByKeyspacePostParams{
11451145
Context: forceHost(ctx, host),
11461146
Keyspace: keyspace,
11471147
Cf: table,
11481148
LoadAndStream: &loadAndStream,
11491149
PrimaryReplicaOnly: &primaryReplicaOnly,
1150+
SkipCleanup: &skipCleanup,
11501151
})
11511152
return err
11521153
}

pkg/service/one2onerestore/worker_tables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (w *worker) createDownloadJob(ctx context.Context, table backupspec.FilesMe
6363

6464
func (w *worker) refreshNode(ctx context.Context, table backupspec.FilesMeta, m *backupspec.ManifestInfo, h Host, pr *RunTableProgress) error {
6565
w.metrics.SetOne2OneRestoreState(w.runInfo.ClusterID, m.Location, m.SnapshotTag, h.Addr, metrics.One2OneRestoreStateLoading)
66-
err := w.client.AwaitLoadSSTables(ctx, h.Addr, table.Keyspace, table.Table, false, false)
66+
err := w.client.AwaitLoadSSTables(ctx, h.Addr, table.Keyspace, table.Table, false, false, true)
6767
w.finishDownloadProgress(ctx, pr, err)
6868
return err
6969
}

pkg/service/restore/schema_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (w *schemaWorker) stageRestoreData(ctx context.Context) error {
109109
host := status[i]
110110
for _, ks := range w.run.Units {
111111
for _, t := range ks.Tables {
112-
if err := w.client.AwaitLoadSSTables(ctx, host.Addr, ks.Keyspace, t.Table, false, false); err != nil {
112+
if err := w.client.AwaitLoadSSTables(ctx, host.Addr, ks.Keyspace, t.Table, false, false, false); err != nil {
113113
return errors.Wrap(err, "restore schema")
114114
}
115115
}

pkg/service/restore/tablesdir_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (w *tablesWorker) waitJob(ctx context.Context, b batch, pr *RunProgress) (e
8181

8282
func (w *tablesWorker) restoreSSTables(ctx context.Context, b batch, pr *RunProgress) error {
8383
w.onLasStart(ctx, b, pr)
84-
err := w.worker.client.AwaitLoadSSTables(ctx, pr.Host, pr.Keyspace, pr.Table, true, true)
84+
err := w.worker.client.AwaitLoadSSTables(ctx, pr.Host, pr.Keyspace, pr.Table, true, true, false)
8585
if err == nil {
8686
w.onLasEnd(ctx, b, pr)
8787
}

vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_parameters.go

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ github.com/scylladb/scylla-manager/v3/pkg/util/timeutc
440440
github.com/scylladb/scylla-manager/v3/pkg/util/uuid
441441
github.com/scylladb/scylla-manager/v3/pkg/util/version
442442
github.com/scylladb/scylla-manager/v3/pkg/util/workerpool
443-
# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250502123045-ee6af14e22db
443+
# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250515154242-04d796222d35
444444
## explicit; go 1.23.2
445445
github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client
446446
github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations

0 commit comments

Comments
 (0)