This commit is contained in:
https://launchpad.net/~giomasce 2015-05-23 14:35:14 +00:00 committed by admin
parent 6a59c628cc
commit 7fa8e6a284

View file

@ -0,0 +1,103 @@
### Please describe the problem.
Incremental fsck keeps information about which time a file was last fsck-ed by setting mtime of the file's parent directory in `.git/annex/objects/`. When we are doing incremental fsck from a remote, files that are not available locally are never marked as checked (since said directory does not exist), so they are checked at every invocation of `git annex fsck --more`.
### What steps will reproduce the problem?
Create a git-annex repository with some random content. Then add any remote, copy files there, remove them locally and run an incremental fsck from the remote. Interrupt it and run again with `--more`. It will check again all the files, including those that have already been checked.
### What version of git-annex are you using? On what operating system?
Debian official package, 5.20141125, on Debian sid (more or less up-to-date).
### Please provide any additional information below.
[[!format sh """
# Create a test repository
giovanni@amalgama:~$ cd /tmp/
giovanni@amalgama:/tmp$ mkdir test
giovanni@amalgama:/tmp$ cd test/
giovanni@amalgama:/tmp/test$ git init
Inizializzato un repository Git in /tmp/test/.git/
giovanni@amalgama:/tmp/test (master)$ git annex init
init ok
(Recording state in git...)
# Create random content
giovanni@amalgama:/tmp/test (master)$ dd if=/dev/urandom bs=1M count=20 of=test1
20+0 record dentro
20+0 record fuori
20971520 byte (21 MB) copiati, 1,15928 s, 18,1 MB/s
giovanni@amalgama:/tmp/test (master)$ dd if=/dev/urandom bs=1M count=20 of=test2
20+0 record dentro
20+0 record fuori
20971520 byte (21 MB) copiati, 1,12974 s, 18,6 MB/s
giovanni@amalgama:/tmp/test (master)$ dd if=/dev/urandom bs=1M count=20 of=test3
20+0 record dentro
20+0 record fuori
20971520 byte (21 MB) copiati, 1,16881 s, 17,9 MB/s
giovanni@amalgama:/tmp/test (master)$ dd if=/dev/urandom bs=1M count=20 of=test4
20+0 record dentro
20+0 record fuori
20971520 byte (21 MB) copiati, 1,14387 s, 18,3 MB/s
giovanni@amalgama:/tmp/test (master)$ git annex add .
add test1 ok
add test2 ok
add test3 ok
add test4 ok
(Recording state in git...)
# Create a remote of type directory and move content there
giovanni@amalgama:/tmp/test (master)$ mkdir /tmp/dir
giovanni@amalgama:/tmp/test (master)$ git annex initremote test type=directory encryption=none directory=/tmp/dir
initremote test ok
(Recording state in git...)
giovanni@amalgama:/tmp/test (master)$ git annex move --to test
move test1 (to test...)
ok
move test2 (to test...)
ok
move test3 (to test...)
ok
move test4 (to test...)
ok
(Recording state in git...)
# Launch a remote incremental fsck
giovanni@amalgama:/tmp/test (master)$ git annex fsck --from test --incremental
fsck test1 (checksum...)
ok
fsck test2 (checksum...)
ok
fsck test3 (checksum...)
ok
fsck test4 (checksum...)
ok
# Continue it; here I would expect nothing to happen, since all content has already been checked
giovanni@amalgama:/tmp/test (master)$ git annex fsck --from test --more
fsck test1 (checksum...)
ok
fsck test2 (checksum...)
ok
fsck test3 (checksum...)
ok
fsck test4 (checksum...)
ok
# Bring back content locally and launch again fsck
giovanni@amalgama:/tmp/test (master)$ git annex get
get test1 (from test...)
ok
get test2 (from test...)
ok
get test3 (from test...)
ok
get test4 (from test...)
ok
(Recording state in git...)
giovanni@amalgama:/tmp/test (master)$ git annex fsck --from test --incremental
fsck test1 (checksum...)
ok
fsck test2 (checksum...)
ok
fsck test3 (checksum...)
ok
fsck test4 (checksum...)
ok
# Now --more semantics is respected
giovanni@amalgama:/tmp/test (master)$ git annex fsck --from test --more
giovanni@amalgama:/tmp/test (master)$
"""]]