fix location log update for copy to 1-node cluster
authorJoey Hess <joeyh@joeyh.name>
Sun, 23 Jun 2024 13:53:33 +0000 (09:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sun, 23 Jun 2024 13:53:33 +0000 (09:53 -0400)
P2P/Proxy.hs
doc/todo/git-annex_proxies.mdwn

index ec9ade8ba8f8b362ab08a70da2cfa7fee9da50df..0ba3bfe290b14a459634c3c11803bfe8ed11bc89 100644 (file)
@@ -303,16 +303,17 @@ proxy proxydone proxymethods servermode (ClientSide clientrunst clientconn) remo
        handleGET remoteside message = getresponse (runRemoteSide remoteside) message $
                withDATA (relayGET remoteside)
 
-       handlePUT (remoteside:[]) k message =
-               getresponse (runRemoteSide remoteside) message $ \resp -> case resp of
-                       ALREADY_HAVE -> protoerrhandler proxynextclientmessage $
-                               client $ net $ sendMessage resp
-                       ALREADY_HAVE_PLUS _ -> protoerrhandler proxynextclientmessage $
-                               client $ net $ sendMessage resp
-                       PUT_FROM _ -> 
-                               getresponse client resp $ 
-                                       withDATA (relayPUT remoteside k)
-                       _ -> protoerr
+       handlePUT (remoteside:[]) k message
+               | remoteUUID remoteside == remoteuuid =
+                       getresponse (runRemoteSide remoteside) message $ \resp -> case resp of
+                               ALREADY_HAVE -> protoerrhandler proxynextclientmessage $
+                                       client $ net $ sendMessage resp
+                               ALREADY_HAVE_PLUS _ -> protoerrhandler proxynextclientmessage $
+                                       client $ net $ sendMessage resp
+                               PUT_FROM _ -> 
+                                       getresponse client resp $ 
+                                               withDATA (relayPUT remoteside k)
+                               _ -> protoerr
        handlePUT [] _ _ = 
                protoerrhandler proxynextclientmessage $
                        client $ net $ sendMessage ALREADY_HAVE
@@ -474,7 +475,6 @@ proxy proxydone proxymethods servermode (ClientSide clientrunst clientconn) remo
                                client $ net $ sendMessage $
                                        case concat (catMaybes storeduuids) of
                                                [] -> FAILURE
-                                               (_u:[]) -> SUCCESS
                                                us
                                                        | protocolversion < 2 -> SUCCESS
                                                        | otherwise -> SUCCESS_PLUS us
index 3869f31ca696faa9bdc34fa8c2f13fa30ed28f4c..d1f4ef53528741766905f3aa569edd67b5c488f6 100644 (file)
@@ -74,10 +74,6 @@ For June's work on [[design/passthrough_proxy]], implementation plan:
   check may fail to realize that dropping from multiple nodes does in fact
   make it worse.
 
-* Bug: When a cluster has one node, copying a file to it does not update
-  location log to say the content is present on it. It's returning SUCCESS
-  rather than SUCCESS-PLUS.
-
 * Support annex.jobs for clusters.
 
 * On upload to a cluster, as well as fanout to nodes, if the key is