Skip to content

Commit 8536422

Browse files
pooknullhors
andauthored
K8SPSMDB-1055: return ErrNoOplogsForPITR on empty oplog.Timeline (#1502)
https://perconadev.atlassian.net/browse/K8SPSMDB-1055 Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent 647c881 commit 8536422

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/psmdb/backup/pbm.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,12 @@ func (b *pbmC) GetLatestTimelinePITR(ctx context.Context) (oplog.Timeline, error
462462
return oplog.Timeline{}, ErrNoOplogsForPITR
463463
}
464464

465-
return timelines[len(timelines)-1], nil
465+
tl := timelines[len(timelines)-1]
466+
if tl.Start == 0 || tl.End == 0 {
467+
return oplog.Timeline{}, ErrNoOplogsForPITR
468+
}
469+
470+
return tl, nil
466471
}
467472

468473
// PITRGetChunkContains returns a pitr slice chunk that belongs to the

0 commit comments

Comments
 (0)