Commit graph

30675 commits

Author SHA1 Message Date
Joey Hess
abdff127f2
split out todo for webapp export config UI; close export todo! 2017-09-20 15:32:05 -04:00
Joey Hess
d71c65ca0a
add exporter thread to assistant
This is similar to the pusher thread, but a separate thread because git
pushes can be done in parallel with exports, and updating a big export
should not prevent other git pushes going out in the meantime.

The exportThread only runs at most every 30 seconds, since updating an
export is more expensive than pushing. This may need to be tuned.

Added a separate channel for export commits; the committer records a
commit in that channel.

Also, reconnectRemotes records a dummy commit, to make the exporter
thread wake up and make sure all exports are up-to-date. So,
connecting a drive with a directory special remote export will
immediately update it, and getting online will automatically
update S3 and WebDAV exports.

The transfer queue is not involved in exports. Instead, failed
exports are retried much like failed pushes.

This commit was sponsored by Ewen McNeill.
2017-09-20 15:29:13 -04:00
Joey Hess
46d19648ee
first pass at assistant knowing about export remotes
Split exportRemotes out from syncDataRemotes; the parts of the assistant
that upload keys and drop keys from remotes don't apply to exports,
because those operations are not supported.

Some parts of the assistant and webapp do operate on both
syncDataRemotes and exportRemotes. Particularly when downloading from
either of them. Added a downloadRemotes that combines both.

With this, the assistant should download from exports, but it won't yet
upload changes to them.

This commit was sponsored by Fernando Jimenez on Patreon.
2017-09-20 13:58:27 -04:00
Joey Hess
28eba8e9c6
update transfer info and notify when exporting
Same as is done for all other transfers of content, so the webapp will
display progress bars etc.

This commit was sponsored by Anthony DeRobertis on Patreon.
2017-09-20 12:58:23 -04:00
Joey Hess
c2833c955d
devblog 2017-09-19 16:24:04 -04:00
Joey Hess
a6c0ed6698
export --fast sets up but does not populate export
sync --content finishes
2017-09-19 14:26:03 -04:00
Joey Hess
2e69efea8d
git annex sync --content to exports
Assistant still todo.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon
2017-09-19 14:20:47 -04:00
Joey Hess
527f734492
configuration and docs for tracking exports
Not yet handled by sync or assistant.

This commit was sponsored by Nick Daly on Patreon.
2017-09-19 13:05:43 -04:00
Joey Hess
a6268b79b2
break out separate todo for later 2017-09-19 12:38:07 -04:00
Joey Hess
5f9eff3f32
fix bug that prevented db being written to disk in SingleWriter mode
The bug occurred when closeDb was not called, and garbage collection of
the DbHandle didn't give the workerThread time to shut down. Fixed by
exiting the runSqlite action when a commit is made.

(MultiWriter mode already forked off a runSqlite action, so avoided the
problem.)

This commit was sponsored by Brock Spratlen on Patreon.
2017-09-18 19:42:20 -04:00
Joey Hess
c35fd698aa
devblog 2017-09-18 19:22:45 -04:00
Joey Hess
f4be3c3f89
merge changes made on other repos into ExportTree
Now when one repository has exported a tree, another repository can get
files from the export, after syncing.

There's a bug: While the database update works, somehow the database on
disk does not get updated, and so the database update is run the next
time, etc. Wasn't able to figure out why yet.

This commit was sponsored by Ole-Morten Duesund on Patreon.
2017-09-18 19:21:41 -04:00
Joey Hess
6336caae3b
update 2017-09-18 14:51:32 -04:00
Joey Hess
55809081d0
update for ExportTree
Use ExportTree rather than ExportedLocation for retrieveKeyFile and
checkPresent. When another remote exported the content, ExportTree will
be populated, but ExportedLocation will not be.

It would be possible to implement storeKey to exports as well, but it
risks performing a lot of unncessary work when another repository
already stored the key on the export and the local repository doesn't
know about it.

The only way to avoid that work would be for storeKey to use checkPresentExport
before uploading. But, the other repository could have changed the
exported tree as well, so that can't be trusted, and if it were used in
storeKey, could result in bad information getting into the location log.

This commit was sponsored by Bruno BEAUFILS on Patreon.
2017-09-18 14:45:00 -04:00
Joey Hess
0ad7e36dc1
update ExportTree table efficiently
Use same diff and key lookup except when the whole tree has to be
scanned.

This commit was sponsored by Peter Hogg on Patreon.
2017-09-18 14:27:50 -04:00
Joey Hess
b03d77c211
add ExportTree table to export db
New table needed to look up what filenames are used in the currently
exported tree, for reasons explained in export.mdwn.

Also, added smart constructors for ExportLocation and ExportDirectory to
make sure they contain filepaths with the right direction slashes.

And some code refactoring.

This commit was sponsored by Francois Marier on Patreon.
2017-09-18 13:59:59 -04:00
Joey Hess
486902389d
lock to avoid more than one export to a remote at a time
This commit was sponsored by Jack Hill on Patreon.
2017-09-18 12:38:07 -04:00
Joey Hess
af0958dd70
move tracking exports to design 2017-09-18 12:06:01 -04:00
Joey Hess
506701e14a
Merge branch 'master' of ssh://git-annex.branchable.com 2017-09-18 11:16:43 -04:00
git-annex.branchable.com.20170819@a1e3e0fb4b4d8d6d0cc766d28f5e375df29d8249
5dd2485e4c 2017-09-18 14:28:21 +00:00
Joey Hess
4a45f34fe1
don't support removing content from export with removeKey
There does not seem to be a use case for supporting that, and it would
need a lot of complication to support it in a way that allows eventual
consistency when two repositories are updating the same export.

This commit was sponsored by Henrik Riomar on Patreon.
2017-09-17 17:56:33 -04:00
Joey Hess
ac4c8df2ca
Merge branch 'master' of ssh://git-annex.branchable.com 2017-09-16 16:44:38 -04:00
Joey Hess
494b4066db
clarification 2017-09-16 16:44:27 -04:00
Joey Hess
18ba1be26f
design for next steps on exports 2017-09-16 16:41:04 -04:00
Joey Hess
fa73387345
add example, including use of branch:subdir to export only a subdir 2017-09-16 16:40:20 -04:00
Joey Hess
7960870e48
add link to git-annex-remote-gvfs for smb / sftp 2017-09-16 13:57:37 -04:00
gleachkr@7c488e398809299a1100b93f8884de43dee83674
5ec74f1cdb Added a comment: Thanks! 2017-09-16 16:46:48 +00:00
Joey Hess
dbe8c42fdc
update 2017-09-16 12:09:11 -04:00
Joey Hess
b7dafb4f66
response for gleachkr 2017-09-16 12:07:12 -04:00
gleachkr@7c488e398809299a1100b93f8884de43dee83674
63dfd6cde2 Added a comment 2017-09-16 16:02:41 +00:00
Joey Hess
260d1061cd
followup for gleachkr 2017-09-16 11:26:00 -04:00
gleachkr@7c488e398809299a1100b93f8884de43dee83674
97eacf3a7a Added a comment: More data points 2017-09-16 01:16:59 +00:00
Joey Hess
e1f5c90c92
split out Types.Export 2017-09-15 16:46:03 -04:00
Joey Hess
e54a05612e
avoid unncessary db queries when exported directory can't be empty
In rename foo/bar to foo/baz, foo can't be empty.

In delete zxyyz, there's no exported directory (top doesn't count).
2017-09-15 16:30:49 -04:00
Joey Hess
af82b2229c
devblog 2017-09-15 15:54:20 -04:00
Joey Hess
cf51f40f0e
webdav: Changed path used on webdav server for temporary files.
Done to avoid a "tmp" directory appearing in webdav exports.

Also affects non-export webdav remotes, so interrupted uploads using the
old path will not overwrite it. However, PUT is quite likely to be
implemented atomically on web servers anyway, so I doubt this will cause
problems.
2017-09-15 15:52:31 -04:00
Joey Hess
1223960294
empty directory removal working 2017-09-15 15:24:45 -04:00
Joey Hess
c633144d28
remove empty directories when removing from export
The subtle part of this is what happens when the remote fails to remove
an empty directory. The removal from the export needs to fail in that
case, so the removal will be tried again later. However, removeExportLocation
has already been run and changed the export db, so if the next run
checks getExportLocation, it might decide nothing remains to be done,
leaving the empty directory.

Dealt with that by making removeEmptyDirectories, handle a failure
by calling addExportLocation, reverting the database changes so the next
run will be guaranteed to try deleting the empty directory again.

This commit was sponsored by Thomas Hochstein on Patreon.
2017-09-15 15:22:53 -04:00
Joey Hess
e223cf568f
add table to keep track of what subdirectories are populated in the export
So empty subdirectories can be identified and removed.

This commit was sponsored by Jochen Bartl on Patreon.
2017-09-15 14:35:22 -04:00
Joey Hess
bdcf19b095
add missing case 2017-09-15 14:32:56 -04:00
Joey Hess
3435a47245
Merge branch 'master' of ssh://git-annex.branchable.com 2017-09-15 13:20:09 -04:00
Joey Hess
9f4ffe65e9
implement removeExportDirectory
Not yet called by Command.Export.

WebDAV needs this to clean up empty collections. Also, example.sh turned
out to not be cleaning up directories when removing content
from them, so it made sense for it to use this.

Remote.Directory did not need it, and since its cleanup method for empty
directories is more efficient than what Command.Export will need to do
to find empty directories, it uses Nothing so that extra work can be
avoided.

This commit was sponsored by Thom May on Patreon.
2017-09-15 13:18:21 -04:00
Joey Hess
78a67f29f8
forwarded from irc 2017-09-15 13:13:43 -04:00
Joey Hess
5fe803e14e
update 2017-09-15 12:22:11 -04:00
tomasz
dd2c97d8ef 2017-09-15 14:33:31 +00:00
Joey Hess
589184ccc3
/dev/null stderr when generating completions
avoid usage display when too old optparse-applicative
2017-09-14 13:10:45 -04:00
benjamin.poldrack@d09ccff6d42dd20277610b59867cf7462927b8e3
849a5d4771 Added a comment: @joey: Sorry ... 2017-09-14 12:00:13 +00:00
Joey Hess
268a0cc664
update 2017-09-13 15:52:19 -04:00
Joey Hess
86fe31c767
Merge branch 'master' of ssh://git-annex.branchable.com 2017-09-13 15:36:17 -04:00
Joey Hess
01068d8280
fix build with old http-client 2017-09-13 15:35:42 -04:00