From 6751f2397802118a6f97ffe4381c041f9de30ce0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Sep 2024 14:29:49 -0400 Subject: [PATCH] sim: fix get bug 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 | 15 +++++++++------ doc/todo/git-annex_proxies.mdwn | 12 ++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Annex/Sim.hs b/Annex/Sim.hs index 8bf8b71056..edd63d47d2 100644 --- a/Annex/Sim.hs +++ b/Annex/Sim.hs @@ -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) diff --git a/doc/todo/git-annex_proxies.mdwn b/doc/todo/git-annex_proxies.mdwn index 755d04a796..ec8004cf1c 100644 --- a/doc/todo/git-annex_proxies.mdwn +++ b/doc/todo/git-annex_proxies.mdwn @@ -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` -- 2.30.2