where
-- Nodes of the cluster have remote.name.annex-cluster-node
-- containing its name. Or they are proxied by a remote
- -- that has remote.name.annex-cluster-node containing the cluster's
- -- UUID.
+ -- that has remote.name.annex-cluster-gateway
+ -- containing the cluster's UUID.
isnode rs nodeuuids clusternames r =
case remoteAnnexClusterNode (Remote.gitconfig r) of
Just names
ClusterNodeUUID $ Remote.uuid r
| otherwise -> False
Nothing -> case remoteAnnexProxiedBy (Remote.gitconfig r) of
- Just proxyuuid -> not $ null $
- filter (== clusteruuid) $
- concatMap (remoteAnnexClusterGateway . Remote.gitconfig) $
- filter (\p -> Remote.uuid p == proxyuuid) rs
- Nothing -> False
+ Just proxyuuid
+ | Remote.uuid r /= fromClusterUUID clusteruuid ->
+ not $ null $
+ filter (== clusteruuid) $
+ concatMap (remoteAnnexClusterGateway . Remote.gitconfig) $
+ filter (\p -> Remote.uuid p == proxyuuid) rs
+ _ -> False
isclustername clusternames name =
M.lookup name clusternames == Just clusteruuid
protocol messages on to any remotes that have the same UUID as
the cluster. Needs VIA extension to P2P protocol to avoid cycles.
+ Status: works, but needs VIA extension to avoid ugly messages and extra
+ work
+
* Getting a key from a cluster currently always selects the lowest cost
remote, and always the same remote if cost is the same. Should
round-robin amoung remotes, and prefer to avoid using remotes that