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.
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)
* 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`