]> dgit.raspbian.org Git - git-annex.git/commitdiff
avoid storing SUCCESS-PLUS uuid when it is the remote uuid
authorJoey Hess <joeyh@joeyh.name>
Sun, 23 Jun 2024 12:21:11 +0000 (08:21 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sun, 23 Jun 2024 12:21:11 +0000 (08:21 -0400)
This is slightly belt and suspenders, but nothing guarantees that the
peer avoids including its uuid in the SUCCESS-PLUS list as it's supposed
to. And while it probably doesn't matter if the location log is updated
redundantly, let's not find out.

Remote/Git.hs
Remote/Helper/P2P.hs
Remote/P2P.hs

index 27955bd860f292e708a23dae4b8d9e4177643bb7..e8fcc56deddfe4ae1fe257ea1e3dfce01f94bb29 100644 (file)
@@ -549,7 +549,7 @@ copyToRemote' repo r st@(State connpool duc _ _ _) key file meterupdate
                , giveup "remote does not have expected annex.uuid value"
                )
        | Git.repoIsSsh repo =
-               P2PHelper.store (gitconfig r)
+               P2PHelper.store (uuid r) (gitconfig r)
                        (Ssh.runProto r connpool (return Nothing))
                        key file meterupdate
                
index aacd29578f8d7ec58932ff37d0d533f8c15bb800..e8ed5582b46d7313481e359a9dd47fdac14fc075 100644 (file)
@@ -33,8 +33,8 @@ type ProtoConnRunner c = forall a. P2P.Proto a -> ClosableConnection c -> Annex
 -- the pool when done.
 type WithConn a c = (ClosableConnection c -> Annex (ClosableConnection c, a)) -> Annex a
 
-store :: RemoteGitConfig -> ProtoRunner (Maybe [UUID]) -> Key -> AssociatedFile -> MeterUpdate -> Annex ()
-store gc runner k af p = do
+store :: UUID -> RemoteGitConfig -> ProtoRunner (Maybe [UUID]) -> Key -> AssociatedFile -> MeterUpdate -> Annex ()
+store remoteuuid gc runner k af p = do
        let sizer = KeySizer k (fmap (toRawFilePath . fst3) <$> prepSendAnnex k)
        let bwlimit = remoteAnnexBwLimitUpload gc <|> remoteAnnexBwLimit gc
        metered (Just p) sizer bwlimit $ \_ p' ->
@@ -44,7 +44,8 @@ store gc runner k af p = do
                                -- to be stored on additional UUIDs, 
                                -- so record those.
                                forM_ fanoutuuids $ \u ->
-                                       logChange k u InfoPresent
+                                       when (u /= remoteuuid) $
+                                               logChange k u InfoPresent
                        Just Nothing -> giveup "Transfer failed"
                        Nothing -> remoteUnavail
 
index ba9e6570e02810be5d2cd856fed23b19c49db03e..fa32ab14c8c0a391549e9c112e7c449d1730c7d7 100644 (file)
@@ -57,7 +57,7 @@ chainGen addr r u rc gc rs = do
                { uuid = u
                , cost = cst
                , name = Git.repoDescribe r
-               , storeKey = store gc protorunner
+               , storeKey = store u gc protorunner
                , retrieveKeyFile = retrieve gc protorunner
                , retrieveKeyFileCheap = Nothing
                , retrievalSecurityPolicy = RetrievalAllKeysSecure