Skip to content

Commit

Permalink
storage: refactor replicasets process on info
Browse files Browse the repository at this point in the history
Part of #412
Part of #415
  • Loading branch information
DifferentialOrange committed Apr 16, 2024
1 parent e25d736 commit 482ea31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crud/storage_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function storage_info.call(opts)
end

local replicasets, err = vshard_router:routeall()
if replicasets == nil then
if err ~= nil then
return nil, StorageInfoError:new("Failed to get router replicasets: %s", err.err)
end

Expand All @@ -59,8 +59,9 @@ function storage_info.call(opts)
local timeout = opts.timeout or const.DEFAULT_VSHARD_CALL_TIMEOUT

for _, replicaset in pairs(replicasets) do
local master = utils.get_replicaset_master(replicaset, {cached = false})

for replica_id, replica in pairs(replicaset.replicas) do
local master = utils.get_replicaset_master(replicaset, {cached = false})

replica_state_by_id[replica_id] = {
status = "error",
Expand Down

0 comments on commit 482ea31

Please sign in to comment.