git-annex/Logs
Joey Hess 68a49adcda
Improve behavior when -J transfers multiple files that point to the same key
After a false start, I found a fairly non-intrusive way to deal with it.
Although it only handles transfers -- there may be issues with eg
concurrent dropping of the same key, or other operations.

There is no added overhead when -J is not used, other than an added
inAnnex check. When -J is used, it has to maintain and check a small
Set, which should be negligible overhead.

It could output some message saying that the transfer is being done by
another thread. Or it could even display the same progress info for both
files that are being downloaded since they have the same content. But I
opted to keep it simple, since this is rather an edge case, so it just
doesn't say anything about the transfer of the file until the other
thread finishes.

Since the deferred transfer action still runs, actions that do more than
transfer content will still get a chance to do their other work. (An
example of something that needs to do such other work is P2P.Annex,
where the download always needs to receive the content from the peer.)
And, if the first thread fails to complete a transfer, the second thread
can resume it.

But, this unfortunately means that there's a risk of redundant work
being done to transfer a key that just got transferred.
That's not ideal, but should never cause breakage; the same
thing can occur when running two separate git-annex processes.

The get/move/copy/mirror --from commands had extra inAnnex checks added,
inside the download actions. Without those checks, the first thread
downloaded the content, and then the second thread woke up and
downloaded the same content redundantly.

move/copy/mirror --to is left doing redundant uploads for now. It
would need a second checkPresent of the remote inside the upload
to avoid them, which would be expensive. A better way to avoid
redundant work needs to be found..

This commit was supported by the NSF-funded DataLad project.
2017-10-17 17:10:50 -04:00
..
Chunk remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Difference remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
PreferredContent Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Presence avoid accidental Show of VectorClock 2017-08-14 14:51:54 -04:00
Trust Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Activity.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Chunk.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Config.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Difference.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Export.hs cleanup imports 2017-09-13 12:53:19 -04:00
FsckResults.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Group.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Line.hs Split lines in the git-annex branch on \r as well as \n, to deal with \r\n terminated lines written by some versions of git-annex on Windows. 2016-05-27 11:45:13 -04:00
Location.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
MapLog.hs avoid accidental Show of VectorClock 2017-08-14 14:51:54 -04:00
MetaData.hs Warn when metadata is inherited from a previous version of a file 2017-09-28 12:56:35 -04:00
Multicast.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
NumCopies.hs vicfg: Include the numcopies configuation. 2017-01-30 15:27:25 -04:00
PreferredContent.hs Limit annex.largefiles parsing to the subset of preferred content expressions that make sense in its context. 2016-02-03 15:04:42 -04:00
Presence.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Remote.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
RemoteState.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
Schedule.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
SingleValue.hs avoid accidental Show of VectorClock 2017-08-14 14:51:54 -04:00
TimeStamp.hs Optimised git-annex branch log file timestamp parsing. 10% speedup 2016-09-29 14:04:53 -04:00
Transfer.hs Improve behavior when -J transfers multiple files that point to the same key 2017-10-17 17:10:50 -04:00
Transitions.hs avoid accidental Show of VectorClock 2017-08-14 14:51:54 -04:00
Trust.hs prevent exporttree=yes on remotes that don't support exports 2017-09-07 13:48:44 -04:00
Unused.hs Drop support for building with old versions of directory, feed, and http-types. 2017-03-10 15:57:41 -04:00
UUID.hs Added GIT_ANNEX_VECTOR_CLOCK environment variable 2017-08-14 14:19:58 -04:00
UUIDBased.hs avoid accidental Show of VectorClock 2017-08-14 14:51:54 -04:00
View.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Web.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00