Skip to content

Commit fa14224

Browse files
committed
Introduce cleanupCluster state
It will be used for cleaning databases/collections in the sharded cluster before the logical restore.
1 parent 38dc5aa commit fa14224

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

pbm/defs/defs.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ const (
9797
// for phys restore, to indicate shards have been stopped
9898
StatusDown Status = "down"
9999

100-
StatusStarting Status = "starting"
101-
StatusRunning Status = "running"
102-
StatusDumpDone Status = "dumpDone"
103-
StatusCopyReady Status = "copyReady"
104-
StatusCopyDone Status = "copyDone"
105-
StatusPartlyDone Status = "partlyDone"
106-
StatusDone Status = "done"
107-
StatusCancelled Status = "canceled"
108-
StatusError Status = "error"
100+
StatusStarting Status = "starting"
101+
StatusCleanupCluster Status = "cleanupCluster"
102+
StatusRunning Status = "running"
103+
StatusDumpDone Status = "dumpDone"
104+
StatusCopyReady Status = "copyReady"
105+
StatusCopyDone Status = "copyDone"
106+
StatusPartlyDone Status = "partlyDone"
107+
StatusDone Status = "done"
108+
StatusCancelled Status = "canceled"
109+
StatusError Status = "error"
109110

110111
// status to communicate last op timestamp if it's not set
111112
// during external restore

pbm/restore/logical.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ func (r *Restore) Snapshot(
240240
return err
241241
}
242242

243-
err = r.toState(ctx, defs.StatusRunning, &defs.WaitActionStart)
243+
err = r.toState(ctx, defs.StatusCleanupCluster, &defs.WaitActionStart)
244+
245+
err = r.toState(ctx, defs.StatusRunning, nil)
244246
if err != nil {
245247
return err
246248
}

0 commit comments

Comments
 (0)