Commit graph

41489 commits

Author SHA1 Message Date
Joey Hess
2cb7914699
commeent 2022-01-19 11:56:00 -04:00
Joey Hess
fb11ffe594
Merge branch 'master' of ssh://git-annex.branchable.com 2022-01-19 11:51:11 -04:00
Joey Hess
1723d4e88a
close 2022-01-19 11:49:37 -04:00
ainohzoa
b08fb6fec4 Added a comment: Now it's working normally again 2022-01-14 21:10:13 +00:00
https://christian.amsuess.com/chrysn
34e3823602 Added a comment: nested git repositories are git submodules 2022-01-14 13:02:37 +00:00
ainohzoa
e17c155f18 2022-01-14 00:37:24 +00:00
Joey Hess
538d02d397
delete content lock file safely after shared lock
Upgrade the shared lock to an exclusive lock, and then delete the
lock file. If there is another process still holding the shared lock,
the first process will fail taking the exclusive lock, and not delete
the lock file; then the other process will later delete it.

Note that, in the time period where the exclusive lock is held, other
attempts to lock the content in place would fail. This is unlikely to be
a problem since it's a short period.

Other attempts to lock the content for removal would also fail in that
time period, but that's no different than a removal failing because
content is locked to prevent removal.

Sponsored-by: Dartmouth College's Datalad project
2022-01-13 14:54:57 -04:00
Joey Hess
86e5ffe34a
clean empty object directories after deleting content lock file
When dropping content, this was already done after deleting the content
file, but the lock file prevents deleting the directories. So, try the
deletion again.

This does mean there's a small added overhead of a failed rmdir().

Sponsored-by: Dartmouth College's Datalad project
2022-01-13 14:22:37 -04:00
Lukey
c6c7f7b444 Added a comment 2022-01-13 18:19:32 +00:00
Joey Hess
e28d1d0325
fix logic that was not inverted after all
oops
2022-01-13 14:11:36 -04:00
Lukey
1c0e04c83c Added a comment 2022-01-13 18:10:22 +00:00
Lukey
06e3431348 2022-01-13 18:08:25 +00:00
Joey Hess
a3b6b3499b
delete content lock file safely on drop, keep after shared lock
This seems to be the best that can be done to avoid forever accumulating
the new content lock files, while being fully safe.

This is fixing code paths that have lingered unused since direct mode!
And direct mode seems to have been buggy in this area, since the content
lock file was deleted on unlock. But with a shared lock, there could be
another process that also had the lock file locked, and deleting it
invalidates that lock.

So, the lock file cannot be deleted after a shared lock. At least, not
wihout taking an exclusive lock first.. which I have not pursued yet but may.

After an exclusive lock, the lock file can be deleted. But there is
still a potential race, where the exclusive lock is held, and another
process gets the file open, just as the exclusive lock is dropped and
the lock file is deleted. That other process would be left with a file
handle it can take a shared lock of, but with no effect since the file
is deleted. Annex.Transfer also deletes lock files, and deals with this
same problem by using checkSaneLock, which is how I've dealt with it
here.

Sponsored-by: Dartmouth College's Datalad project
2022-01-13 13:58:58 -04:00
Joey Hess
3d7933f124
fix inverted logic
Now the content lock files are used in v9. However, I am not yet certian
they are correct. In particular, lockContentUsing deletes
the content lock file on unlock. But what if there's a shared lock
by another process? That seems like it would discard that lock too!

(Windows seems like it would not have the same problem, because as the
comment in there says, "Can't delete a locked file on Windows".
So if another process has a shared lock, removing it presumably fails.)

Sponsored-by: Dartmouth College's Datalad project
2022-01-13 13:58:31 -04:00
Joey Hess
731b1ecf87
v9 upgrade implemented
Seems to work ok. Unsure yet about the actual locking changes being
correct.

This is not the end of the story with upgrades, because it is unsafe for
this upgrade as implemented to run in a repository where an old
git-annex process is already running. The old process would use the old
locking method, and not notice files locked by the new, and this could
result in data loss. This problem will need to be dealt with before this
branch is suitable for merging.

Sponsored-by: Dartmouth College's Datalad project
2022-01-13 13:25:10 -04:00
Joey Hess
3936599885
move code from Command.Fsck
Sponsored-by: Dartmouth College's Datalad project
2022-01-13 13:24:50 -04:00
beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec
b15ac53967 2022-01-13 03:59:44 +00:00
Joey Hess
b2f3928971
Merge branch 'master' of ssh://git-annex.branchable.com 2022-01-12 15:55:31 -04:00
Joey Hess
8add0ec60e
liking this solution pretty well 2022-01-12 15:54:58 -04:00
yarikoptic
6b435719a0 Added a comment 2022-01-12 19:33:16 +00:00
Joey Hess
0ba7f2ec91
so close 2022-01-12 15:25:35 -04:00
Joey Hess
63851bfec4
complication 2022-01-12 13:19:06 -04:00
anarcat
658a896869 2022-01-12 16:24:17 +00:00
anarcat
3993421d36 Added a comment: indeed. 2022-01-12 15:56:25 +00:00
Joey Hess
d427afb347
v9-locking branch still wip 2022-01-11 17:04:25 -04:00
Joey Hess
3c042606c2
use separate lock from content file in v9
Windows has always used a separate lock file, but on unix, the content
file itself was locked, and in v9 that changes to also use a separate
lock file.

This needs to be tested more. Eg, what happens after dropping a file;
does the the content lock file get deleted too, or linger around?

Sponsored-by: Dartmouth College's Datalad project
2022-01-11 17:03:14 -04:00
Joey Hess
43f9d967ff
shared repository content file permissions for v9
v9 will not need to write to annex content files in order to lock them,
so freezeContent removes the write bit in a shared repository, the same
as in any other repository.

checkContentWritePerm makes sure that the write perm is not set, which
will let git-annex fsck fix up the permissions. Upgrading to v9
will need to fix the permissions as well, but it seems likely there will
be situations where the user git-annex is running an upgrade as cannot,
so it will have to leave the write bit set. In such a case, git-annex
fsck can fix it later.

Sponsored-by: Dartmouth College's Datalad project
2022-01-11 16:50:50 -04:00
Joey Hess
ff570ad363
add v9 annex.version, not yet the default
This is the start of v9, but it's currently identical to v8, and v8 is
not upgraded to it. git-annex upgrade will upgrade to v9 with this
change.

Sponsored-by: Dartmouth College's Datalad project
2022-01-11 14:59:39 -04:00
mih
9104e64d3e Added a comment: Thanks! 2022-01-11 18:59:36 +00:00
Joey Hess
029820c832
v9-locking branch 2022-01-11 14:49:21 -04:00
Joey Hess
f1e5a42392
followup and close 2022-01-11 13:28:13 -04:00
Joey Hess
a12f3f58ab
comment 2022-01-11 13:07:51 -04:00
Joey Hess
f54c58f0df
Avoid crashing when run in a bare git repo that somehow contains an index file
Do not populate the keys database with associated files,
because a bare repo has no working tree, and so it does not make sense to
populate it.

Queries of associated files in the keys database always return empty lists
in a bare repo, even if it's somehow populated. One way it could be
populated is if a user converts a non-bare repo to a bare repo.

Note that Git.Config.isBare does a string comparison, so this is not free!
But, that string comparison is very small compared to a sqlite query.

Sponsored-by: Erik Bjäreholt on Patreon
2022-01-11 13:01:49 -04:00
Joey Hess
c031d19c32
Merge branch 'master' of ssh://git-annex.branchable.com 2022-01-11 12:25:12 -04:00
Joey Hess
8ae88923b8
moreinfo 2022-01-11 12:24:40 -04:00
mih
da71a52b12 2022-01-11 12:54:35 +00:00
Joey Hess
525473aa5a
adb: Added ignorefinderror configuration parameter
On a phone with Calyxos, adb find in /sdcard complains:

find: ./Android/data/com.android.providers.downloads.ui: Permission denied

But otherwise works, so this option makes import and export work ok, except
for that one app's data.

Sponsored-by: Graham Spencer
2022-01-10 21:17:00 -04:00
lell
a55fc567c3 removed 2022-01-10 08:34:19 +00:00
lell
31e52a08d2 Added a comment 2022-01-10 08:33:47 +00:00
lell
29088d78f3 2022-01-10 08:31:48 +00:00
aaron
91329eaf93 Added a comment 2022-01-09 08:36:34 +00:00
tomdhunt
d8ad2d8889 Added a comment 2022-01-09 05:45:35 +00:00
aaron
4b548efca2 Added a comment: How does the gcrypt type compare to the rsync special remote 2022-01-09 05:31:35 +00:00
aaron
dd6f6519df Added a comment: Not auto-signing commits with webapp (and possible assistant) 2022-01-09 04:29:26 +00:00
amerlyq
46abc97d32 Added a comment 2022-01-08 14:32:12 +00:00
amerlyq
af64183932 Added a comment 2022-01-08 14:15:55 +00:00
Yaroslav Halchenko
00a917d2d2
Update standalone patch for changes in debian/control text description 2022-01-07 17:24:50 -04:00
Joey Hess
e95747a149
fix handling of corrupted data received from git remote
Recover from corrupted content being received from a git remote due eg to a
wire error, by deleting the temporary file when it fails to verify. This
prevents a retry from failing again.

Reversion introduced in version 8.20210903, when incremental verification
was added.

Only the git remote seems to be affected, although it is certianly
possible that other remotes could later have the same issue. This only
affects things passed to getViaTmp that return (False, UnVerified) due to
verification failing. As far as getViaTmp can tell, that could just as well
mean that the transfer failed in a way that would resume, so it cannot
delete the temp file itself. Remote.Git and P2P.Annex use getViaTmp internally,
while other remotes do not, which is why only it seems affected.

A better fix perhaps would be to improve the types of the callback
passed to getViaTmp, so that some other value could be used to indicate
the state where the transfer succeeded but verification failed.

Sponsored-by: Boyd Stephen Smith Jr.
2022-01-07 13:25:33 -04:00
Joey Hess
21c0d5be6e
comment 2022-01-07 12:27:19 -04:00
Joey Hess
022e63cdde
comment 2022-01-07 12:08:19 -04:00