Commit graph

42343 commits

Author SHA1 Message Date
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
a7e3e9d0c9 Added a comment 2022-09-24 19:43:47 +00:00
dukeofcool199
a887de360b 2022-09-24 19:24:19 +00:00
dukeofcool199
3a3e17cee5 2022-09-24 19:21:09 +00:00
Joey Hess
2478e9e03a
restage: New git-annex command, handles restaging unlocked files
This is much easier and less failure-prone than having the user run
git update-index --refresh themselves.

Sponsored-by: Dartmouth College's DANDI project
2022-09-23 16:29:59 -04:00
Joey Hess
f7146c153b
fix restaging of transferred files after stalldetection kicks in
Sponsored-by: Dartmouth College's DANDI project
2022-09-23 15:55:40 -04:00
Joey Hess
6a3bd283b8
add restage log
When pointer files need to be restaged, they're first written to the
log, and then when the restage operation runs, it reads the log. This
way, if the git-annex process is interrupted before it can do the
restaging, a later git-annex process can do it.

Currently, this lets a git-annex get/drop command be interrupted and
then re-ran, and as long as it gets/drops additional files, it will
clean up after the interrupted command. But more changes are
needed to make it easier to restage after an interrupted process.

Kept using the git queue to run the restage action, even though the
list of files that it builds up for that action is not actually used by
the action. This could perhaps be simplified to make restaging a cleanup
action that gets registered, rather than using the git queue for it. But
I wasn't sure if that would cause visible behavior changes, when eg
dropping a large number of files, currently the git queue flushes
periodically, and so it restages incrementally, rather than all at the
end.

In restagePointerFiles, it reads the restage log twice, once to get
the number of files and size, and a second time to process it.
This seemed better than reading the whole file into memory, since
potentially a huge number of files could be in there. Probably the OS
will cache the file in memory and there will not be much performance
impact. It might be better to keep running tallies in another file
though. But updating that atomically with the log seems hard.

Also note that it's possible for calcRestageLog to see a different file
than streamRestageLog does. More files may be added to the log in
between. That is ok, it will only cause the filterprocessfaster heuristic to
operate with slightly out of date information, so it may make the wrong
choice for the files that got added and be a little slower than ideal.

Sponsored-by: Dartmouth College's DANDI project
2022-09-23 15:47:24 -04:00
Joey Hess
9c76e503cf
generalize refreshIndex to MonadIO
Sponsored-by: Dartmouth College's DANDI project
2022-09-23 14:28:52 -04:00
Joey Hess
b17e328175
avoid unncessary locking by checkLogFile
Like the comment says, this works without locking. It looks like I
originally copied another function and forgot to remove the locking.

Sponsored-by: Dartmouth College's DANDI project
2022-09-23 14:01:43 -04:00
Joey Hess
ed8afacc39
add a finalizer to streamLogFile
Sponsored-by: Dartmouth College's DANDI project
2022-09-23 13:49:01 -04:00
Joey Hess
8718125ae4
refactor the restage runner
Sponsored-by: Dartmouth College's DANDI project
2022-09-23 13:12:17 -04:00
nick.guenther@e418ed3c763dff37995c2ed5da4232a7c6cee0a9
4822121728 Added a comment 2022-09-23 01:40:56 +00:00
Joey Hess
f64eff9355
test: Added --test-with-git-config option
Sponsored-by: Dartmouth College's DANDI project
2022-09-22 15:58:45 -04:00
Joey Hess
d049228fd3
comment and todo 2022-09-22 14:48:32 -04:00
Joey Hess
0139a732fe
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-22 14:40:29 -04:00
Joey Hess
6e3c9bea2e
drain transferrer read handle when shutting it down
Fixes updating git index file after getting an unlocked file when
annex.stalldetection is set.

The transferrer may want to send additional protocol messages when it's
shut down. Closing the read handle prevented it from doing that, and caused
it to crash rather than cleanly shutting down.

Draining the handle without processing the protocol seemed ok to do,
because anything it outputs is going to be some side message displayed
at shutdown. Displaying those once per transferrer process that is running
seems unncessary.

Sponsored-by: Dartmouth College's DANDI project
2022-09-22 14:39:39 -04:00
yarikoptic
ea4a466b8b Added a comment 2022-09-22 18:14:15 +00:00
Joey Hess
f015f3e8e3
comment 2022-09-22 14:03:31 -04:00
Joey Hess
5ed774b701
comment 2022-09-22 13:40:13 -04:00
Joey Hess
72cdbd01f4
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-22 13:37:26 -04:00
Joey Hess
368ad64160
correct my comment 2022-09-22 13:37:01 -04:00
yarikoptic
2415c8f8b9 Added a comment 2022-09-22 17:34:35 +00:00
Joey Hess
05a86976ec
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-22 13:25:12 -04:00
Joey Hess
3f2bbae4cb
reproduced this now 2022-09-22 13:25:02 -04:00
Joey Hess
60304c0321
reproduced this now 2022-09-22 13:21:10 -04:00
Joey Hess
a9355e74a3
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-22 12:59:53 -04:00
Joey Hess
66bd4f80b3
Improved handling of --time-limit when combined with -J
When concurrency is enabled, there can be worker threads still running
when the time limit is checked. Exiting right there does not
give those threads time to finish what they're doing. Instead, the seeking
is wrapped up, and git-annex then shuts down cleanly.

The whole point of --time-limit existing, rather than using timeout(1)
when running git-annex is to let git-annex finish the action(s) it is
working on when the time limit is reached, and shut down cleanly.

I noticed this problem when investigating why restagePointerFile might
not have run after get/drop of an unlocked file. With --time-limit -J,
a worker thread may have finished updating a work tree file, and be killed
by the time limit check before it can run restagePointerFile. So despite
--time-limit running the shutdown actions, the work tree file didn't get
restaged.

Sponsored-by: Dartmouth College's DANDI project
2022-09-22 12:54:52 -04:00
nobodyinperson
75adb198a1 Added a comment 2022-09-22 06:24:05 +00:00
rinomizu5@5ead4c82685c65d7717dbd5591b80425036ae9e3
c44df3fdf5 removed 2022-09-22 05:08:59 +00:00
jgoerzen
63f8b78e29 Added a comment 2022-09-22 03:40:04 +00:00
yarikoptic
79fa55ce88 Added a comment 2022-09-22 01:33:24 +00:00
yarikoptic
f75641f9f6 Added a comment 2022-09-22 01:03:18 +00:00
Gus
28e71d46e4 Added a comment 2022-09-21 22:30:20 +00:00
Joey Hess
6f0566d704
comment 2022-09-21 18:17:21 -04:00
Joey Hess
2731e3ab38
wording 2022-09-21 16:13:08 -04:00
Joey Hess
05592a2ddb
comment 2022-09-21 16:11:10 -04:00
Joey Hess
af9875765c
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-21 15:17:56 -04:00
Joey Hess
34e313f786
annex.diskreserve default increased from 1 mb to 100 mb
It's hard to know what's a good default for this. But 1 mb seems way too
small, because it's very easy for a git pull or some similar operation
that we don't think of as using much space to use up 1 mb of space.

Most people would want to free up some space if a filesystem only had 100
mb free. But on a small VPS, it's probably not uncommon to have only 1 gb
free. So 1 gb is too large for annex.diskreserve.

While old 1 gb USB keys are around, it's unlikely that anyone is
relying on them to shuttle annex data around; it would be worth anyone's
time to upgrade to a 32 gb or larger cheap modern USB key ($5).

Sponsored-by: Kevin Mueller on Patreon
2022-09-21 15:00:13 -04:00
yarikoptic
ad31c9fc19 Added a comment 2022-09-21 18:49:07 +00:00
yarikoptic
65cd69217c Added a comment 2022-09-21 18:46:50 +00:00
Joey Hess
94216c99a7
comment and todo 2022-09-21 14:32:42 -04:00
Joey Hess
d330c83e2c
comment 2022-09-21 13:42:20 -04:00
Joey Hess
2f16ff8cdc
comment 2022-09-21 13:17:21 -04:00
Joey Hess
90da0a5e59
comment 2022-09-21 13:04:47 -04:00
Joey Hess
b072410e06
Merge branch 'master' of ssh://git-annex.branchable.com 2022-09-21 10:41:12 -04:00
rinomizu5@5ead4c82685c65d7717dbd5591b80425036ae9e3
ef61e117aa Added a comment: "not inbackend=URL" is failed with parse error 2022-09-21 07:04:55 +00:00
rinomizu5@5ead4c82685c65d7717dbd5591b80425036ae9e3
cae26503f3 Added a comment: "not inbackend=URL" is failed with parse error 2022-09-21 07:04:35 +00:00
yarikoptic
f3a99db14b Added a comment 2022-09-20 22:50:46 +00:00
yarikoptic
f967316f31 initial report on odd "modified" status 2022-09-20 22:22:42 +00:00
nick.guenther@e418ed3c763dff37995c2ed5da4232a7c6cee0a9
675f9db76e 2022-09-20 22:16:55 +00:00
Gus
bccc441d9c Added a comment 2022-09-20 22:07:30 +00:00