Skip to content
Snippets Groups Projects
Commit a2e90275 authored by Iustin Pop's avatar Iustin Pop
Browse files

Store the instance move in the MoveJobs

This will automatically sort our Ganeti jobs into the independent job
sets, and then we can submit them separately.
parent 92e32d76
No related branches found
No related tags found
No related merge requests found
......@@ -619,8 +619,8 @@ involvedNodes il plc =
-- | Inner function for splitJobs, that either appends the next job to
-- the current jobset, or starts a new jobset.
mergeJobs :: ([JobSet], [Ndx]) -> MoveJob -> ([JobSet], [Ndx])
mergeJobs ([], _) n@(ndx, _) = ([[n]], ndx)
mergeJobs (cjs@(j:js), nbuf) n@(ndx, _)
mergeJobs ([], _) n@(ndx, _, _) = ([[n]], ndx)
mergeJobs (cjs@(j:js), nbuf) n@(ndx, _, _)
| null (ndx `intersect` nbuf) = ((n:j):js, ndx ++ nbuf)
| otherwise = ([n]:cjs, ndx)
......@@ -632,7 +632,7 @@ splitJobs = fst . foldl mergeJobs ([], [])
-- | Given a list of commands, prefix them with @gnt-instance@ and
-- also beautify the display a little.
formatJob :: Int -> Int -> (Int, MoveJob) -> [String]
formatJob jsn jsl (sn, (_, cmds)) =
formatJob jsn jsl (sn, (_, _, cmds)) =
let out =
printf " echo job %d/%d" jsn sn:
printf " check":
......
......@@ -71,7 +71,7 @@ data IMove = Failover -- ^ Failover the instance (f)
-- | Formatted solution output for one move (involved nodes and
-- commands
type MoveJob = ([Ndx], [String])
type MoveJob = ([Ndx], IMove, [String])
-- | A list of command elements
type JobSet = [MoveJob]
......
......@@ -91,11 +91,11 @@ iterateDepth ini_tbl max_rounds disk_moves nmlen imlen
let
(Cluster.Table _ _ _ fin_plc) = fin_tbl
fin_plc_len = length fin_plc
cur_plc = head fin_plc
cur_plc@(_, _, _, move, _) = head fin_plc
(sol_line, cmds) = Cluster.printSolutionLine ini_nl ini_il
nmlen imlen cur_plc fin_plc_len
afn = Cluster.involvedNodes ini_il cur_plc
upd_cmd_strs = (afn, cmds):cmd_strs
upd_cmd_strs = (afn, move, cmds):cmd_strs
unless oneline $ do
putStrLn sol_line
hFlush stdout
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment