Commit graph

26317 commits

Author SHA1 Message Date
Joey Hess
bb6719678e
update walkthrough and add tip about using v6 unlocked files
The walkthrough should make sense now both for v5 and v6 repo users.
2015-12-26 16:47:23 -04:00
Joey Hess
51b69ef551
add copy of note.mdwn, since Makefile's ikiwiki invocation omits the basewiki 2015-12-26 16:40:11 -04:00
Joey Hess
025f284ac1
reorg 2015-12-26 15:15:02 -04:00
Joey Hess
fcb013044b
update 2015-12-26 15:13:05 -04:00
Joey Hess
d0da52f1b1
typo 2015-12-26 15:11:32 -04:00
Joey Hess
54f87ef95f
get associated files from Keys database 2015-12-26 15:09:53 -04:00
Joey Hess
7593917147
cleanup 2015-12-26 15:09:47 -04:00
Joey Hess
289a3592c3
support v6 unlocked files
This optimisation was not necessary, and didn't work for v6 unlocked files.
Typically only a small number of files will be changed by a commit, so just
catKey them all.
2015-12-26 15:04:26 -04:00
Joey Hess
0fe43d7f8e
update for v6 unlocked files 2015-12-26 14:59:06 -04:00
Joey Hess
60c36ef6ba
make views work with v6 unlocked files
Have to only use the view index in one place; lookupFile was failing for
unlocked files because it was run using the view index, which was empty.
2015-12-26 14:52:58 -04:00
Joey Hess
49fca49991
remove dead code 2015-12-26 14:45:07 -04:00
Joey Hess
1b55af4c3c
deal with unlocked files when calling rsyncParamsRemote
In copyFromRemote, it used to check isDirect, but that was not needed;
the remote is sending the file, so it doesn't matter if the local,
receiving repository is in direct mode or not. And, since the content is not
present, yet, it's certianly not unlocked. Note that, the remote may indeed
be sending an unlocked file, but sendkey uses sendAnnex, which will detect
if the file is modified before or during transfer, and will exit nonzero,
aborting the upload. So, the receiver doesn't need any checks.

In copyToRemote, it forces recvkey to verify content whenever it's being
sent from a v6 repository. recvkey is almost always going to verify content
anyway, unless annex.verify is not set. So, this doesn't make it any more
expensive, except for in that unusual configuration. The alternative would
be to change the recvkey interface, so that the sender checks afterwards if
what it was sending changed, and the receiver then throws out the bad
transfer. That would be less expensive for the reciever, as it would not
need to do a checksum verification. But, it would mean another network
round trip, and since rsync closes the connection, it would need to open
another ssh connection to do this. Even with connction caching, that would
add latency to uploads. It would also complicate the interface, especially
because an older git-annex-shell would not have the new interface
available. For these reasons, I prefer punting on that at this time, and
instead someone might set annex.verify=false and be unhappy that it still
verifies..

(One other gotcha not dealt with is that a v5 repo could be upgraded to v6
while an upload is in progress, and a file unlocked and modified.)

(Also, I double-checked Remote.GCrypt's calls to rsyncParamsRemote, and
they're fine. When a file is being uploaded to gcrypt, or any other special
repository, it is mediated by sendAnnex, so changes will be detected at
that level and the special remote implementation doesn't need to worry
about them.)
2015-12-26 14:16:27 -04:00
Joey Hess
f776ac0a11
add unlocked flag for git-annex-shell recvkey
The direct flag is also set when sending unlocked content, to support old
versions of git-annex-shell. At some point, the direct flag will be
removed, and only the unlocked flag will be used.
2015-12-26 13:59:27 -04:00
Joey Hess
f324ad24c1
improve comment 2015-12-26 13:47:36 -04:00
Joey Hess
41b2caa5f6
reword 2015-12-26 13:06:53 -04:00
Joey Hess
87f0708f88
persistent-sqlite is now a hard build dependency, since v6 repository mode needs it. 2015-12-26 13:00:52 -04:00
Joey Hess
d8cb05c4af
temporarily disable v6 repos tests (still 4 failures) 2015-12-24 19:24:40 -04:00
Joey Hess
72e717e14c
Merge branch 'smudge' 2015-12-24 19:23:18 -04:00
divergentdave@5c17d06f6d67c6f157b76a4cc95ca764b7d2f899
9aaa072d26 Added a comment 2015-12-24 22:44:16 +00:00
divergentdave@5c17d06f6d67c6f157b76a4cc95ca764b7d2f899
b783c481ef 2015-12-24 22:32:23 +00:00
Joey Hess
7c02f070b1
lost some bookkeeping info
I forgot to convert this to use Annex.Ingest, todo later.
2015-12-24 13:15:26 -04:00
Joey Hess
9d3474ef1b
unused import 2015-12-24 13:07:42 -04:00
Joey Hess
c21567dfd3
typo 2015-12-24 13:06:03 -04:00
Joey Hess
f87aaa57b4
Merge branch 'master' of ssh://git-annex.branchable.com 2015-12-23 19:41:11 -04:00
Joey Hess
dcb0ec50fd
devblog 2015-12-23 19:40:39 -04:00
Joey Hess
f839d407e3
flush keys db queue even on exception
Also fixed a bug in makeRunner; run' leaves the mvar empty so have to
refill it.
2015-12-23 19:38:18 -04:00
Joey Hess
4224fae71f
optimise read and write for Keys database (untested)
Writes are optimised by queueing up multiple writes when possible.
The queue is flushed after the Annex monad action finishes. That makes it
happen on program termination, and also whenever a nested Annex monad action
finishes.

Reads are optimised by checking once (per AnnexState) if the database
exists. If the database doesn't exist yet, all reads return mempty.

Reads also cause queued writes to be flushed, so reads will always be
consistent with writes (as long as they're made inside the same Annex monad).
A future optimisation path would be to determine when that's not necessary,
which is probably most of the time, and avoid flushing unncessarily.

Design notes for this commit:

- separate reads from writes
- reuse a handle which is left open until program
  exit or until the MVar goes out of scope (and autoclosed then)
- writes are queued
  - queue is flushed periodically
  - immediate queue flush before any read
  - auto-flush queue when database handle is garbage collected
  - flush queue on exit from Annex monad
    (Note that this may happen repeatedly for a single database connection;
    or a connection may be reused for multiple Annex monad actions,
    possibly even concurrent ones.)
- if database does not exist (or is empty) the handle
  is not opened by reads; reads instead return empty results
- writes open the handle if it was not open previously
2015-12-23 19:18:52 -04:00
Joey Hess
959b060e26
allow flushDbQueue to be run repeatedly 2015-12-23 16:36:08 -04:00
Joey Hess
d43ac8056b
auto-close database connections when MVar is GCed 2015-12-23 16:11:36 -04:00
Joey Hess
6d38f54db4
split out Database.Queue from Database.Handle
Fsck can use the queue for efficiency since it is write-heavy, and only
reads a value before writing it. But, the queue is not suited to the Keys
database.
2015-12-23 14:59:58 -04:00
mark@6b90344cdab3158eacb94a3944460d138afc9bef
6b394a5b36 Added a comment: Centralized server with separate remote 2015-12-23 17:59:49 +00:00
CandyAngel
b0518fe3ce Added a comment 2015-12-23 12:46:37 +00:00
Joey Hess
1f6c0be2b2
devblog 2015-12-22 18:22:24 -04:00
Joey Hess
b3690c4499
update 2015-12-22 18:19:32 -04:00
Joey Hess
39048e4568
Merge branch 'master' into smudge 2015-12-22 18:10:40 -04:00
Joey Hess
a82b7d0044
update 2015-12-22 18:04:43 -04:00
Joey Hess
0c03629173
clean up cruft in assistant fast rename code path 2015-12-22 18:03:47 -04:00
Joey Hess
c4152654d2
combine PendingAddChanges for the same file into one
In v6 unlocked mode, this fixes a problem that was making eg,
echo > file cause the assistant to copy the file to the annex object,
instead of hard linking it. That because 2 change events were seen
(one for opening the file and one for closing) and processed together
the file was then locked down twice. Which meant it had mutiple hard links,
and so prevented linkAnnex from hard linking it.

There might be scenarios where multiple events come in, but staggered such
that a file gets locked down repeatedly, and it would still be copied to
the annex object in that case.
2015-12-22 17:52:39 -04:00
Joey Hess
d8a8c77a8f
move cleanOldKey into ingest 2015-12-22 16:55:49 -04:00
Joey Hess
cfaac52b88
populate unlocked files with newly available content when ingesting
This can happen when ingesting a new file in either locked or unlocked
mode, when some unlocked files in the repo use the same key, and the
content was not locally available before.
2015-12-22 16:22:28 -04:00
Joey Hess
4f60234690
finish v6 support for assistant
Seems to basically work now!
2015-12-22 15:23:27 -04:00
Joey Hess
4392140946
make linkAnnex detect when the file changes as it's being copied/linked in
This fixes a race where the modified file ended up in annex/objects, and
the InodeCache stored in the database was for the modified version, so
git-annex didn't know it had gotten modified.

The race could occur when the smudge filter was running; now it gets the
InodeCache before generating the Key, which avoids the race.
2015-12-22 15:20:03 -04:00
Joey Hess
8e9608d7f0
refactoring
no behavior changes
2015-12-22 13:42:58 -04:00
Joey Hess
95971475c7
link to neurodebian standalone deb 2015-12-22 12:34:28 -04:00
Joey Hess
9eb96e8e84
remove obsolte note about sid package being out of date 2015-12-22 12:31:58 -04:00
Joey Hess
19f78dc76b
Merge branch 'master' of ssh://git-annex.branchable.com 2015-12-22 12:22:03 -04:00
Joey Hess
2dce8081a6
addurl: Added --with-files option. 2015-12-22 12:20:39 -04:00
Joey Hess
03f2ae0423
refactor 2015-12-22 11:58:59 -04:00
Joey Hess
ca2c977704
wip v6 support for assistant
Files are not yet added to v6 repos in unlocked mode.
2015-12-21 18:41:15 -04:00
Joey Hess
4cf9efb51a
remove (v6) associated file in unannex 2015-12-21 18:00:48 -04:00