## Revision 4a4697de

b/doc/design-hroller.rst
80 80
```In order to do that we can use the following algorithm:
```
81 81

82 82
```1) Compute node sets that don't contain both the primary and the
```
83
```   secondary for any instance. This can be done already by the current
```
84
```   hroller graph coloring algorithm: nodes are in the same set (color)
```
85
```   if and only if no edge (instance) exists between them (see the
```
86
```   :manpage:`hroller(1)` manpage for more details).
```
87
```2) Inside each node set calculate subsets that don't have any secondary
```
88
```   node in common (this can be done by creating a graph of nodes that
```
89
```   are connected if and only if an instance on both has the same
```
90
```   secondary node, and coloring that graph)
```
91
```3) It is then possible to migrate in parallel all nodes in a subset
```
92
```   created at step 2, and then reboot/perform maintenance on them, and
```
83
```   secondary of any instance, and also don't contain the primary
```
84
```   nodes of two instances that have the same node as secondary. These
```
85
```   can be obtained by computing a coloring of the graph with nodes
```
86
```   as vertexes and an edge between two nodes, if either condition
```
87
```   prevents simultaneous maintenance. (This is the current algorithm of
```
88
```   :manpage:`hroller(1)` with the extension that the graph to be colored
```
89
```   has additional edges between the primary nodes of two instances sharing
```
90
```   their secondary node.)
```
91
```2) It is then possible to migrate in parallel all nodes in a set
```
92
```   created at step 1, and then reboot/perform maintenance on them, and
```
93 93
```   migrate back their original primaries, which allows the computation
```
94
```   above to be reused for each following subset without N+1 failures
```
94
```   above to be reused for each following set without N+1 failures
```
95 95
```   being triggered, if none were present before. See below about the
```
96 96
```   actual execution of the maintenance.
```
97 97

Also available in: Unified diff