Skip to content

Commit f10f9f7

Browse files
-- do not merge to master -- its rebase and dependencies update
1 parent 5759792 commit f10f9f7

16 files changed

+34
-47
lines changed

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/scylladb/go-set v1.0.2
3232
github.com/scylladb/gocqlx/v2 v2.8.0
3333
github.com/scylladb/scylla-manager/backupspec v1.0.1
34-
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250310104639-18257b71bb48
34+
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250407164115-c5bf399e1759
3535
github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20250310104639-18257b71bb48
3636
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250310104639-18257b71bb48
3737
github.com/spf13/cobra v1.8.0

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,8 @@ github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e h1:lJRphCtu+nKd
10641064
github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e/go.mod h1:JGZp4EvCUK+6AM1Fe1dye5xvihTc/Bk0WnHHSCJOePM=
10651065
github.com/scylladb/scylla-manager/backupspec v1.0.1 h1:WaFVHEWwVA3WUeCf2WakmhQ59o+wTYdzo4+qQf8maXk=
10661066
github.com/scylladb/scylla-manager/backupspec v1.0.1/go.mod h1:izqe7mR8wpSFUTjwM3ptUHIk3nF+F5Bipmm0FPRqnlI=
1067-
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250310104639-18257b71bb48 h1:5UxdS6I8EaXSKkEwsV/MAwfCTGpeFDsFFN7UWYkXdW8=
1068-
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250310104639-18257b71bb48/go.mod h1:jVpZJLyynSmkukNbUhn3p0ZOlwGwH8nvx6FYOWIoMxg=
1067+
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250407164115-c5bf399e1759 h1:Sm7q88sTIUWe0AWW/i/50WlS6ZJrlvjKA5MPtHZVix4=
1068+
github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250407164115-c5bf399e1759/go.mod h1:IUo0KL/TTqXUg8ur6sGhAc1jDDF8TBV6LYVTKB2AlIQ=
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=
10711071
github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20250310104639-18257b71bb48 h1:bAQTWuQ8tkbUuHvaMOQBTJaLaTMpXMsBi1znv+yIpLo=

Diff for: pkg/scyllaclient/client_scylla_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func TestClientActiveRepairsIntegration(t *testing.T) {
224224
t.Fatal(err)
225225
}
226226
return len(active) > 0
227-
}, 500*time.Millisecond, 4*time.Second)
227+
}, 500*time.Millisecond, 10*time.Second)
228228
}
229229

230230
func TestClientSnapshotIntegration(t *testing.T) {

Diff for: pkg/service/one2onerestore/helpers_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"github.com/pkg/errors"
1515
"github.com/scylladb/go-log"
1616
"github.com/scylladb/gocqlx/v2"
17+
"github.com/scylladb/scylla-manager/backupspec"
1718
"github.com/scylladb/scylla-manager/v3/pkg/metrics"
1819
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
1920
"github.com/scylladb/scylla-manager/v3/pkg/service/backup"
20-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
2121
"github.com/scylladb/scylla-manager/v3/pkg/service/cluster"
2222
. "github.com/scylladb/scylla-manager/v3/pkg/testutils"
2323
. "github.com/scylladb/scylla-manager/v3/pkg/testutils/db"

Diff for: pkg/service/one2onerestore/model.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import (
77

88
"github.com/pkg/errors"
99
"github.com/scylladb/go-set/strset"
10+
"github.com/scylladb/scylla-manager/backupspec"
1011
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
11-
. "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1212
"github.com/scylladb/scylla-manager/v3/pkg/util/uuid"
1313
)
1414

1515
// Target specifies what data should be restored and from which locations.
1616
type Target struct {
17-
Location []Location `json:"location"`
18-
Keyspace []string `json:"keyspace,omitempty"`
19-
SourceClusterID uuid.UUID `json:"source_cluster_id"`
20-
SnapshotTag string `json:"snapshot_tag"`
21-
NodesMapping []nodeMapping `json:"nodes_mapping"`
17+
Location []backupspec.Location `json:"location"`
18+
Keyspace []string `json:"keyspace,omitempty"`
19+
SourceClusterID uuid.UUID `json:"source_cluster_id"`
20+
SnapshotTag string `json:"snapshot_tag"`
21+
NodesMapping []nodeMapping `json:"nodes_mapping"`
2222
}
2323

2424
func defaultTarget() Target {
@@ -69,8 +69,8 @@ type View struct {
6969
// by which node (host) in the target cluster.
7070
type hostWorkload struct {
7171
host Host
72-
manifestInfo *ManifestInfo
73-
manifestContent *ManifestContentWithIndex
72+
manifestInfo *backupspec.ManifestInfo
73+
manifestContent *backupspec.ManifestContentWithIndex
7474

7575
tablesToRestore []scyllaTable
7676
}
@@ -95,7 +95,7 @@ func (t *Target) validateProperties(keyspaces []string) error {
9595
if len(t.Location) == 0 {
9696
return errors.New("missing location")
9797
}
98-
if !IsSnapshotTag(t.SnapshotTag) {
98+
if !backupspec.IsSnapshotTag(t.SnapshotTag) {
9999
return errors.Errorf("unexpected snapshot-tag format: %s", t.SnapshotTag)
100100
}
101101
if t.SourceClusterID == uuid.Nil {

Diff for: pkg/service/one2onerestore/progress.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
"github.com/pkg/errors"
1212
"github.com/scylladb/gocqlx/v2/qb"
13+
"github.com/scylladb/scylla-manager/backupspec"
1314
"github.com/scylladb/scylla-manager/v3/pkg/schema/table"
1415
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
15-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1616
"github.com/scylladb/scylla-manager/v3/pkg/util/timeutc"
1717
"github.com/scylladb/scylla-manager/v3/pkg/util/uuid"
1818
)

Diff for: pkg/service/one2onerestore/progress_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"os"
1111
"testing"
1212

13+
"github.com/scylladb/scylla-manager/backupspec"
1314
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
14-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1515
"github.com/scylladb/scylla-manager/v3/pkg/testutils"
1616
"github.com/scylladb/scylla-manager/v3/pkg/testutils/db"
1717
"github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig"

Diff for: pkg/service/one2onerestore/service_integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/pkg/errors"
1515
"github.com/scylladb/gocqlx/v2"
1616
"github.com/scylladb/gocqlx/v2/qb"
17-
. "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
17+
"github.com/scylladb/scylla-manager/backupspec"
1818
. "github.com/scylladb/scylla-manager/v3/pkg/testutils"
1919
. "github.com/scylladb/scylla-manager/v3/pkg/testutils/db"
2020
. "github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig"
@@ -44,7 +44,7 @@ func TestOne2OneRestoreServiceIntegration(t *testing.T) {
4444
}
4545

4646
Print("Run backup")
47-
loc := []Location{testLocation("1-1-restore", "")}
47+
loc := []backupspec.Location{testLocation("1-1-restore", "")}
4848
S3InitBucket(t, loc[0].Path)
4949
tag := h.runBackup(t, map[string]any{
5050
"location": loc,

Diff for: pkg/service/one2onerestore/worker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/pkg/errors"
1414
"github.com/scylladb/go-log"
1515
"github.com/scylladb/gocqlx/v2"
16+
"github.com/scylladb/scylla-manager/backupspec"
1617
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
17-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1818
"github.com/scylladb/scylla-manager/v3/pkg/util/parallel"
1919
"github.com/scylladb/scylla-manager/v3/pkg/util/query"
2020
"github.com/scylladb/scylla-manager/v3/pkg/util/retry"

Diff for: pkg/service/one2onerestore/worker_manifest.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@ package one2onerestore
44

55
import (
66
"context"
7+
"os"
78
"path"
89

910
"github.com/pkg/errors"
10-
. "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
11+
"github.com/scylladb/scylla-manager/backupspec"
1112
"github.com/scylladb/scylla-manager/v3/pkg/util/uuid"
1213

1314
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
1415
)
1516

17+
const MetaBaseDir = "backup" + string(os.PathSeparator) + string(backupspec.MetaDirKind)
18+
1619
// getManifestInfo returns manifests with receiver's snapshot tag for all nodes in the location.
17-
func (w *worker) getManifestInfo(ctx context.Context, host, snapshotTag string, clusterID uuid.UUID, location Location) ([]*ManifestInfo, error) {
20+
func (w *worker) getManifestInfo(ctx context.Context, host, snapshotTag string, clusterID uuid.UUID, location backupspec.Location) ([]*backupspec.ManifestInfo, error) {
1821
opts := scyllaclient.RcloneListDirOpts{
1922
FilesOnly: true,
2023
Recurse: true,
2124
}
2225

23-
var manifests []*ManifestInfo
26+
var manifests []*backupspec.ManifestInfo
2427
err := w.client.RcloneListDirIter(ctx, host, location.RemotePath(MetaBaseDir), &opts, func(f *scyllaclient.RcloneListDirItem) {
25-
m := new(ManifestInfo)
28+
m := new(backupspec.ManifestInfo)
2629
if err := m.ParsePath(path.Join(MetaBaseDir, f.Path)); err != nil {
2730
return
2831
}
@@ -37,8 +40,8 @@ func (w *worker) getManifestInfo(ctx context.Context, host, snapshotTag string,
3740
return manifests, nil
3841
}
3942

40-
func (w *worker) getManifestContent(ctx context.Context, host string, manifest *ManifestInfo) (*ManifestContentWithIndex, error) {
41-
mc := &ManifestContentWithIndex{}
43+
func (w *worker) getManifestContent(ctx context.Context, host string, manifest *backupspec.ManifestInfo) (*backupspec.ManifestContentWithIndex, error) {
44+
mc := &backupspec.ManifestContentWithIndex{}
4245
r, err := w.client.RcloneOpen(ctx, host, manifest.Location.RemotePath(manifest.Path()))
4346
if err != nil {
4447
return nil, errors.Wrap(err, "open manifest")

Diff for: pkg/service/one2onerestore/worker_tables.go

+2-15
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"time"
99

1010
"github.com/pkg/errors"
11+
"github.com/scylladb/scylla-manager/backupspec"
1112
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
12-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1313
"github.com/scylladb/scylla-manager/v3/pkg/util/parallel"
1414
)
1515

@@ -56,20 +56,7 @@ func (w *worker) createDownloadJob(ctx context.Context, table backupspec.FilesMe
5656
// Scylla operation might take a really long (and difficult to estimate) time.
5757
// This func exits ONLY on: success, context cancel or non-timeout related error.
5858
func (w *worker) refreshNode(ctx context.Context, table backupspec.FilesMeta, h Host, repeatInterval time.Duration) error {
59-
running, err := w.client.LoadSSTables(ctx, h.Addr, table.Keyspace, table.Table, false, false)
60-
if running || errContains(err, "timeout") {
61-
w.logger.Info(ctx, "Waiting for SSTables loading to finish",
62-
"host", h,
63-
"error", err,
64-
)
65-
select {
66-
case <-ctx.Done():
67-
return ctx.Err()
68-
case <-time.After(repeatInterval):
69-
}
70-
return w.refreshNode(ctx, table, h, repeatInterval)
71-
}
72-
return err
59+
return w.client.AwaitLoadSSTables(ctx, h.Addr, table.Keyspace, table.Table, false, false)
7360
}
7461

7562
func errContains(err error, s string) bool {

Diff for: pkg/service/one2onerestore/worker_tables_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"testing"
1313
"time"
1414

15+
"github.com/scylladb/scylla-manager/backupspec"
1516
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient/scyllaclienttest"
16-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
1717
)
1818

1919
func TestWorkerRefreshNode(t *testing.T) {

Diff for: pkg/service/one2onerestore/worker_validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"slices"
88

99
"github.com/pkg/errors"
10-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
10+
"github.com/scylladb/scylla-manager/backupspec"
1111
"github.com/scylladb/scylla-manager/v3/pkg/util/parallel"
1212
)
1313

Diff for: pkg/service/one2onerestore/worker_validate_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"testing"
1616

1717
"github.com/scylladb/go-log"
18+
"github.com/scylladb/scylla-manager/backupspec"
1819
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient"
19-
"github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
2020
"github.com/scylladb/scylla-manager/v3/pkg/testutils"
2121
"github.com/scylladb/scylla-manager/v3/pkg/testutils/db"
2222
"github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig"

Diff for: vendor/github.com/scylladb/scylla-manager/backupspec/paths.go

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ github.com/scylladb/gocqlx/v2/table
404404
# github.com/scylladb/scylla-manager/backupspec v1.0.1
405405
## explicit; go 1.23.2
406406
github.com/scylladb/scylla-manager/backupspec
407-
# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250310104639-18257b71bb48
407+
# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20250407164115-c5bf399e1759
408408
## explicit; go 1.23.2
409409
github.com/scylladb/scylla-manager/v3/pkg/managerclient
410410
github.com/scylladb/scylla-manager/v3/pkg/managerclient/table

0 commit comments

Comments
 (0)