handling of interrupted appends
authorJoey Hess <joeyh@joeyh.name>
Wed, 20 Jul 2022 16:39:03 +0000 (12:39 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 20 Jul 2022 16:40:49 +0000 (12:40 -0400)
commitd275874e6c7d37eba9e8f769e8ba1d583c6cc57a
tree91e8c743e77a6369425f189a93791e1c3e2c4156
parent6f1fd3abdd335d6ba5bfd5dcf9b0f670e6bfe43d
handling of interrupted appends

An append that is interrupted and writes part of a line is now dealt
with by subsequent reads and appends. This also handles a read that
happens at the same time as an append to the file.

Old versions of git-annex will still see a partially written line,
and could get confused. Since appends are currently done for url logs
and location logs, the confusion is limited to a substring of the actual
url or UUID of the remote being read. This will not affect writes, since
the journal file is locked when reading in preparation for writing.
However, the bad data can be output by git-annex and used by other
things, or could cause surprising behavior by git-annex. Including eg,
downloading the content of the wrong url.

So, something needs to be done to prevent old versions of git-annex from
running in a repository where this appending is being done..

Sponsored-by: Dartmouth College's DANDI project
Annex/Journal.hs
doc/git-annex.mdwn