Skip to content

Commit a833d3e

Browse files
committed
Enable cluster cleanup only for full restore
For selective restore is not apply because it drops databases and not collections.
1 parent 8e30cd5 commit a833d3e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pbm/restore/logical.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ func (r *Restore) Snapshot(
253253
return err
254254
}
255255

256-
if r.nodeInfo.IsSharded() && !r.nodeInfo.IsConfigSrv() {
256+
// drop sharded dbs on sharded cluster, on each shard (not CSRS), only for full restore
257+
if r.nodeInfo.IsSharded() && !r.nodeInfo.IsConfigSrv() && !util.IsSelective(nss) {
257258
err = r.dropShardedDBs(ctx, bcp)
258259
if err != nil {
259260
return err
@@ -438,7 +439,8 @@ func (r *Restore) PITR(
438439
return err
439440
}
440441

441-
if r.nodeInfo.IsSharded() && !r.nodeInfo.IsConfigSrv() {
442+
// drop sharded dbs on sharded cluster, on each shard (not CSRS), only for full restore
443+
if r.nodeInfo.IsSharded() && !r.nodeInfo.IsConfigSrv() && !util.IsSelective(nss) {
442444
err = r.dropShardedDBs(ctx, bcp)
443445
if err != nil {
444446
return err

0 commit comments

Comments
 (0)