Skip to content

Commit

Permalink
Add issue about vshard storages marked as ALL_RW
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Nov 14, 2023
1 parent b5c946c commit 7e085bf
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Added

- new issue when ``box.info.election.leader_idle`` is too high.

- new issue about vshard storages marked as ``ALL_RW``.

-------------------------------------------------------------------------------
[2.8.4] - 2023-10-31
-------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions cartridge/issues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
-- * warning: "Advertise URI (...) differs from clusterwide config (...)";
-- * warning: "Configuring roles is stuck on ... and hangs for ... so far";
--
-- Vshard:
--
-- * various vshard alerts (see vshard docs for details);
-- * warning: "Group "..." wasn't bootstrapped: ...";
-- * warning: Vshard storages in replicaset %s marked as "all writable".
--
-- Alien members:
--
-- * warning: "Instance ... with alien uuid is in the membership" -
Expand Down
13 changes: 12 additions & 1 deletion cartridge/roles/vshard-storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ hotreload.whitelist_globals({
vars:new('vshard_cfg')
vars:new('instance_uuid')
vars:new('replicaset_uuid')
vars:new('issues', {})
local _G_vshard_backup

local function apply_config(conf, _)
local function apply_config(conf, opts)
checks('table', {is_master = 'boolean'})

local my_replicaset = conf.topology.replicasets[vars.replicaset_uuid]
Expand All @@ -34,6 +35,15 @@ local function apply_config(conf, _)
vshard_cfg.listen = box.cfg.listen
vshard_cfg.replication = box.cfg.replication

if my_replicaset.all_rw and opts.is_master then
table.insert(vars.issues, {
level = 'warning',
topic = 'vshard',
message = ([[Vshard storages in replicaset %s marked as "all writable". ]] ..
[[This might not work as expected.]]):format(vars.replicaset_uuid),
})
end

if utils.deepcmp(vshard_cfg, vars.vshard_cfg) then
-- No reconfiguration required, skip it
return
Expand Down Expand Up @@ -101,4 +111,5 @@ return {
on_apply_config = on_apply_config,
init = init,
stop = stop,
get_issues = function() return vars.issues end,
}
19 changes: 19 additions & 0 deletions rst/cartridge_admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,14 @@ Cartridge displays cluster and instances issues in WebUI:

|nbsp|

* Vshard:

* various vshard alerts (see vshard docs for details);

* **warning**: warning: "Group "..." wasn't bootstrapped: ...";

* **warning**: Vshard storages in replicaset %s marked as "all writable".

* Alien members:

* **warning**: "Instance ... with alien uuid is in the membership" --
Expand All @@ -1296,10 +1304,21 @@ Cartridge displays cluster and instances issues in WebUI:

|nbsp|

* Expelled instances:

* **warning**: "Replicaset ... has expelled instance ... in box.space._cluster" -
when instance was expelled from replicaset, but still remains in box.space._cluster;

* Deprecated space format:

* **warning**: "Instance ... has spaces with deprecated format: space1, ..."

* Raft issues:

* **warning**: "Raft leader idle is 10.000 on ... .
Is raft leader alive and connection is healthy?"


* Custom issues (defined by user):

* Custom roles can announce more issues with their own level, topic
Expand Down
7 changes: 7 additions & 0 deletions test/integration/api_edit_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,11 @@ end

function g.test_all_rw_true()
test_all_rw(true)
helpers.retrying({}, function()
t.assert_equals(
helpers.list_cluster_issues(g.cluster.main_server)[1].message,
('Vshard storages in replicaset %s '):format(helpers.uuid('b'))..
'marked as "all writable". This might not work as expected.'
)
end)
end

0 comments on commit 7e085bf

Please sign in to comment.