Commit graph

32394 commits

Author SHA1 Message Date
Joey Hess
50fa17aee6
v6: recover from race between git mv and git-annex get/drop
Update pointer file next time reconcileStaged is run to recover from the
race.

Note that restagePointerFile causes git to run the clean filter,
and that will run reconcileStaged. So, normally by the time the git
annex get/drop command finishes, the race has already been dealt with.
It may be that, in some case, that won't happen and the race will be
dealt with at a later point. git-annex could run reconcileStaged at
shutdown if that becomes a problem.

This does not handle the situation where the git mv is committed before
git-annex gets a chance to run again. git commit does run the clean
filter, and that happens to re-inject the content if it was supposed to
be dropped but is still populated. But, the case where the file was
supposed to be gotten but is not populated is not handled yet.

This commit was supported by the NSF-funded DataLad project.
2018-08-22 15:56:43 -04:00
Joey Hess
9ff1c62a4d
fix race
If a pointer file is being populated and something modifies it at the
same time, there was a race there the modified file's InodeCache
could get added into the keys database.

Note that replaceFile normally renames the temp file into place, so the
inode cache caculated for the temp file will still be good. If it has to
fall back to a copy, the worktree file won't be put in the inode cache.
This has the same result as if the worktree file gets touched, and will
be handled the same way. Eg, when dropping, isUnmodified will do an
expensive comparison and notice that the worktree file does have the
same content, and so drop it.

This commit was supported by the NSF-funded DataLad project.
2018-08-22 15:22:52 -04:00
Joey Hess
e094cf3377
split out modules from Annex.Content 2018-08-22 14:45:53 -04:00
Joey Hess
e9b2674281
plan 2018-08-22 13:58:32 -04:00
Joey Hess
38a934cf07
correction 2018-08-22 13:34:15 -04:00
Joey Hess
18ecf41917
avoid running reconcileStaged when the index has not changed
This commit was supported by the NSF-funded DataLad project.
2018-08-22 13:04:12 -04:00
rajagopal.abhejit@a18fbb434d26431ed70e7fad7bd6a696df2b7d85
65bd018f94 removed 2018-08-22 01:13:45 +00:00
rajagopal.abhejit@a18fbb434d26431ed70e7fad7bd6a696df2b7d85
529b84c5ca removed 2018-08-22 01:11:08 +00:00
rajagopal.abhejit@a18fbb434d26431ed70e7fad7bd6a696df2b7d85
7d0b838153 Added a comment 2018-08-22 01:10:54 +00:00
rajagopal.abhejit@a18fbb434d26431ed70e7fad7bd6a696df2b7d85
0b8759771a Added a comment 2018-08-22 01:10:40 +00:00
andrew@d9c20810619d89ecb4d8ebe187df122112b82fd9
fb5b2f1b7f Added a comment: Not connect to remote as part of initremote? 2018-08-21 23:34:55 +00:00
Joey Hess
5f31aba047
Merge branch 'master' of ssh://git-annex.branchable.com 2018-08-21 17:08:09 -04:00
Joey Hess
cff8eb430d
devblog 2018-08-21 17:07:46 -04:00
Joey Hess
5e56d9b620
v6: Update associated files database when git has staged changes to pointer files
This commit was supported by the NSF-funded DataLad project.
2018-08-21 17:02:20 -04:00
yarikoptic
78ecd6b17a Added a comment 2018-08-21 16:23:05 +00:00
yarikoptic
dae76d8ef3 fixup the trailer 2018-08-21 16:02:25 +00:00
Joey Hess
056b081280
followup 2018-08-21 11:56:51 -04:00
yarikoptic
e009c0efed original filing about web remote listing 2018-08-21 15:09:10 +00:00
Joey Hess
7ee3b02d49
replace stack trace with an explanation 2018-08-20 21:26:07 -04:00
Joey Hess
b8cd5fde17
idea 2018-08-20 16:13:46 -04:00
Joey Hess
c7331eebbf
Merge branch 'master' of ssh://git-annex.branchable.com 2018-08-20 12:21:11 -04:00
Joey Hess
fa44bca8b3
linux standalone: When LOCPATH is already set, use it instead of the bundled locales.
It can be set to an empty string to use the system locales too. Of course
whether that will work depends on the amount of divergence.

This commit was supported by the NSF-funded DataLad project.
2018-08-20 12:20:54 -04:00
emanuele.olivetti@47d88ed185b03191e25329caa6fabc2efb3118b2
f8b4a1f70c 2018-08-20 15:54:11 +00:00
Gus
48fb6f9886 2018-08-17 22:16:45 +00:00
https://launchpad.net/~liori
5d0c336994 Added a comment 2018-08-17 21:58:03 +00:00
Gus
d1eabddee6 2018-08-17 21:44:05 +00:00
Joey Hess
085338a29d
response 2018-08-17 16:18:50 -04:00
Joey Hess
9091d52a1f
close old openbsd build bugs 2018-08-17 16:18:40 -04:00
Joey Hess
59b2ebbaeb
Merge branch 'master' of ssh://git-annex.branchable.com 2018-08-17 16:04:55 -04:00
Joey Hess
ab14d7cd9f
devblog 2018-08-17 16:04:30 -04:00
Joey Hess
54d49eeac8
avoid update-index race
This commit was supported by the NSF-funded DataLad project.
2018-08-17 16:03:40 -04:00
Joey Hess
82c5dd8a01
queueing of internal IO actions on files
This would be better if getInternalFiles were
more polymorphic, but I can't see a good
way to accomplish that without messing with Data.Typeable,
which seemed like overkill.

Reverted CommandAction back to the simpler version.

This commit was sponsored by Eric Drechsel on Patreon.
2018-08-17 13:28:21 -04:00
Joey Hess
c5a8abb130
comment 2018-08-17 13:19:37 -04:00
Joey Hess
ec91b6e4b2
plan to fix race 2018-08-17 11:18:53 -04:00
Joey Hess
35e1697377
expand 2018-08-17 10:48:18 -04:00
spwhitton
8a15ee0303 Added a comment 2018-08-17 14:44:13 +00:00
bnyn
127dc50898 2018-08-17 01:18:51 +00:00
Joey Hess
2e153de34a
close 2018-08-16 16:41:08 -04:00
Joey Hess
9eb708a11c
Merge branch 'master' of ssh://git-annex.branchable.com 2018-08-16 16:39:08 -04:00
Joey Hess
b187bc9cc6
devblog 2018-08-16 16:38:01 -04:00
Joey Hess
5799d325f0
update todo categories 2018-08-16 16:36:47 -04:00
Joey Hess
0f25d48639
pass absolute path to update-index
Test suite found a case where this is necessary.

And the man page says this, although current behavior is not as
documented..

           Note that files beginning with .  are discarded.
           This includes ./file and dir/./file. If you don’t want
           this, then use cleaner names.

This may hit path length limits on Windows. shrug

This commit was supported by the NSF-funded DataLad project.
2018-08-16 16:00:29 -04:00
Joey Hess
82a239675f
narrow the race where a file gets modified before update-index
Check just before running update-index if the worktree file's content is
still the same, don't update it when it's been modified. This narrows
the race window a lot, from possibly minutes or hours, to seconds or
less.

(Use replaceFile so that the worktree update happens atomically,
allowing the InodeCache of the new worktree file to itself be gathered
w/o any other race.)

This doesn't eliminate the race; it can still occur in the window before
update-index runs. When annex.queue is large, a lot of files will be
statted by the checks, and so the window may still be large enough to be a
problem.

When only a few files are being processed, the window is as small as it
is in the race where a modification gets overwritten by git-annex when
it updates the worktree. Or maybe as small as whatever race git
checkout/pull/merge may have when the worktree gets modified during it.
Still, I've kept a todo about this race.

This commit was supported by the NSF-funded DataLad project.
2018-08-16 15:56:43 -04:00
Joey Hess
6a445dc086
support conditionally excluding queued files
Switched code to use a for loop to avoid a filterM that would have
doubled the memory used.

This commit was supported by the NSF-funded DataLad project.
2018-08-16 14:38:37 -04:00
Joey Hess
82cfcfc838
better index file refresh method
Use git update-index --refresh, since it's a little bit more
efficient and the user can be told to run it if a locked index prevents
git-annex from running it.

This also fixes the problem where an annexed file was deleted in the index
and a get of another file that uses the same key caused the index update to
add back the deleted file. update-index will not add back the deleted file.

Documented in tips/unlocked_files.mdwn the gotcha that the index update
may conflict with other operations. I can't see any way to possibly avoid
that conflict.

One new todo about a race that causes a modification to be accidentially
staged.

Note that the assistant only flushes the git command queue when it
commits a modification. I have not tested the assistant with v6 unlocked
files, but assume most users of the assistant won't care if the index
shows a file as modified for a while.

This commit was supported by the NSF-funded DataLad project.
2018-08-16 14:16:24 -04:00
duncan_bayne
7e9d6c4ef1 Added a comment: RTFM 2018-08-16 04:25:27 +00:00
Joey Hess
5e87389f40
refactor 2018-08-15 13:46:28 -04:00
Joey Hess
4c5a9965c1
remove invalid todo item
I tested it, and it's ok. I think I was adding it under a filename that
produced a different key.
2018-08-15 13:34:48 -04:00
Joey Hess
24ed323208
response 2018-08-15 11:43:50 -04:00
https://launchpad.net/~liori
a6927da198 2018-08-15 14:07:31 +00:00