Bug fix: export with -J could fail when two files had the same content.
authorJoey Hess <joeyh@joeyh.name>
Wed, 13 Jan 2021 18:50:48 +0000 (14:50 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 13 Jan 2021 18:50:48 +0000 (14:50 -0400)
Exporting is done inside a call to writeLockDbWhile which guarantees there
is only one process uploading to a given ExportLocation.

CHANGELOG
Command/Export.hs
doc/bugs/export_-J_6__to_S3__58___transfer_already_in_progress.mdwn

index b126a52229d0e18b387be19973b7d9f649167c4b..bf34053c93d8c3693f962683d96e178e23cbc584 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -24,6 +24,7 @@ git-annex (8.20201130) UNRELEASED; urgency=medium
     include deletions of submodules.
     Thanks, Kyle Meyer for the patch.
   * Windows: Work around win32 length limits when dealing with lock files.
+  * Bug fix: export with -J could fail when two files had the same content.
 
  -- Joey Hess <id@joeyh.name>  Mon, 04 Jan 2021 12:52:41 -0400
 
index 3973d3c1037e818544603b7e79880af61034c6f7..2eae95af87e6a7943dae3053de03d649eb064420 100644 (file)
@@ -283,7 +283,11 @@ performExport r db ek af contentsha loc allfilledvar = do
        sent <- tryNonAsync $ case ek of
                AnnexKey k -> ifM (inAnnex k)
                        ( notifyTransfer Upload af $
-                               upload' (uuid r) k af stdRetry $ \pm -> do
+                               -- alwaysUpload because the same key
+                               -- could be used for more than one export
+                               -- location, and concurrently uploading
+                               -- of the content should still be allowed.
+                               alwaysUpload (uuid r) k af stdRetry $ \pm -> do
                                        let rollback = void $
                                                performUnexport r db [ek] loc
                                        sendAnnex k rollback $ \f ->
index d599afe3863b8a1387ef42268896517bd184d409..5f8a21da9c6bc51fa55bc3bb1051969340f844a7 100644 (file)
@@ -94,3 +94,5 @@ Besides reporting the issue, I also have a question:  could I just rerun `export
 
 [[!meta author=yoh]]
 [[!tag projects/datalad]]
+
+> [[fixed|done]] bypassed this unncessary locking for exports. --[[Joey]]