Skip to content

Commit dad8a16

Browse files
committed
fixup
1 parent 703c0d0 commit dad8a16

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

cmd/pbm-agent/agent.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ func (a *Agent) Resync(ctx context.Context, opid ctrl.OPID, ep config.Epoch) {
215215
l.Debug("epoch set to %v", epch)
216216
}
217217

218-
type lockAquireFn func(context.Context) (bool, error)
219-
220218
// acquireLock tries to acquire the lock. If there is a stale lock
221219
// it tries to mark op that held the lock (backup, [pitr]restore) as failed.
222220
func (a *Agent) acquireLock(ctx context.Context, l *lock.Lock, lg log.LogEvent) (bool, error) {

internal/backup/logical.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (b *Backup) doLogical(
9696
return storage.Upload(ctx, w, stg, bcp.Compression, bcp.CompressionLevel, filename, -1)
9797
})
9898
// ensure slicer is stopped in any case (done, error or canceled)
99-
defer stopOplogSlicer()
99+
defer stopOplogSlicer() //nolint:errcheck
100100

101101
if !util.IsSelective(bcp.Namespaces) {
102102
// Save users and roles to the tmp collections so the restore would copy that data

internal/restore/logical.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,10 @@ func (r *Restore) snapshotObjects(bcp *backup.BackupMeta) (string, []oplog.Oplog
547547
var ok bool
548548
var rsMeta *backup.BackupReplset
549549
revRSName := util.MakeReverseRSMapFunc(r.rsMap)(r.nodeInfo.SetName)
550-
for _, v := range bcp.Replsets {
551-
if v.Name == revRSName {
552-
rsMeta = &v
550+
for i := range bcp.Replsets {
551+
r := &bcp.Replsets[i]
552+
if r.Name == revRSName {
553+
rsMeta = r
553554
ok = true
554555
break
555556
}

internal/slicer/slicer.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ func (s *Slicer) Stream(
342342
Type: ctrl.CmdPITR,
343343
}
344344

345-
bcp := ctrl.NilOPID
346345
for {
347346
sliceTo := primitive.Timestamp{}
348347
// waiting for a trigger
@@ -353,13 +352,13 @@ func (s *Slicer) Stream(
353352
s.l.Info("got done signal, stopping")
354353
lastSlice = true
355354
// on wakeup or tick whatever comes first do the job
356-
case bcp = <-backupSig:
355+
case bcp := <-backupSig:
357356
s.l.Info("got wake_up signal")
358357
if bcp != ctrl.NilOPID {
359358
opid := bcp.String()
360359
s.l.Info("wake_up for bcp %s", opid)
361360

362-
sliceTo, err = s.backupStartTS(ctx, opid, s.rs, timeouts.StartingStatus())
361+
sliceTo, err = s.backupStartTS(ctx, opid, timeouts.StartingStatus())
363362
if err != nil {
364363
return errors.Wrap(err, "get backup start TS")
365364
}
@@ -531,7 +530,7 @@ func (s *Slicer) getOpLock(ctx context.Context, l *lock.LockHeader, t time.Durat
531530
return lck, nil
532531
}
533532

534-
func (s *Slicer) backupStartTS(ctx context.Context, opid, rs string, t time.Duration) (primitive.Timestamp, error) {
533+
func (s *Slicer) backupStartTS(ctx context.Context, opid string, t time.Duration) (primitive.Timestamp, error) {
535534
var ts primitive.Timestamp
536535
tk := time.NewTicker(time.Second)
537536
defer tk.Stop()

0 commit comments

Comments
 (0)