-
Notifications
You must be signed in to change notification settings - Fork 33
Backport storage-alerts #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
87cf224
d4677d0
b2790d2
51d1696
adb1a50
efa0be0
c31d08d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,19 @@ function asserts:wait_fullmesh(servers, wait_time) | |
end) | ||
end | ||
|
||
function asserts:assert_server_no_alerts(server) | ||
server:exec(function() | ||
ilt.assert_equals(ivshard.storage.info().alerts, {}) | ||
end) | ||
end | ||
|
||
function asserts:info_assert_alert(alerts, alert_name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are not using anything in this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, it is still not in vtest. |
||
for _, alert in pairs(alerts) do | ||
if alert[1] == alert_name then | ||
return alert | ||
end | ||
end | ||
t.fail(('There is no %s in alerts').format(alert_name)) | ||
end | ||
|
||
return asserts |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
local t = require('luatest') | ||
local vtest = require('test.luatest_helpers.vtest') | ||
local vutil = require('vshard.util') | ||
local asserts = require('test.luatest_helpers.asserts') | ||
|
||
local test_group = t.group('storage') | ||
|
||
local cfg_template = { | ||
sharding = { | ||
repliacset_1 = { | ||
replicas = { | ||
replica_1_a = { | ||
master = true | ||
}, | ||
replica_1_b = {}, | ||
}, | ||
}, | ||
}, | ||
bucket_count = 20, | ||
identification_mode = 'name_as_key' | ||
} | ||
|
||
local global_cfg | ||
|
||
test_group.before_all(function(g) | ||
t.run_only_if(vutil.feature.persistent_names) | ||
global_cfg = vtest.config_new(cfg_template) | ||
|
||
vtest.cluster_new(g, global_cfg) | ||
vtest.cluster_bootstrap(g, global_cfg) | ||
vtest.cluster_wait_vclock_all(g) | ||
vtest.cluster_rebalancer_disable(g) | ||
end) | ||
|
||
test_group.after_all(function(g) | ||
g.cluster:drop() | ||
end) | ||
|
||
test_group.test_named_replicaset_alerts_when_replica_disconnects = function(g) | ||
g.replica_1_b:stop() | ||
local alerts = g.replica_1_a:exec(function() | ||
return ivshard.storage.info().alerts | ||
end) | ||
asserts:info_assert_alert(alerts, 'UNREACHABLE_REPLICA') | ||
asserts:info_assert_alert(alerts, 'UNREACHABLE_REPLICASET') | ||
g.replica_1_b:start() | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire file seems dead in vshard. I propose to
test/luatest_helpers/asserts.lua
.test/luatest_helpers/server.lua
. As a server's method. You even take the server as an argument here. So it makes sense to make it a server's method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, doesn't seem fixed. I still see this file and its usage.