Skip to content

Commit c095336

Browse files
authored
Fix a bug which causes restoration to fail when first delta snapshot completely overlaps latest full snapshot. (#845)
1 parent 5bbb6d3 commit c095336

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/snapshot/restorer/restorer.go

+9
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,15 @@ func (r *Restorer) applyFirstDeltaSnapshot(clientKV client.KVCloser, snap *brtyp
509509
}
510510
lastRevision := resp.Header.Revision
511511

512+
if lastRevision == snap.LastRevision {
513+
// there is no need to apply this fist delta snapshot
514+
// as it's completely overlaps with full snapshot data.
515+
// please refer: https://github.com/gardener/etcd-backup-restore/issues/844
516+
r.logger.Infof("First delta snapshot %s found to be completely overlap with full snapshot with db revisions: %d", path.Join(snap.SnapDir, snap.SnapName), lastRevision)
517+
r.logger.Info("Skipping this delta snapshot...")
518+
return nil
519+
}
520+
512521
var newRevisionIndex int
513522
for index, event := range events {
514523
if event.EtcdEvent.Kv.ModRevision > lastRevision {

0 commit comments

Comments
 (0)