Skip to content

Commit 2fce3b0

Browse files
committed
Remove logic for removing mongod log file(s)
... after successful physical restore Internal mongod log files should stay in dbpath dir in case of successful or failad restore. It'll be removed during new restore procedure.
1 parent 267a2f6 commit 2fce3b0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pbm/restore/physical.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,12 @@ func (r *PhysRestore) close(noerr, cleanup bool) {
220220
r.log.Error("remove tmp config %s: %v", r.tmpConf.Name(), err)
221221
}
222222
}
223-
// clean-up internal mongod log only if there is no error
223+
224+
// if there is no error clean-up internal restore files, internal log file(s) should stay
224225
if noerr {
225-
r.log.Debug("rm tmp logs")
226-
err := os.Remove(path.Join(r.dbpath, internalMongodLog))
227-
if err != nil {
228-
r.log.Warning("remove tmp mongod logs %s: %v", path.Join(r.dbpath, internalMongodLog), err)
229-
}
230226
extMeta := filepath.Join(r.dbpath,
231227
fmt.Sprintf(defs.ExternalRsMetaFile, util.MakeReverseRSMapFunc(r.rsMap)(r.nodeInfo.SetName)))
232-
err = os.Remove(extMeta)
228+
err := os.Remove(extMeta)
233229
if err != nil && !errors.Is(err, os.ErrNotExist) {
234230
r.log.Warning("remove external rs meta <%s>: %v", extMeta, err)
235231
}

0 commit comments

Comments
 (0)