Skip to content

Commit 68445ca

Browse files
committed
[API change]: batch (decommission, start-maintenance, shutdown)-node
* node-lifecycle API change: - apc.ActValRmNode adds DaemonIDs (omitempty) * one multi-node transaction: - one Smap modification, one RMD increment, one global rebalance for the entire batch * reject node-lifecycle requests while global rebalance is running - the check existed but was reachable only for a node already in maintenance or decommission * refactor/amend: - rmNodesFinal, checkRebCoexistence (previously beginRmTarget) - stop-maintenance: decide (rebalance | no rebalance) once * do not abort node-lifecycle request when a node disappears (e.g. keepalive-removed) ---- * CLI: support 'NODE_ID [NODE_ID...]' batch arg, comma- or space-separated - TAB completion will suggest remaining nodes.. Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
1 parent 6cee6bd commit 68445ca

12 files changed

Lines changed: 587 additions & 288 deletions

File tree

ais/clustermap.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ type (
8585
nsi *meta.Snode // new node to be added
8686
nid string // node ID of the candidate primary
8787
sid string // ID of the node to modify
88+
sids []string // IDs of nodes to modify as one operation
8889
flags cos.BitFlags // enum cmn.Snode* to set or clear
8990
nver int64 // new Smap version (cloned and modified `smap` - see above)
9091
status int // resulting http.Status*
@@ -104,6 +105,16 @@ var (
104105
_ meta.SmapListeners = (*sls)(nil)
105106
)
106107

108+
func (ctx *smapModifier) nodeIDs() []string {
109+
if len(ctx.sids) > 0 {
110+
return ctx.sids
111+
}
112+
if ctx.sid != "" {
113+
return []string{ctx.sid}
114+
}
115+
return nil
116+
}
117+
107118
// as revs
108119
func (*smapX) tag() string { return revsSmapTag }
109120
func (m *smapX) version() int64 { return m.Version }

0 commit comments

Comments
 (0)