From 6a30d04ecef305360d268815e48829f2d59ff33d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Jan 2021 14:50:48 -0400 Subject: [PATCH] Bug fix: export with -J could fail when two files had the same content. Exporting is done inside a call to writeLockDbWhile which guarantees there is only one process uploading to a given ExportLocation. --- CHANGELOG | 1 + Command/Export.hs | 6 +++++- ...port_-J_6__to_S3__58___transfer_already_in_progress.mdwn | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b126a52229..bf34053c93 100644 --- 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 Mon, 04 Jan 2021 12:52:41 -0400 diff --git a/Command/Export.hs b/Command/Export.hs index 3973d3c103..2eae95af87 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -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 -> diff --git a/doc/bugs/export_-J_6__to_S3__58___transfer_already_in_progress.mdwn b/doc/bugs/export_-J_6__to_S3__58___transfer_already_in_progress.mdwn index d599afe386..5f8a21da9c 100644 --- a/doc/bugs/export_-J_6__to_S3__58___transfer_already_in_progress.mdwn +++ b/doc/bugs/export_-J_6__to_S3__58___transfer_already_in_progress.mdwn @@ -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]] -- 2.30.2