Skip to content

Commit

Permalink
Fix a bug which causes restoration to fail when first delta snapshot …
Browse files Browse the repository at this point in the history
…completely overlaps latest full snapshot. (#845)
  • Loading branch information
ishan16696 authored Feb 28, 2025
1 parent 5bbb6d3 commit c095336
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/snapshot/restorer/restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,15 @@ func (r *Restorer) applyFirstDeltaSnapshot(clientKV client.KVCloser, snap *brtyp
}
lastRevision := resp.Header.Revision

if lastRevision == snap.LastRevision {
// there is no need to apply this fist delta snapshot
// as it's completely overlaps with full snapshot data.
// please refer: https://github.com/gardener/etcd-backup-restore/issues/844
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)
r.logger.Info("Skipping this delta snapshot...")
return nil
}

var newRevisionIndex int
for index, event := range events {
if event.EtcdEvent.Kv.ModRevision > lastRevision {
Expand Down

0 comments on commit c095336

Please sign in to comment.