Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
00b51a14
Commit
00b51a14
authored
16 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Some more docstring updates
parent
142538ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Cluster.hs
+9
-4
9 additions, 4 deletions
src/Cluster.hs
with
9 additions
and
4 deletions
src/Cluster.hs
+
9
−
4
View file @
00b51a14
...
...
@@ -67,10 +67,11 @@ solutionDelta sol = case sol of
data
Removal
=
Removal
NodeList
[
Instance
.
Instance
]
-- | An instance move definition
data
IMove
=
Failover
|
ReplacePrimary
Int
|
ReplaceSecondary
Int
|
ReplaceAndFailover
Int
data
IMove
=
Failover
-- ^ Failover the instance (f)
|
ReplacePrimary
Int
-- ^ Replace the primary (f, r:np, f)
|
ReplaceSecondary
Int
-- ^ Replace the secondary (r:ns)
|
ReplaceAndFailover
Int
-- ^ Replace the secondary and
-- failover (r:ns, f)
deriving
(
Show
)
-- | The complete state for the balancing solution
...
...
@@ -329,6 +330,7 @@ checkPlacement nl victims current current_delta prev_sol max_delta =
-- | Apply a move
applyMove
::
NodeList
->
Instance
.
Instance
->
IMove
->
(
Maybe
NodeList
,
Instance
.
Instance
,
Int
,
Int
)
-- Failover (f)
applyMove
nl
inst
Failover
=
let
old_pdx
=
Instance
.
pnode
inst
old_sdx
=
Instance
.
snode
inst
...
...
@@ -343,6 +345,7 @@ applyMove nl inst Failover =
old_sdx
(
fromJust
new_p
)
nl
in
(
new_nl
,
Instance
.
setBoth
inst
old_sdx
old_pdx
,
old_sdx
,
old_pdx
)
-- Replace the primary (f:, r:np, f)
applyMove
nl
inst
(
ReplacePrimary
new_pdx
)
=
let
old_pdx
=
Instance
.
pnode
inst
old_sdx
=
Instance
.
snode
inst
...
...
@@ -359,6 +362,7 @@ applyMove nl inst (ReplacePrimary new_pdx) =
old_sdx
(
fromJust
new_s
)
nl
in
(
new_nl
,
Instance
.
setPri
inst
new_pdx
,
new_pdx
,
old_sdx
)
-- Replace the secondary (r:ns)
applyMove
nl
inst
(
ReplaceSecondary
new_sdx
)
=
let
old_pdx
=
Instance
.
pnode
inst
old_sdx
=
Instance
.
snode
inst
...
...
@@ -371,6 +375,7 @@ applyMove nl inst (ReplaceSecondary new_sdx) =
old_sdx
int_s
nl
in
(
new_nl
,
Instance
.
setSec
inst
new_sdx
,
old_pdx
,
new_sdx
)
-- Replace the secondary and failover (r:np, f)
applyMove
nl
inst
(
ReplaceAndFailover
new_pdx
)
=
let
old_pdx
=
Instance
.
pnode
inst
old_sdx
=
Instance
.
snode
inst
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment