@@ -12,21 +12,9 @@ import (
12
12
. "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec"
13
13
"github.com/scylladb/scylla-manager/v3/pkg/util/parallel"
14
14
"github.com/scylladb/scylla-manager/v3/pkg/util/retry"
15
- "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc"
16
15
)
17
16
18
- func (w * workerTools ) AwaitSchemaAgreement (ctx context.Context , clusterSession gocqlx.Session ) {
19
- w .Logger .Info (ctx , "Awaiting schema agreement..." )
20
-
21
- var stepError error
22
- defer func (start time.Time ) {
23
- if stepError != nil {
24
- w .Logger .Error (ctx , "Awaiting schema agreement failed see exact errors above" , "duration" , timeutc .Since (start ))
25
- } else {
26
- w .Logger .Info (ctx , "Done awaiting schema agreement" , "duration" , timeutc .Since (start ))
27
- }
28
- }(timeutc .Now ())
29
-
17
+ func (w * workerTools ) AwaitSchemaAgreement (ctx context.Context , clusterSession gocqlx.Session ) error {
30
18
const (
31
19
waitMin = 15 * time .Second // nolint: revive
32
20
waitMax = 1 * time .Minute
@@ -52,7 +40,7 @@ func (w *workerTools) AwaitSchemaAgreement(ctx context.Context, clusterSession g
52
40
localSchemaStmt = "SELECT schema_version FROM system.local WHERE key='local'"
53
41
)
54
42
55
- stepError = retry .WithNotify (ctx , func () error {
43
+ return retry .WithNotify (ctx , func () error {
56
44
var v []string
57
45
if err := clusterSession .Query (peerSchemasStmt , nil ).SelectRelease (& v ); err != nil {
58
46
return retry .Permanent (err )
@@ -84,19 +72,10 @@ func (w *worker) DumpSchema(ctx context.Context, clusterSession gocqlx.Session)
84
72
85
73
func (w * worker ) UploadSchema (ctx context.Context , hosts []hostInfo ) (stepError error ) {
86
74
if w .Schema == nil {
75
+ w .Logger .Info (ctx , "No schema CQL file to upload" )
87
76
return nil
88
77
}
89
78
90
- w .Logger .Info (ctx , "Uploading schema..." )
91
-
92
- defer func (start time.Time ) {
93
- if stepError != nil {
94
- w .Logger .Error (ctx , "Uploading schema failed see exact errors above" , "duration" , timeutc .Since (start ))
95
- } else {
96
- w .Logger .Info (ctx , "Done uploading schema" , "duration" , timeutc .Since (start ))
97
- }
98
- }(timeutc .Now ())
99
-
100
79
// Select single host per location
101
80
locations := map [string ]hostInfo {}
102
81
for _ , hi := range hosts {
0 commit comments