backrest icon indicating copy to clipboard operation
backrest copied to clipboard

Snapshot listed multiple time when same repo is shared between two servers

Open ziotibia81 opened this issue 1 year ago • 8 comments

I have one repository, based on rest-server, and two servers running backrest and using the same repository. One server show the same snapshot of other server multiple times.

View on server 50-backrest-srv

Image

View on server 54-backrest-srv

Image

Reindex has no effects. Backrest 1.7.2

ziotibia81 avatar Mar 03 '25 12:03 ziotibia81

I'm seeing a similar thing. I have a repo that gets backed up using resticker (think Restic command line executable automation). I then index those snapshots into backrest as a gui. Every time I index the repo, I'm getting another duplicate listing of the snapshot even though only 1 instance of the snapshot exists in the repo.

rhatguy avatar Mar 03 '25 19:03 rhatguy

I thought I was going crazy. Glad it's not just me.

For some more info, it always appears to be the other devices snapshots that are duplicated.

So my instance, I have a hetzner storage box that stores my repo. With 2 local devices backing up. Device 1 shows snapshots correctly, but shows duplicates for device 2. The opposite is true when looking from the other device

Vyerni avatar Mar 08 '25 09:03 Vyerni

Thanks for reporting this -- definitely a bug. I'll track down what's going on here and get out a patch for the next minor version release.

garethgeorge avatar Mar 11 '25 23:03 garethgeorge

I believe the bug is in https://github.com/garethgeorge/backrest/blob/main/internal/orchestrator/tasks/taskindexsnapshots.go#L148 , I recently (accidentally) added logic that filters to snapshots from the current instance when considering what already exists / should be indexed. This is a relatively straightforward fix, but existing duplicates may persist in your history. I'll spend some times thinking about options for deduplication.

garethgeorge avatar Mar 11 '25 23:03 garethgeorge

Thanks @garethgeorge . For my use case I’d be fine to just reinfect the whole repo. I know that might not be feasible for everyone though.

rhatguy avatar Mar 11 '25 23:03 rhatguy

Are we saying we might just need to clear local cache, and re-connect the remote repo to clear all the extra "snapshots"? If that's the case, it's not a big deal, again in my case.

Vyerni avatar Mar 12 '25 02:03 Vyerni

@garethgeorge

I see this has been address in the 1.7.3 release.

How best do we proceed with clearing duplicated snapshots in lists?

Vyerni avatar Mar 15 '25 10:03 Vyerni

A bit late on this, https://github.com/garethgeorge/backrest/releases/tag/v1.8.0 adds a migration that will delete duplicated entries if you haven't yet reset your local db.

garethgeorge avatar Apr 03 '25 07:04 garethgeorge