Skip to content

Commit 53ea810

Browse files
committed
exclude chunks with end_ts at ts
1 parent 6ab0375 commit 53ea810

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pbm/backup/delete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func MakeCleanupInfo(ctx context.Context, conn connect.Client, ts primitive.Time
398398

399399
beforeChunks := make([]oplog.OplogChunk, 0, len(chunks))
400400
for _, chunk := range chunks {
401-
if chunk.EndTS.Before(r.LastWriteTS) {
401+
if !chunk.EndTS.After(r.LastWriteTS) {
402402
beforeChunks = append(beforeChunks, chunk)
403403
}
404404
}
@@ -419,7 +419,7 @@ func MakeCleanupInfo(ctx context.Context, conn connect.Client, ts primitive.Time
419419

420420
beforeChunks := make([]oplog.OplogChunk, 0, len(chunks))
421421
for _, chunk := range chunks {
422-
if chunk.EndTS.Before(ts) {
422+
if !chunk.EndTS.After(ts) {
423423
beforeChunks = append(beforeChunks, chunk)
424424
}
425425
}
@@ -431,7 +431,7 @@ func MakeCleanupInfo(ctx context.Context, conn connect.Client, ts primitive.Time
431431
beforeChunks := []oplog.OplogChunk{}
432432
afterChunks := []oplog.OplogChunk{}
433433
for _, chunk := range chunks {
434-
if chunk.EndTS.Before(backups[baseIndex].LastWriteTS) {
434+
if !chunk.EndTS.After(backups[baseIndex].LastWriteTS) {
435435
beforeChunks = append(beforeChunks, chunk)
436436
} else {
437437
// keep chunks after the last base snapshot restore time

0 commit comments

Comments
 (0)