Revision 9dc6023f
b/src/Cluster.hs | ||
---|---|---|
397 | 397 |
let |
398 | 398 |
opdx = Instance.pnode target |
399 | 399 |
osdx = Instance.snode target |
400 |
nodes = filter (\idx -> idx /= opdx && idx /= osdx) |
|
401 |
nodes_idx |
|
400 |
nodes = filter (\idx -> idx /= opdx && idx /= osdx) nodes_idx |
|
402 | 401 |
aft_failover = checkSingleStep ini_tbl target ini_tbl Failover |
402 |
all_moves = concatMap (\idx -> [ReplacePrimary idx, |
|
403 |
ReplaceSecondary idx]) nodes |
|
403 | 404 |
in |
404 | 405 |
-- iterate over the possible nodes for this instance |
405 |
foldl' |
|
406 |
(\ accu_p new_idx -> |
|
407 |
let |
|
408 |
pmoves = [ReplacePrimary new_idx, |
|
409 |
ReplaceSecondary new_idx] |
|
410 |
in |
|
411 |
foldl' -- while doing both possible moves |
|
412 |
(checkSingleStep ini_tbl target) accu_p pmoves |
|
413 |
) aft_failover nodes |
|
406 |
foldl' (checkSingleStep ini_tbl target) aft_failover all_moves |
|
414 | 407 |
|
415 | 408 |
-- | Compute the best next move. |
416 | 409 |
checkMove :: [Int] -- ^ Allowed target node indices |
Also available in: Unified diff