Joey Hess [Tue, 22 Dec 2020 18:06:40 +0000 (14:06 -0400)]
avoid borg list of archives that have been listed before
This makes sync a lot faster in the common case where there's no new
backup.
There's still room for it to be faster. Currently the old imported tree
has to be traversed, to generate the ImportableContents. Which then
gets turned around to generate the new imported tree, which is
identical. So, it would be possible to just return a "no new imports",
or an ImportableContents that has a way to graft in a tree. The latter
is probably too far to go to optimise this, unless other things need it.
The former might be worth it, but it's already pretty fast, since git
ls-tree is pretty fast.
Joey Hess [Tue, 22 Dec 2020 16:00:11 +0000 (12:00 -0400)]
improve storage of redundant ContentIdentifiers
When a ContentIdentifier is already recorded, don't add it to the log
again, and avoid updating the log.
Joey Hess [Tue, 22 Dec 2020 15:53:00 +0000 (11:53 -0400)]
include borg archive name in tree, use empty ContentIdentifier
It's unusual to use a ContentIdentifier that is not semi-unique
for different contents. Note that in importKeys, it checks if a content
identifier is one that's known before, to avoid downloading the same
content twice. But that's done in a code path not used for borg repos,
because they are thirdpartypopulated.
Joey Hess [Tue, 22 Dec 2020 15:23:00 +0000 (11:23 -0400)]
notes on ImportableContents history not being used for retrieval
Joey Hess [Mon, 21 Dec 2020 20:20:58 +0000 (16:20 -0400)]
import from borg is basically working
Still some issues to deal with, see TODO and XXX.
Here's what gets logged, for each key:
cid log:
1608582045.832799227s
6720ebad-b20e-4460-a8f2-
2477361aea75 !MjAyMC0xMi0yMVQxMTozMzoxNw==:!MjAyMC0xMi0yMVQxMzowNzoyNg==
The "!Mj" are base64 encoded borg archive names, since mine were
dates and contained some characters not allowed in cid logs unescaped.
There were archives that each contained the key. This list will grow as
more borg backups are done and learned about.
tree generated:
120000 blob
5ef6a4615c084819b44cd4e3a31657664ddf643b x/dotgit/annex/objects/06/mv/SHA256E-s30--
a5d8532e64ec28f5491e25e7a6c1cb68f80507c1be6c1b35f8ec53d25413e5da/SHA256E-s30--
a5d8532e64ec28f5491e25e7a6c1cb68f80507c1be6c1b35f8ec53d25413e5da
120000 blob
063a139d3021c8db60f5c576d29fada2b824d91c x/dotgit/annex/objects/72/PP/SHA256E-s30--
e80b09a854b4e4d99a76caaa6983b34272480e0b4fdb95d04234a54b4849b893/SHA256E-s30--
e80b09a854b4e4d99a76caaa6983b34272480e0b4fdb95d04234a54b4849b893
120000 blob
b53b54916fd6abf21fedf796deca08d5ac7a75af x/dotgit/annex/objects/Ww/pk/SHA256E-s30--
6aac072a8ebf02a5807c4f15e77ed585a6c87b3b333ba625a3c8d6b4dc50a9f2/SHA256E-s30--
6aac072a8ebf02a5807c4f15e77ed585a6c87b3b333ba625a3c8d6b4dc50a9f2
This commit was sponsored by Denis Dzyubenko on Patreon.
Joey Hess [Mon, 21 Dec 2020 20:03:27 +0000 (16:03 -0400)]
improve thirdpartypopulated support
May actually work now.
Note that, importKey now has to add the size to the key if it's supposed
to have size. Remote.Directory relied on the importer adding the size,
which is no longer done, so it was changed; it was the only one.
This way, importKey does not need to behave differently between regular
and thirdpartypopulated imports.
Joey Hess [Mon, 21 Dec 2020 17:46:04 +0000 (13:46 -0400)]
support thirdPartyPopulated
These don't have importTree in their config, because they don't support
tree import, but they do still support import, and do not support export
or key/value modification.
Joey Hess [Mon, 21 Dec 2020 17:24:07 +0000 (13:24 -0400)]
fix logic error in thirdPartyPopulated handling
Joey Hess [Fri, 18 Dec 2020 21:04:46 +0000 (17:04 -0400)]
refactor
That code was not borg specific, and I can see making more remotes for
other backup software.
Joey Hess [Fri, 18 Dec 2020 20:52:49 +0000 (16:52 -0400)]
started borg special remote
Still need to implement 3 methods, but importKeyM looks like it will
work well to find annex object files.
Joey Hess [Fri, 18 Dec 2020 20:05:09 +0000 (16:05 -0400)]
Merge branch 'master' into borg
Joey Hess [Fri, 18 Dec 2020 20:04:56 +0000 (16:04 -0400)]
build fix
Joey Hess [Fri, 18 Dec 2020 20:03:51 +0000 (16:03 -0400)]
start borg special remote
Compiles, but unusable so far.
Joey Hess [Fri, 18 Dec 2020 19:27:24 +0000 (15:27 -0400)]
Merge branch 'master' into borg
Joey Hess [Fri, 18 Dec 2020 18:52:57 +0000 (14:52 -0400)]
add thirdPartyPopulated interface
This is to support, eg a borg repo as a special remote, which is
populated not by running git-annex commands, but by using borg. Then
git-annex sync lists the content of the remote, learns which files are
annex objects, and treats those as present in the remote.
So, most of the import machinery is reused, to a new purpose. While
normally importtree maintains a remote tracking branch, this does not,
because the files stored in the remote are annex object files, not
user-visible filenames. But, internally, a git tree is still generated,
of the files on the remote that are annex objects. This tree is used
by retrieveExportWithContentIdentifier, etc. As with other import/export
remotes, that the tree is recorded in the export log, and gets grafted
into the git-annex branch.
importKey changed to be able to return Nothing, to indicate when an
ImportLocation is not an annex object and so should be skipped from
being included in the tree.
It did not seem to make sense to have git-annex import do this, since
from the user's perspective, it's not like other imports. So only
git-annex sync does it.
Note that, git-annex sync does not yet download objects from such
remotes that are preferred content. importKeys is run with
content downloading disabled, to avoid getting the content of all
objects. Perhaps what's needed is for seekSyncContent to be run with these
remotes, but I don't know if it will just work (in particular, it needs
to avoid trying to transfer objects to them), so I skipped that for now.
(Untested and unused as of yet.)
This commit was sponsored by Jochen Bartl on Patreon.
Joey Hess [Fri, 18 Dec 2020 19:14:10 +0000 (15:14 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Fri, 18 Dec 2020 19:11:53 +0000 (15:11 -0400)]
fix handling of importtree-only remotes
Don't want to try to use these remotes as key/value remotes, which will
surely fail. It only recently became possible for importtree to be set
w/o exporttree, so before this code was ok.
(cherry picked from commit
97599cb0f7f4115aa5a3e81a91ee3d1d6c52dc84)
Joey Hess [Fri, 18 Dec 2020 15:06:23 +0000 (11:06 -0400)]
update
Joey Hess [Thu, 17 Dec 2020 21:06:50 +0000 (17:06 -0400)]
change info from export=yes to exporttree=yes and same for import
for consistency
Ilya_Shlyakhter [Thu, 17 Dec 2020 21:01:33 +0000 (21:01 +0000)]
Added a comment: encryption=onlycreds
Joey Hess [Thu, 17 Dec 2020 20:50:25 +0000 (16:50 -0400)]
Merge branch 'master' into borg
Joey Hess [Thu, 17 Dec 2020 20:49:17 +0000 (16:49 -0400)]
avoid redundant set of a S3 verison ID that is already recorded
I think this could cause unnecessary changes to the git-annex branch,
and retrieveExportWithContentIdentifier is now also used for getting
content from importtree=yes remotes, so it would happen more frequently
so let's avoid.
Joey Hess [Thu, 17 Dec 2020 20:36:15 +0000 (16:36 -0400)]
Merge branch 'master' into borg
Joey Hess [Thu, 17 Dec 2020 20:35:10 +0000 (16:35 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Thu, 17 Dec 2020 20:29:51 +0000 (16:29 -0400)]
todo
Joey Hess [Thu, 17 Dec 2020 20:25:46 +0000 (16:25 -0400)]
update warnExportImportConflict for import-only remotes
Joey Hess [Thu, 17 Dec 2020 20:25:02 +0000 (16:25 -0400)]
fix call to warnExportImportConflict
That needs a Remote that has the right export/import set up, not the input
Remote, which does not yet.
Joey Hess [Thu, 17 Dec 2020 19:58:14 +0000 (15:58 -0400)]
add missing space
Joey Hess [Thu, 17 Dec 2020 19:52:12 +0000 (15:52 -0400)]
import remotes use ContentIdentifier for getting and checking content
This is better than using the equivilant actions for export remotes,
especially for getting content, since the ContentIdentifier checking
means we can be sure (enough) that the content is valid to not force
verification of content. Which allows getting keys of types that cannot
be verified.
Also, reorganized the internals of adjustExportImport which was becoming
very hard to follow. Now it's clear what each method does in each case.
Joey Hess [Thu, 17 Dec 2020 19:31:22 +0000 (15:31 -0400)]
force verification after getting file from export remote
This way, if annex.verify is disabled, it's still checked, since this is
not a key/value store, it has to be checked.
kyle [Thu, 17 Dec 2020 19:05:13 +0000 (19:05 +0000)]
Added a comment
Joey Hess [Thu, 17 Dec 2020 18:01:42 +0000 (14:01 -0400)]
refactor common code
Added a comment
Joey Hess [Thu, 17 Dec 2020 17:46:34 +0000 (13:46 -0400)]
provide missing remote actions for importree only remote
Ah, it seemed too easy before when I was implementing importrree only,
and it was because all the key-based actions needed to be handled too.
Mostly copied from isexport, and this works. It does seem that
an import remote could use retrieveExportWithContentIdentifier
rather than retrieveExport, and checkPresentExportWithContentIdentifier
rather than checkPresentExport, which would both be more accurate.
Joey Hess [Thu, 17 Dec 2020 17:45:07 +0000 (13:45 -0400)]
importtree only remotes are untrusted, same as exporttree remotes
Importtree only remotes are new; importtree remotes used to always also be
exporttree, so were untrusted.
Since an import remote is one that can be edited by something other than
git-annex, it's clearly not trustworthy at all.
kyle [Thu, 17 Dec 2020 17:41:36 +0000 (17:41 +0000)]
Added a comment
Joey Hess [Thu, 17 Dec 2020 17:12:52 +0000 (13:12 -0400)]
improve comment
Joey Hess [Thu, 17 Dec 2020 17:12:35 +0000 (13:12 -0400)]
docs for borg special remote
(which DNE yet)
Joey Hess [Thu, 17 Dec 2020 16:53:47 +0000 (12:53 -0400)]
typo
Joey Hess [Thu, 17 Dec 2020 16:51:49 +0000 (12:51 -0400)]
improve synopsis
Joey Hess [Thu, 17 Dec 2020 16:47:07 +0000 (12:47 -0400)]
response
Joey Hess [Thu, 17 Dec 2020 16:45:07 +0000 (12:45 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Thu, 17 Dec 2020 16:29:44 +0000 (12:29 -0400)]
improve docs
Joey Hess [Thu, 17 Dec 2020 16:17:58 +0000 (12:17 -0400)]
man page improvement
Joey Hess [Thu, 17 Dec 2020 16:09:49 +0000 (12:09 -0400)]
simplify
As the only blocking operation now is threadDelaySeconds, no need to
calculate actual time and actual expected minimum size.
kyle [Thu, 17 Dec 2020 16:06:44 +0000 (16:06 +0000)]
Added a comment
Added a comment: How do I `man` annex config options?
Added a comment: Duplicate content creates frustrating cycles
jwodder [Wed, 16 Dec 2020 16:03:55 +0000 (16:03 +0000)]
Add post metadata
jwodder [Wed, 16 Dec 2020 16:03:04 +0000 (16:03 +0000)]
Joey Hess [Tue, 15 Dec 2020 20:35:06 +0000 (16:35 -0400)]
update
Joey Hess [Tue, 15 Dec 2020 20:34:16 +0000 (16:34 -0400)]
comment
Joey Hess [Tue, 15 Dec 2020 18:44:00 +0000 (14:44 -0400)]
check Remote.hasKeyCheap again
In
cd1676d604, it stopped using that to avoid surprising behavior
when the location log and remote content were out of sync.
But, it seems that may have changed some behavior users relied on as
well, and also Remote.hasKeyCheap should be faster than checking then
location log.
So, try Remote.hasKeyCheap first, and only if it does not have the key,
fall back to checking the location log. If the location log still thinks
it's present, go ahead and try to get it, so the user will see a failure
rather than silently skipping a file what whereis says is on the remote.
This does make slightly slower the case where the remote does not have
the key, and location log and Remote.hasKeyCheap agree, since it now
checks both. But only 1 stat slower.
Joey Hess [Tue, 15 Dec 2020 18:05:54 +0000 (14:05 -0400)]
followup
Joey Hess [Tue, 15 Dec 2020 17:21:15 +0000 (13:21 -0400)]
comment
Joey Hess [Tue, 15 Dec 2020 17:17:31 +0000 (13:17 -0400)]
comment
Joey Hess [Tue, 15 Dec 2020 17:03:06 +0000 (13:03 -0400)]
response
Joey Hess [Tue, 15 Dec 2020 16:47:24 +0000 (12:47 -0400)]
OSXMkLibs: skip @loader_path
This may or may not make the OSX build work on a newer version of OSX
than the one that's currently being used for release builds. I have not
been able to find good docs about how exactly to get back from such a
value to the actual path to the library that the linker would use.
Joey Hess [Tue, 15 Dec 2020 16:40:07 +0000 (12:40 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 15 Dec 2020 16:39:34 +0000 (12:39 -0400)]
Windows: include= and exclude= containing '/' will also match filenames that are written using '\'
And vice-versa, but it's better to use '/' for portability.
Notably, standardPreferredContent contains "archive/*" and that might not
match if the filename ends up coming in with the slashes the other way
around.
yarikoptic [Tue, 15 Dec 2020 16:18:39 +0000 (16:18 +0000)]
Added a comment
Joey Hess [Tue, 15 Dec 2020 16:12:29 +0000 (12:12 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 15 Dec 2020 16:12:03 +0000 (12:12 -0400)]
reorg
Joey Hess [Tue, 15 Dec 2020 16:09:27 +0000 (12:09 -0400)]
clarify
Joey Hess [Tue, 15 Dec 2020 16:08:08 +0000 (12:08 -0400)]
initremote: Prevent enabling encryption with exporttree=yes/importtree=yes
I do think this was a reversion, but I have not tracked back to what
version. While involving the remote config, it's not the same class of
problems that I kept having to chase down for a while after the remote
config parser reworking.
Joey Hess [Tue, 15 Dec 2020 15:36:25 +0000 (11:36 -0400)]
propagate git-annex -c on to transferrer child process
git -c was already propagated via environment, but need this for
consistency.
Also, notice it does not use gitAnnexChildProcess to run the
transferrer. So nothing is done about avoid it taking the
pid lock. It's possible that the caller is already doing something that
took the pid lock, and if so, the transferrer will certianly fail,
since it needs to take the pid lock too. This may prevent combining
annex.stalldetection with annex.pidlock, but I have not verified it's
really a problem. If it was, it seems git-annex would have to take
the pid lock when starting a transferrer, and hold it until shutdown,
or would need to take pid lock when starting to use a transferrer,
and hold it until done with a transfer and then drop it. The latter
would require starting the transferrer with pid locking disabled for the
child process, so assumes that the transferrer does not do anyting that
needs locking when not running a transfer.
Joey Hess [Tue, 15 Dec 2020 14:44:36 +0000 (10:44 -0400)]
pass along -c options to child git-annex processes
Joey Hess [Tue, 15 Dec 2020 14:37:07 +0000 (10:37 -0400)]
populate new field
Editing files in tag / view branch
Joey Hess [Tue, 15 Dec 2020 05:13:21 +0000 (01:13 -0400)]
importfeed: Avoid using youtube-dl when a feed does not contain an enclosure, but only a link to an url which youtube-dl does not support
This is common in some feeds, which might mix some items with enclosures,
with others that link to posts or whatever. Before this, it would try to
use youtube-dl and fail, or if youtube-dl was not allowed, it would
incorrectly complain that an url was supported by youtube-dl.
jkniiv [Tue, 15 Dec 2020 04:46:38 +0000 (04:46 +0000)]
Added a comment: yay, it's working now! :)
Joey Hess [Tue, 15 Dec 2020 01:35:31 +0000 (21:35 -0400)]
typo
Joey Hess [Mon, 14 Dec 2020 21:54:25 +0000 (17:54 -0400)]
avoid using MatchingKey where MatchingFile can be used now
This is actually matching worktree files, and now that a Key can be
provided along with the file when doing that, using MatchingFile
reflects that.
Joey Hess [Mon, 14 Dec 2020 21:48:30 +0000 (17:48 -0400)]
improve readability and fix a warning
Joey Hess [Mon, 14 Dec 2020 21:43:48 +0000 (17:43 -0400)]
comment
Joey Hess [Mon, 14 Dec 2020 21:42:25 +0000 (17:42 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Mon, 14 Dec 2020 21:42:02 +0000 (17:42 -0400)]
add key to FileInfo
MatchingKey is not the thing to use when matching on actual worktreee
files.
Fix reversion in 8.
20201116 that made include= and exclude= in
preferred/required content expressions match a path relative to the current
directory, rather than the path from the top of the repository.
yarikoptic [Mon, 14 Dec 2020 20:59:06 +0000 (20:59 +0000)]
Added a comment
Joey Hess [Mon, 14 Dec 2020 20:52:53 +0000 (16:52 -0400)]
clarify comment
Joey Hess [Mon, 14 Dec 2020 19:34:27 +0000 (15:34 -0400)]
add USE_SYSTEM_LIBS=1 for osxapp build
Joey Hess [Mon, 14 Dec 2020 18:59:03 +0000 (14:59 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Mon, 14 Dec 2020 17:17:43 +0000 (13:17 -0400)]
improve some edge cases around partial initialization
* Guard against running in a repo where annex.uuid is set but
annex.version is set, or vice-versa.
* Avoid autoinit when a repo does not have annex.version or annex.uuid
set, but has a git-annex objects directory, suggesting it was used
by git-annex before.
Joey Hess [Mon, 14 Dec 2020 17:13:53 +0000 (13:13 -0400)]
improve display
Joey Hess [Mon, 14 Dec 2020 16:32:21 +0000 (12:32 -0400)]
rename and refactor
yarikoptic [Mon, 14 Dec 2020 14:07:47 +0000 (14:07 +0000)]
Added a comment
jkniiv [Mon, 14 Dec 2020 05:07:20 +0000 (05:07 +0000)]
Joey Hess [Sun, 13 Dec 2020 22:50:35 +0000 (18:50 -0400)]
add
Added a comment
muks@6bded6d879d80c43cdf4893fabb785876eea0a7b [Sat, 12 Dec 2020 10:35:07 +0000 (10:35 +0000)]
Added a comment
Joey Hess [Fri, 11 Dec 2020 22:31:09 +0000 (18:31 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Fri, 11 Dec 2020 22:26:30 +0000 (18:26 -0400)]
fix stall detection to actually work when fully stalled
When fully stalled, the progress bar doesn't update, so waiting on a
MVar would block forever. There's no need to wait anyway, just wake up
after sleeping the configured period and check the current value.
Luckily Viasat makes it really easy for me to notice this kind of
mistake, by stalling long TCP connections frequently.
Joey Hess [Fri, 11 Dec 2020 22:24:21 +0000 (18:24 -0400)]
mention annex.stalldetection and don't recommend too infrequent progress updates
kyle [Fri, 11 Dec 2020 20:56:04 +0000 (20:56 +0000)]
Added a comment
Joey Hess [Fri, 11 Dec 2020 20:21:16 +0000 (16:21 -0400)]
response and related todo
Joey Hess [Fri, 11 Dec 2020 20:16:07 +0000 (16:16 -0400)]
avoid transferrer committing the git-annex branch on shutdown
The parent is will do it when it shuts down, and having both of them
trying to do it at the same time seems like something good to avoid.
Joey Hess [Fri, 11 Dec 2020 19:49:39 +0000 (15:49 -0400)]
remove
I need to think about this some more, not clear if it's a todo
item specific to stalldetection at all. Remotes with this behavior
also show no progress when run with -J. And some other remotes don't
update any progress meters at all, eg adb is that way and so are hook
remotes and of course external remotes don't have to send progress info.
Joey Hess [Fri, 11 Dec 2020 19:48:03 +0000 (15:48 -0400)]
note
Joey Hess [Fri, 11 Dec 2020 19:45:55 +0000 (15:45 -0400)]
close
Joey Hess [Fri, 11 Dec 2020 19:28:58 +0000 (15:28 -0400)]
propagate signals to the transferrer process group
Done on unix, could not implement it on windows quite.
The signal library gets part of the way needed for windows.
But I had to open https://github.com/pmlodawski/signal/issues/1 because
it lacks raiseSignal.
Also, I don't know what the equivilant of getProcessGroupIDOf is on
windows. And System.Process does not provide a way to send any signal to
a process group except for SIGINT.
This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.