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

test: wakeup after ddl (fails due to stale lsn)

parent e0daa68d
No related branches found
No related tags found
1 merge request!516OpDdl create space
Pipeline #18505 passed
import pytest
from conftest import Cluster
......@@ -315,6 +316,52 @@ def test_ddl_create_space_partial_failure(cluster: Cluster):
i3.fail_to_start()
@pytest.mark.xfail(reason="lsn isn't replicated properly")
def test_successful_wakeup_after_ddl(cluster: Cluster):
# Manual replicaset distribution.
# 5 instances are needed for quorum (2 go offline).
i1 = cluster.add_instance(replicaset_id="r1", wait_online=True)
i2 = cluster.add_instance(replicaset_id="r1", wait_online=True)
i3 = cluster.add_instance(replicaset_id="r2", wait_online=True)
i4 = cluster.add_instance(replicaset_id="r2", wait_online=True)
i5 = cluster.add_instance(replicaset_id="r3", wait_online=True)
# This is a replicaset follower which will be catching up
i4.terminate()
# This is a replicaset master (sole member) which will be catching up
i5.terminate()
# Propose a space creation which will succeed
space_def = dict(
id=666,
name="space_name_conflict",
format=[dict(name="id", type="unsigned", is_nullable=False)],
primary_key=[dict(field="id")],
distribution=dict(kind="global"),
)
index = i1.ddl_create_space(space_def)
i2.call(".proc_sync_raft", index, (3, 0))
i3.call(".proc_sync_raft", index, (3, 0))
# Space created
assert i1.call("box.space._space:get", 666) is not None
assert i2.call("box.space._space:get", 666) is not None
assert i3.call("box.space._space:get", 666) is not None
# Wake up the catcher-uppers
i4.start()
i5.start()
# FIXME: currently wait_lsn never stops, because lsn doesn't get replicated
# tarantool bug?
i4.wait_online()
i5.wait_online()
# They caught up!
assert i4.call("box.space._space:get", 666) is not None
assert i5.call("box.space._space:get", 666) is not None
def test_ddl_from_snapshot(cluster: Cluster):
# Second instance is only for quorum
i1, i2 = cluster.deploy(instance_count=2, init_replication_factor=2)
......
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