-
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
Open
mrForza
wants to merge
7
commits into
tarantool:master
Choose a base branch
from
mrForza:mrforza/gh-493-storage-alerts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
87cf224
storage: fix unrelevant alert during upgrade
Serpentian d4677d0
storage: fix alert message
Serpentian b2790d2
test: add reconfiguration to uuid_as_key in storage_1_test
mrForza 51d1696
storage: move assert_server_no_alerts into assertions
mrForza adb1a50
test: delete test_id_is_shown_in_alerts as unnecessary
mrForza efa0be0
storage: disable alerts for non vshard replicas
mrForza c31d08d
test: add test_named_replicaset_alerts_when_replica_disconnects
mrForza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.