Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PBM-1344] skip chunk between last chunk and last backup if there is no such #975

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pbm/slicer/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@ func (s *Slicer) Catchup(ctx context.Context) error {
cfg.PITR.Compression,
cfg.PITR.CompressionLevel)
if err != nil {
return err
}
var rangeErr oplog.InsuffRangeError
if !errors.As(err, &rangeErr) {
return err
}

s.l.Info("uploaded chunk %s - %s", formatts(lastChunk.EndTS), formatts(rs.FirstWriteTS))
s.lastTS = rs.FirstWriteTS
s.l.Warning("skip chunk %s - %s: %v",
formatts(lastChunk.EndTS), formatts(rs.FirstWriteTS), rangeErr)
} else {
s.l.Info("uploaded chunk %s - %s", formatts(lastChunk.EndTS), formatts(rs.FirstWriteTS))
s.lastTS = rs.FirstWriteTS
}
}

err = s.copyReplsetOplog(ctx, rs)
Expand Down
13 changes: 13 additions & 0 deletions pbm/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ func (rwe rwError) Error() string {
return r
}

func (rwe rwError) Unwrap() error {
if rwe.read != nil {
return rwe.read
}
if rwe.write != nil {
return rwe.write
}
if rwe.compress != nil {
return rwe.compress
}
return nil
}

func (rwe rwError) nil() bool {
return rwe.read == nil && rwe.compress == nil && rwe.write == nil
}
Expand Down
Loading