sim: fix get bug
authorJoey Hess <joeyh@joeyh.name>
Tue, 17 Sep 2024 18:29:49 +0000 (14:29 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 17 Sep 2024 18:29:49 +0000 (14:29 -0400)
When getting from a remote, have to check that the repo doing the
getting thinks the remote contains the key, but also that the remote
actually does. Before this bug fix, it would get from a repo that used
to have the key, but that had dropped it since the last git pull.

Annex/Sim.hs
doc/todo/git-annex_proxies.mdwn

index 8bf8b71056ba468a869c1c464d0d7b7e920628fb..edd63d47d2902c37f3f437861603f4d23524515e 100644 (file)
@@ -535,12 +535,15 @@ overFilesRemote r u remote remotepred checkwant handlewanted st =
        go remoteu (f, k) st' = 
                let af = AssociatedFile $ Just f
                in liftIO $ runSimRepo u st' $ \rst ->
-                       if checkremotepred remoteu rst k
-                               then ifM (checkwant (Just k) af remoteu)
-                                       ( return $ handlewanted remoteu f k r st'
-                                       , return st'
-                                       )
-                               else return st'
+                       case M.lookup remoteu (simRepoState st') of
+                               Nothing -> return st'
+                               Just rmtst
+                                       | not (checkremotepred remoteu rst k) -> return st'
+                                       | not (checkremotepred remoteu rmtst k) -> return st'
+                                       | otherwise -> ifM (checkwant (Just k) af remoteu)
+                                               ( return $ handlewanted remoteu f k r st'
+                                               , return st'
+                                               )
        checkremotepred remoteu rst k =
                remotepred remoteu (getSimLocations rst k)
 
index 755d04a7965181589e849ce49cc0a407b9c0054c..ec8004cf1c9a4f61b31054d05085486532799e05 100644 (file)
@@ -34,6 +34,18 @@ Planned schedule of work:
 
 * sim: implement addtree
 
+* sim: May need to use LiveUpdate to make size balanced preferred content
+  work
+
+* sim: Can a cluster using size balanced preferred content be simulated?
+  May need the sim to get the concept of a cluster gateway, since the
+  gateway is what picks amoung the nodes on the basis of size. On the other
+  hand, it may suffice to connect the sending repo directly to each node of
+  the cluster, and let that repo pick which nodes to send to.
+
+* sim: Add support for metadata, so preferred content that matches on it
+  will work
+
 ## items deferred until later for balanced preferred content and maxsize tracking
 
 * `git-annex assist --rebalance` of `balanced=foo:2`