diff --git a/pkg/metrics/restore.go b/pkg/metrics/restore.go index 42c95815ab7..73b509d70b7 100644 --- a/pkg/metrics/restore.go +++ b/pkg/metrics/restore.go @@ -143,6 +143,8 @@ func (m RestoreMetrics) SetProgress(labels RestoreProgressLabels, progress float m.progress.With(l).Set(progress) } +// TODO: add new states for Scylla restore. + // RestoreState is the enum that defines how node is used during the restore. type RestoreState int diff --git a/pkg/service/restore/model.go b/pkg/service/restore/model.go index effd342f2bd..bab6d420830 100644 --- a/pkg/service/restore/model.go +++ b/pkg/service/restore/model.go @@ -177,6 +177,8 @@ func (t *View) UnmarshalUDT(name string, info gocql.TypeInfo, data []byte) error return gocql.Unmarshal(info, data, f.Addr().Interface()) } +// TODO - new table and struct for scylla api progress? + // RunProgress describes progress of restoring a single batch. type RunProgress struct { ClusterID uuid.UUID diff --git a/pkg/service/restore/tablesdir_worker.go b/pkg/service/restore/tablesdir_worker.go index 38f707ef4f2..cf4d05a03d9 100644 --- a/pkg/service/restore/tablesdir_worker.go +++ b/pkg/service/restore/tablesdir_worker.go @@ -286,9 +286,9 @@ func (w *tablesWorker) scyllaRestore(ctx context.Context, host string, b batch) // TODO: resolve endpoint by either: // - making agent return endpoint information to SM <- preferred // - allowing for specifying endpoint instead of backed in --location flag - prefix, ok := strings.CutPrefix(b.RemoteSSTableDir, b.Location.Path) + prefix, ok := strings.CutPrefix(b.RemoteSSTableDir, b.Location.StringWithoutDC()) if !ok { - return errors.Errorf("") + return errors.Errorf("asdasd") } id, err := w.client.ScyllaRestore(ctx, host, "192.168.200.99", b.Location.Path, prefix, b.Keyspace, b.Table, b.TOC()) if err != nil { @@ -313,18 +313,19 @@ func (w *tablesWorker) scyllaRestore(ctx context.Context, host string, b batch) } func (w *tablesWorker) scyllaWaitTask(ctx context.Context, pr *RunProgress, b batch) (err error) { - defer func() { - // On error abort task - if err != nil { - if e := w.client.ScyllaAbortTask(context.Background(), pr.Host, pr.ScyllaTaskID); e != nil { - w.logger.Error(ctx, "Failed to abort task", - "host", pr.Host, - "id", pr.ScyllaTaskID, - "error", e, - ) - } - } - }() + // TODO: restore task cannot be aborted. + //defer func() { + // // On error abort task + // if err != nil { + // if e := w.client.ScyllaAbortTask(context.Background(), pr.Host, pr.ScyllaTaskID); e != nil { + // w.logger.Error(ctx, "Failed to abort task", + // "host", pr.Host, + // "id", pr.ScyllaTaskID, + // "error", e, + // ) + // } + // } + //}() for { if ctx.Err() != nil {