Skip to content

Commit

Permalink
Why?
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Feb 13, 2024
1 parent fe50931 commit 5b551f8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions cartridge/lua-api/edit-topology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ local function __edit_server(topology_cfg, params)
server.electable = params.electable
end

if params.expelled == true then
topology_cfg.servers[params.uuid] = 'expelled'
end

if params.rebalancer ~= nil then
server.rebalancer = params.rebalancer
else
server.rebalancer = nil -- avoid setting it to box.NULL
end

if params.expelled == true then
topology_cfg.servers[params.uuid] = 'expelled'
end

return true
end

Expand Down Expand Up @@ -193,12 +193,6 @@ local function __edit_replicaset(topology_cfg, params)
replicaset.all_rw = params.all_rw
end

if params.rebalancer ~= nil then
replicaset.rebalancer = params.rebalancer
else
replicaset.rebalancer = nil -- avoid setting it to box.NULL
end

-- Set proper vshard group
repeat -- until true
if not replicaset.roles['vshard-storage'] then
Expand Down Expand Up @@ -245,6 +239,18 @@ local function __edit_replicaset(topology_cfg, params)
end
until true

repeat
if not replicaset.roles['vshard-storage'] then
-- ignore unless replicaset is a storage
break
end
if params.rebalancer ~= nil then
replicaset.rebalancer = params.rebalancer
else
replicaset.rebalancer = nil -- avoid setting it to box.NULL
end
until true

return true
end

Expand Down

0 comments on commit 5b551f8

Please sign in to comment.