summaryrefslogtreecommitdiff
path: root/doc/bugs/incremental_fsck-ing_a_remote_does_not_work_for_files_that_are_not_present_in_current_repository.mdwn
blob: 3b53866e3fc49084282a37538d0a1c9e93fa090d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
### 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)$
"""]]

> [[done]] --[[Joey]]