Skip to content

Commit

Permalink
K8SPSMDB-1055: return ErrNoOplogsForPITR on empty oplog.Timeline (#…
Browse files Browse the repository at this point in the history
…1502)

https://perconadev.atlassian.net/browse/K8SPSMDB-1055

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
  • Loading branch information
pooknull and hors authored Apr 8, 2024
1 parent 647c881 commit 8536422
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/psmdb/backup/pbm.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,12 @@ func (b *pbmC) GetLatestTimelinePITR(ctx context.Context) (oplog.Timeline, error
return oplog.Timeline{}, ErrNoOplogsForPITR
}

return timelines[len(timelines)-1], nil
tl := timelines[len(timelines)-1]
if tl.Start == 0 || tl.End == 0 {
return oplog.Timeline{}, ErrNoOplogsForPITR
}

return tl, nil
}

// PITRGetChunkContains returns a pitr slice chunk that belongs to the
Expand Down

0 comments on commit 8536422

Please sign in to comment.