Skip to content
Snippets Groups Projects
Commit a9501be1 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

test: check vshard is reconfigured upon incarnation change

parent bc97d2cb
No related branches found
No related tags found
1 merge request!735Gmoshkin/minor fixes
......@@ -832,7 +832,9 @@ class Instance:
"leader_id": status.leader_id,
} == {"raft_state": state, "leader_id": leader_id}
def wait_online(self, timeout: int | float = 6, rps: int | float = 5):
def wait_online(
self, timeout: int | float = 6, rps: int | float = 5, expected_incarnation=None
):
"""Wait until instance attains Online grade
Args:
......@@ -869,6 +871,8 @@ class Instance:
assert isinstance(myself, dict)
assert isinstance(myself["current_grade"], dict)
assert myself["current_grade"]["variant"] == "Online"
if expected_incarnation is not None:
assert myself["current_grade"]["incarnation"] == expected_incarnation
Retriable(timeout, rps, fatal=ProcessDead).call(fetch_info)
eprint(f"{self} is online")
......
from conftest import (
Cluster,
)
def test_sharding_reinitializes_on_restart(cluster: Cluster):
[i1] = cluster.deploy(instance_count=1)
assert i1.call("vshard.router.info") is not None
incarnation = i1.eval("return pico.instance_info().current_grade.incarnation")
# Instance silently dies without it's grade being updated
i1.kill()
# Instance restarts, it's incarnation is updated and governor reconfigures
# all the subsystems
i1.start()
i1.wait_online(expected_incarnation=incarnation + 1)
# Vshard is configured even though the configuration didn't change
assert i1.call("vshard.router.info") is not None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment