upgrade: Handle upgrade to v6 when the repository already contains v6 unlocked files whose content is already present.

Closes https://github.com/datalad/datalad/issues/1020

The use of runWriter in scanUnlockedFiles broke due to this change;
it failed with blocked indefinitely in mvar, because the database write
handle was taken while linkFromAnnex needed to also write to it (to update
the inode cache). So, switched to using a separate runWriter for each call
to addAssociatedFileFast. A little less efficient, but not greatly; the
writes should all still be cached.
This commit is contained in:
Joey Hess 2016-10-17 15:19:47 -04:00
parent 148bd0dbfd
commit 8e22114735
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
4 changed files with 43 additions and 16 deletions

View file

@ -56,7 +56,7 @@ performNew dest key = do
case r of
LinkAnnexOk -> return ()
LinkAnnexNoop -> return ()
_ -> error "unlock failed"
LinkAnnexFailed -> error "unlock failed"
, liftIO $ writePointerFile tmp key destmode
)
next $ cleanupNew dest key destmode