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

Inconsistent duration #1290

Closed
DottoreG opened this issue Sep 28, 2017 · 25 comments
Closed

Inconsistent duration #1290

DottoreG opened this issue Sep 28, 2017 · 25 comments
Labels
state: need implementing cause/request established, need work/solution type: bug

Comments

@DottoreG
Copy link

Output of restic version

restic 0.7.1
compiled with go1.8.3 on linux/amd64

How did you run restic exactly?

restic backup -x --exclude-file /tmp/restic-exclude /
restic backup -x --exclude-file /tmp/restic-exclude /home
restic backup -x --exclude-file /tmp/restic-exclude /home /home/dottoreg/Private
# now combine the backup of the above sources in one backup:
restic backup -x --exclude-file /tmp/restic-exclude / /home /home/dottoreg/Private

What backend/server/service did you use?

File based to USB-attached hd. The path is stored in the environment variable (as is the password).

Expected behavior

I would expect a consistent amount and duration of the backup processes.

Actual behavior

using parent snapshot effbd27c
scan [/]
scanned 58009 directories, 605162 files in 0:22
[3:08] 100.00%  72.644 MiB/s  13.342 GiB / 13.342 GiB  663170 / 663171 items  0 errors  ETA 0:00 
duration: 3:08, 72.34MiB/s
snapshot 743e02cd saved
using parent snapshot effbd27c
scan [/home]
scanned 3923 directories, 96649 files in 0:14
[11:24] 100.00%  18.642 MiB/s  12.452 GiB / 12.452 GiB  100572 / 100572 items  0 errors  ETA 0:00 
duration: 11:24, 18.62MiB/s
snapshot 2cb14872 saved
using parent snapshot effbd27c
scan [/home/dottoreg/Private]
scanned 76749 directories, 133789 files in 12:18
[21:00] 100.00%  23.673 MiB/s  29.129 GiB / 29.128 GiB  210538 / 210538 items  0 errors  ETA 0:00 
duration: 21:00, 23.67MiB/s
snapshot b2b616d3 saved

The combined run takes much more time to scan, much more time for the backup. The Throughput is much lower:

using parent snapshot ba12eb4a
scan [/ /home /home/dottoreg/Private]
scanned 296102 directories, 1199820 files in 20:20
[1:17:59] 100.00%  27.483 MiB/s  125.581 GiB / 125.574 GiB  1495922 / 1495922 items  0 errors  ETA 0:00 
duration: 1:17:59, 27.48MiB/s
snapshot effbd27c saved

My problem: Sum of durations: 3:08 + 11:24 + 21:00 is much lower than 1:17:59. (It's a factor of two!)
Sum of scan times: 0:22 + 0:14 + 12:18 is much lower than 20:20.

Steps to reproduce the behavior

See above

Do you have any idea what may have caused this?

No.

Do you have an idea how to solve the issue?

Perhaps it is not the same when backing up the isolated items compared to one backup with all three items. Should I stay with three isolated backups?

@DottoreG DottoreG changed the title Inconsitent duration Inconsistent duration Sep 28, 2017
@fd0
Copy link
Member

fd0 commented Sep 29, 2017

Ah, interesting, that's a corner case restic doesn't consider yet. I need to have an in-depth look.

@DottoreG
Copy link
Author

DottoreG commented Oct 2, 2017

The issue I described above was observed at my employers computer. Today I made some more tests with my personal notebook:

Output of restic version

restic 0.7.1
compiled with go1.8.3 on linux/amd64

How did you run restic exactly?

restic backup a1 a2 b1 b2 b3

Where a1, a2 is on first hd, b1, b2, b3 on second.

What backend/server/service did you use?

Local file systems (ext4), two source hds (one ssd, one normal hd), one usb attached hd (target).

Expected behavior

Consecutive backups (with a parent) should be much faster when no files are modified.

Actual behavior

The backup starts up very fast. I can see that after the scan restic reads only data from the target disk. But after some time nothing gets read from the target disk but restic starts reading from source disk. (I used nmon to discover this. The target disk even goes to idle mode – shuts off after some time.)
Also strace shows that restic reads unchanged files in whole. Restic performs openat() and several read()s until the whole file contents is read. This explains the bad speed.

first run:

scan [a1 a2 b1 b2 b3]
scanned 79347 directories, 1067818 files in 0:20
[1:09:12] 100.00%  87.913 MiB/s  356.458 GiB / 356.457 GiB  1147170 / 1... ETA 0:00 
duration: 1:09:12, 87.90MiB/s
snapshot d045e2e0 saved

second run:

using parent snapshot d045e2e0
scan [a1 a2 b1 b2 b3]
scanned 79347 directories, 1067834 files in 0:19
[1:06:15] 99.98%  91.811 MiB/s  356.395 GiB / 356.458 GiB  1147181 / 11... ETA 0:00 
duration: 1:06:15, 91.82MiB/s
snapshot 72c01778 saved

third run:

using parent snapshot 72c01778
scan [a1 a2 b1 b2 b3]
scanned 79354 directories, 1068037 files in 0:16
[1:04:59] 100.00%  93.584 MiB/s  356.333 GiB / 356.333 GiB  1147390 / 1... ETA 0:00 
duration: 1:04:59, 93.58MiB/s
snapshot 9cded945 saved

Creating a snapshot consisting of only a1 and a2 results in a duration that I would expect:

using parent snapshot 9cded945
scan [a1 a2]
scanned 77715 directories, 1024815 files in 0:19
[4:57] 100.00%  506.584 MiB/s  146.929 GiB / 146.929 GiB  1102529 / 110... ETA 0:00 
duration: 4:57, 506.32MiB/s
snapshot 9219eebc saved

Only data from the target disk are read.

On the other hand if I perform a snapshot of b1, b2, b3 it gets slow:

using parent snapshot 9cded945
scan [b1 b2 b3]
scanned 1639 directories, 43222 files in 0:00
[1:01:59] 100.00%  57.658 MiB/s  209.404 GiB / 209.404 GiB  44861 / 448... ETA 0:00 
duration: 1:01:59, 57.65MiB/s
snapshot dd3b5e9f saved

In this case I see that data only is read from the source disk. Weird.

If I repeat this backup it's also fast!

using parent snapshot dd3b5e9f
scan [b1 b2 b3]
scanned 1639 directories, 43222 files in 0:00
[0:15] 100.00%  12.627 GiB/s  209.404 GiB / 209.404 GiB  44861 / 44861 ... ETA 0:01 
duration: 0:15, 13600.12MiB/s
snapshot d030e90e saved

But still the complete backup of (a1 a2 b1 b2 b3) is slow. I have no idea how to speed it up.

@DottoreG
Copy link
Author

DottoreG commented Oct 8, 2017

I invested a little further. I made a debug build and tried to identify differences between the slow case and the fast case. Here it goes. The first case is the fast one:

2017/10/07 16:52:43 restic/exclude.go:163	main.rejectByDevice.func1	1	item /usr/bin/bashbug, test dir /usr/bin/bashbug
2017/10/07 16:52:43 restic/exclude.go:163	main.rejectByDevice.func1	1	item /usr/bin/bashbug, test dir /usr/bin
2017/10/07 16:52:43 restic/exclude.go:163	main.rejectByDevice.func1	1	item /usr/bin/bashbug, test dir /usr
2017/10/07 16:52:43 restic/exclude.go:163	main.rejectByDevice.func1	1	item /usr/bin/bashbug, test dir /
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr/bin/bashbug
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr/bin
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /
2017/10/07 17:01:20 pipe/pipe.go:83	pipe.walk	28	start on "/usr/bin/bashbug", basedir "/"
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr/bin/bashbug
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr/bin
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /usr
2017/10/07 17:01:20 restic/exclude.go:163	main.rejectByDevice.func1	28	item /usr/bin/bashbug, test dir /
2017/10/07 17:01:20 pipe/pipe.go:108	pipe.walk	28	sending file job for /usr/bin/bashbug, res 0xc44574fb60
2017/10/07 17:01:20 restic/node.go:531	restic.(*Node).IsNewer	29	node /usr/bin/bashbug is not newer
2017/10/07 17:01:20 restic/node.go:664	restic.(*Node).fillExtendedAttributes	79	fillExtendedAttributes(/usr/bin/bashbug) [] <nil>

As can be seen restic correctly determines that the file is unchanged.
In the second case the file is also unchanged on disk. But nonetheless restic processes it much further:

2017/10/07 22:33:42 restic/exclude.go:163	main.rejectByDevice.func1	1	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos/dsc_2177_lzn.jpg
2017/10/07 22:33:42 restic/exclude.go:163	main.rejectByDevice.func1	1	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos
2017/10/07 23:06:32 restic/exclude.go:163	main.rejectByDevice.func1	15	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos/dsc_2177_lzn.jpg
2017/10/07 23:06:32 restic/exclude.go:163	main.rejectByDevice.func1	15	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos
2017/10/07 23:06:32 pipe/pipe.go:83	pipe.walk	15	start on "/hd/photos/dsc_2177_lzn.jpg", basedir "/hd"
2017/10/07 23:06:32 restic/exclude.go:163	main.rejectByDevice.func1	15	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos/dsc_2177_lzn.jpg
2017/10/07 23:06:32 restic/exclude.go:163	main.rejectByDevice.func1	15	item /hd/photos/dsc_2177_lzn.jpg, test dir /hd/photos
2017/10/07 23:06:32 pipe/pipe.go:108	pipe.walk	15	sending file job for /hd/photos/dsc_2177_lzn.jpg, res 0xc43096f920
2017/10/07 23:06:32 archiver/archiver.go:528	archiver.(*archivePipe).compare	16	new job: photos/dsc_2177_lzn.jpg
2017/10/07 23:06:32 archiver/archiver.go:546	archiver.(*archivePipe).compare	16	    "." < "photos", file "photos/dsc_2177_lzn.jpg" added
2017/10/07 23:06:32 archiver/archiver.go:266	archiver.(*Archiver).fileWorker	100	got job {/hd photos/dsc_2177_lzn.jpg 0xc42fd05ad0 <nil> 0xc43096f920 <nil>}
2017/10/07 23:06:32 restic/node.go:664	restic.(*Node).fillExtendedAttributes	100	fillExtendedAttributes(/hd/photos/dsc_2177_lzn.jpg) [] <nil>
2017/10/07 23:06:32 archiver/archiver.go:305	archiver.(*Archiver).fileWorker	100	   photos/dsc_2177_lzn.jpg no old data
2017/10/07 23:06:32 archiver/archiver.go:310	archiver.(*Archiver).fileWorker	100	   read and save photos/dsc_2177_lzn.jpg
2017/10/07 23:06:33 archiver/archiver.go:189	archiver.updateNodeContent	100	checking size for file /hd/photos/dsc_2177_lzn.jpg
2017/10/07 23:06:33 archiver/archiver.go:205	archiver.updateNodeContent	100	SaveFile("/hd/photos/dsc_2177_lzn.jpg"): 2 blobs
2017/10/07 23:06:33 archiver/archiver.go:325	archiver.(*Archiver).fileWorker	100	   processed photos/dsc_2177_lzn.jpg, 2 blobs
2017/10/07 23:13:47 archiver/archiver.go:527	archiver.(*archivePipe).compare	16	old job: photos/dsc_2177_lzn.jpg
2017/10/07 23:13:47 archiver/archiver.go:566	archiver.(*archivePipe).compare	16	    "photos/dsc_2177_lzn.jpg" > "photos", file "photos/dsc_2177_lzn.jpg" removed

I have no idea why restic performs differently in these cases. In the mounted snapshots no difference is visible between each of the files backed up.

@fd0
Copy link
Member

fd0 commented Oct 8, 2017

How do you start restic exactly? Can you paste the command you're running? Something odd is going on here.

Can you try minimizing the observed behavior, so I can try to reproduce it?

@DottoreG
Copy link
Author

DottoreG commented Oct 10, 2017

This is my script with which I created the log files (I replaced my username by nobody):

#!
export RESTIC_PASSWORD_FILE=/tmp/restic-pw
export RESTIC_REPOSITORY=/mnt/backup-ext/restic

# standard program (release)
#RESTIC=restic

# debug build
RESTIC=/home/nobody/tmp/restic-master/restic

EXCLUDE='
/var/cache
/var/tmp
/home/nobody/.cache
/home/nobody/.ccache
/home/nobody/.thumbnails/
/home/nobody/.local/share/baloo
/home/nobody/.local/share/Trash
/home/nobody/.VirtualBox/*/Snapshots
/home/nobody/VirtualBox VMs/Win7b
/home/nobody/.davfs2/cache
/home/nobody/tmp
/home/nobody/Downloads
/home/nobody/.Private
/usr/portage/distfiles/
/usr/portage/packages/
'
echo "$EXCLUDE" > /tmp/restic-exclude

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-root
ionice -c3 $RESTIC backup -x --exclude-file /tmp/restic-exclude /

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-private
ionice -c3 $RESTIC backup -x --exclude-file /tmp/restic-exclude /home/nobody/Private

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-photos
ionice -c3 $RESTIC backup -x --exclude-file /tmp/restic-exclude /hd/photos

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-mp3
ionice -c3 $RESTIC backup -x --exclude-file /tmp/restic-exclude /hd/mp3

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-root-hoerbuecher
ionice -c3 $RESTIC backup -x --exclude-file /tmp/restic-exclude /hd/Hörbücher

Now I'm going to trim my setup ...
... I did not find a trimmed example. But just for fun I made a backup with this statement:

export DEBUG_LOG=/home/nobody/tmp/restic-analyse/restic-log-photos-no-exclude
ionice -c3 $RESTIC backup -x  /hd/photos

By not stating any excludes the backup is performed with the expected speed! And I can see in the log that restic correctly determines the files as being is not newer. So there seems to be something wrong in the code processing the excludes. I hope this helps!

EDIT: I'm sorry but this is not the whole story. Even not using --exclude-file does not speed up the backup of my mp3's. So there still must be something. I'm searching further...

UPDATE: I made some more tests. But I don't get consistent results. Now all of my backups are performed with the expected speed! I can't explain it. I did not change anything in my setup. I did not change any file in the directories which were slow to backup before. So there must have changed something else - but what?

@fd0
Copy link
Member

fd0 commented Oct 12, 2017

Hmmm, this is odd. Thanks for trying to dig into it! What file system do the source files (that you're saving with restic) reside on? Is it possible that maybe atime is active for that?

One thing I haven't told you yet: When restic is unable to find a so called "parent snapshot" (a snapshot of exactly the same set of directories on the same host), it will re-read all files, but not store any duplicate blobs.

@DottoreG
Copy link
Author

DottoreG commented Oct 13, 2017

No atime should not be the cause. I'm using ext4 for all file systems. And although the files are accessed (atime) they are not modified (mtime).
And parent snapshots can't be the cause either because my problems persist if I create two snapshots of the same directory in a row.

But right now I have a new idea of the cause: I performed a restic check and it reported some problems. restic suggested a rebuild-index which corrected the issues. (I did not call restic check earlier because I did not expect any problems after such short usage time.)

After thinking about it: Might it be a problem to interrupt restic using ctrl-c? I used ctrl-c to break restic in my early tests some times. Perhaps restic gets into a problematic state which results in the behaviour I observed. Would it be possible for restic to detect such a degraded repository? At least restic operates differently when using a corrupted or corrected repository.

To cut a long story short I think we can close this issue. I am sorry I wasted your time (and mine). If the problems return I will happily reopen the bug ;) And perhaps you can enhance the detection of a currupted repository.

@fd0
Copy link
Member

fd0 commented Oct 14, 2017

Ok, then we'll close this issue for now. Please feel free to add forther commands, and thanks for the feedback!

@fd0 fd0 closed this as completed Oct 14, 2017
@DottoreG
Copy link
Author

DottoreG commented Oct 18, 2017

I'm sorry I have to reopen the issue. [Since I'm not allowed to reopen the ticket, please fd0 do it for me. Thanks.] Today I started from scratch with

restic 0.7.1
compiled with go1.8.3 on linux/amd64

The backup of one directory yields:

scan [/home]
scanned 3925 directories, 96774 files in 0:03
[10:02] 100.00%  21.124 MiB/s  12.434 GiB / 12.434 GiB  100699 / 100699 items  0 errors  ETA 0:00 
duration: 10:02, 21.13MiB/s
snapshot 83f4dd19 saved
using parent snapshot 83f4dd19
scan [/home]
scanned 3925 directories, 96777 files in 0:02
[0:25] 100.00%  508.163 MiB/s  12.434 GiB / 12.434 GiB  100702 / 100702 items  0 errors  ETA 0:00 
duration: 0:25, 505.33MiB/s
snapshot ce0f6e03 saved

Everything looks ok, the second backup if performed as fast as expected. The backup of the second single directory is also successful:

scan [/]
scanned 30492 directories, 465570 files in 0:16
[18:58] 100.00%  54.035 MiB/s  60.050 GiB / 60.042 GiB  496061 / 496062 items  0 errors  ETA 0:00 
duration: 18:58, 54.00MiB/s
snapshot e00a3a19 saved
using parent snapshot e00a3a19
scan [/]
scanned 30492 directories, 465570 files in 0:13
[3:12] 100.00%  320.067 MiB/s  60.050 GiB / 60.050 GiB  496061 / 496062 items  0 errors  ETA 0:00 
duration: 3:12, 318.88MiB/s
snapshot a73f814b saved

But combining both directories in one backup is very slow and I can see that the source disk is read very heavily – not from the beginning but after 5 minutes or so:

scan [/ /home]
scanned 38335 directories, 659096 files in 0:25
[24:24] 100.00%  25.507 MiB/s  36.466 GiB / 36.466 GiB  697430 / 697431 items  0 errors  ETA 0:00 
duration: 24:24, 25.50MiB/s
snapshot da276d0a saved
using parent snapshot da276d0a
scan [/ /home]
scanned 38335 directories, 659096 files in 0:19
[12:13] 100.00%  50.943 MiB/s  36.466 GiB / 36.466 GiB  697430 / 697431 items  0 errors  ETA 0:00 
duration: 12:13, 50.94MiB/s
snapshot 6f750c44 saved
using parent snapshot 6f750c44
scan [/ /home]
scanned 38335 directories, 659096 files in 0:19
[12:19] 100.00%  50.569 MiB/s  36.495 GiB / 36.466 GiB  697430 / 697431 items  0 errors  ETA 0:00 
duration: 12:19, 50.52MiB/s
snapshot 68bbfdad saved

@fd0 fd0 reopened this Oct 18, 2017
@fd0
Copy link
Member

fd0 commented Oct 18, 2017

Hm, this is a new special case: / already contains /home. Hm. I've reopened the issue for now, there's something odd going on.

@DottoreG
Copy link
Author

No, sorry, I forgot to mention. Home is on a different partition.

@DottoreG
Copy link
Author

I just started to learn the programming language go and the source code of restic. I studied the source code and looked again at the log listed in one of the comments above. I wonder why restic reacts differently in the fast case and in the slow case. It's striking that in the slow case no output of the kind IsNewer or is not newer can be found. I my eyes this means that the function archiver.archiveJob.Copy() determines that hasOld is false (or that the file is not a regular file). But why?

And it just caught my eye that in my logs rows of the kind archiver.(*archivePipe).compare 65 old job: and archiver.(*archivePipe).compare 65 new job: normally name the same file. But then there are situations where old job iterates over consecutive files in a directory but new job is always a constant file in a different directory. This looks wrong to me. Perhaps there is some wrong/missing synchronisation?

What else can I do to analyse the situation?

@fd0
Copy link
Member

fd0 commented Oct 21, 2017

Thanks for having an in-depth look, I appreciate that! :)

I don't have any idea what you can do right now, and I'm sorry that the archiver code (which is the oldest part of restic) is so convoluted. I'm currently rewriting that part of restic.

I'll try to find time this weekend to have a look myself.

@fd0
Copy link
Member

fd0 commented Oct 21, 2017

I think I just reproduced the issue.

@fd0
Copy link
Member

fd0 commented Oct 21, 2017

Bleh, you've found a very interesting corner case, thanks for being persistent about it! The basic idea of the current archiver code is as follows:

  • Start workers in Goroutines that procude two sorted streams of file and directories (depth-first): (A) From the parent snapshot and (B) the files to be saved from the disc
  • Compare the streams file by file:
    • When the name matches, it was present before and is still present, so just compare if it has changed.
    • When the name does not match, check the order: itemA < itemB means itemB is new, itemA > itemB means itemA has been removed

What you observed comes from the (rather strange) restic behavior to only retain the last basedir of items (tracked in #549).

The special case here is that 1) the root fs is saved (/) and 2) another directory below the root is saved.

Let's say restic is called as follows: restic backup [...] / /home/foo, and / contains only /boot, /home and /usr.

Due to #549, a snapshot will then contain the following sorted top-level entries: boot, foo, home, usr. That's also the order which will be produced in the stream A above.

The archiver will, before attempting to traverse the directories to be saved, sort the list of directories by their basename, so that the order is correct. However, in this case the / needs to be replaced by its contents, and that doesn't happen. So for the stream B above, the following list of entries is produced: boot, home, usr (from the path /) and then foo (from /home/foo).

The matching logic above then does not work correctly and most files are read again. Meh.

So much for the description of the cause.

@pvgoran
Copy link

pvgoran commented Oct 21, 2017

itemA < itemB means itemB is new, itemA > itemB means itemA has been removed

Isn't it the other way around? As far as I understand, itemA < itemB means "itemA is not present in stream B".

@fd0
Copy link
Member

fd0 commented Oct 21, 2017

Yeah, that's possible. But you get the idea ;)

@DottoreG
Copy link
Author

Congratulations for finding the problem!
So is there anything I can do? I'm thinking about naming the directories to be backed up in a different way. What if I would not name / itself, would use /boot and /usr explicitly but exclude /home, and would name /home/foo. Would that be a temporary workaround?

I really don't want to urge you, but what are your plans for a corrected version of restic?

@fd0
Copy link
Member

fd0 commented Oct 22, 2017

So is there anything I can do? I'm thinking about naming the directories to be backed up in a different way. What if I would not name / itself, would use /boot and /usr explicitly but exclude /home, and would name /home/foo. Would that be a temporary workaround?

Yes, that works! I've just verified it. The culprit here is really the expansion of / into the subdirs of /, if you use /* instead it'll work correctly.

Can you try that and report back?

I'm currently rewriting the archiver code, this issue will be fixed there (in addition to #1290).

@DottoreG
Copy link
Author

Yes it works! It's astonishing how fast restic can be ;)

I'm eager to see the problem resolved. It is awkward that all the directories to be backed up are located in the root directory of the snapshot. So instead of seeing /home/foo in the resulting snapshot only foo is stored which lies besides e.g. bin. Restoring such a complete snapshot means to manually move these directories back to the original location.

@fd0
Copy link
Member

fd0 commented Oct 23, 2017

I fully agree, I'm currently reworking the archiver code (which turns out to be surprisingly hard).

@JPPhoto
Copy link

JPPhoto commented Nov 26, 2017

I, too, am experiencing these same performance issues with my backups of multiple paths under 0.7.3. I wonder if there's an issue with the logic of using a previous snapshot as a parent. It seems that a tuple <host, fullpath> could be used to uniquely identify a file's metadata (size, mtime, snapshots, etc.) and that in turn could be used to determine whether a file should be re-read. Does using a parent snapshot buy you something special over keeping track of individual files and the snapshots they appear in?

@fd0
Copy link
Member

fd0 commented Nov 26, 2017

In order to find something within the repo, we need to have an anchor point. In the current implementation, that's the parent snapshot, and I agree the implementation is not the best. I'm already working on a new one.

If you want to understand how the data structures look like and what's stored in the repo, I recommend having a look at the repo specification, here: https://restic.readthedocs.io/en/latest/100_references.html#design

@JPPhoto
Copy link

JPPhoto commented Nov 26, 2017

I should also say that, as I think was mentioned above, if I split up my backup instead of having multiple paths stored as a single snapshot AND if I use appropriate parent snapshots, backups happen rather quickly. So for now, I plan on doing that.

@fd0
Copy link
Member

fd0 commented May 26, 2018

This issue is resolved with the new archiver code contained in 0.9.0 (PR #1494), so I'm closing this issue for now. Please feel free to add further comments. Thanks!

@fd0 fd0 closed this as completed May 26, 2018
@fd0 fd0 added state: need implementing cause/request established, need work/solution and removed help: wanted labels May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: need implementing cause/request established, need work/solution type: bug
Projects
None yet
Development

No branches or pull requests

4 participants