Fix node readd issues
authorIustin Pop <iustin@google.com>
Tue, 30 Jun 2009 15:51:26 +0000 (17:51 +0200)
committerIustin Pop <iustin@google.com>
Tue, 30 Jun 2009 16:33:04 +0000 (18:33 +0200)
commita8ae3eb5f744e532fefe58462af783aab7d64f93
tree53f0a68fd685e3f3b53260d22bea524428bf26ae
parent9a5cb537d1ae71cbdb572adbc53c3163b85ded53
Fix node readd issues

This patch fixes a few node readd issues.

Currently, the node readd consists of two opcodes:
  - OpSetNodeParms, which resets the offline/drained flags
  - OpAddNode (with readd=True), which reconfigures the node

The problem is that between these two, the configuration is inconsistent
for certain cluster configurations. Thus, this patch removes the first
opcode and modified the LUAddNode to deal with this case too.

The patch also modifies the computation of the intended master_candidate
status, and actually sets the readded node to master candidate if
needed. Previously, we didn't modify the existing node at all.

Finally, the patch modifies the bottom of the Exec() function for this
LU to:
  - trigger a node update, which in turn redistributes the ssconf files
    to all nodes (and thus the new node too)
  - if the new node is not a master candidate, then call the
    node_demote_from_mc RPC so that old master files are cleared

My testing shows this behaves correctly for various cases.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/cmdlib.py
scripts/gnt-node