+box.cfg({
+ listen = instance_uri(INSTANCE_ID);
+ replication_connect_quorum = 3;
+ replication = {
+ instance_uri(1);
+ instance_uri(2);
+ instance_uri(3);
+ instance_uri(4);
+ instance_uri(5);
+ };
+})
+
+NUM_INSTANCES = 5
+BROKEN_QUORUM = NUM_INSTANCES + 1
+
+
+test_run:create_cluster(SERVERS, "replication", {args="0.1"})
+test_run:wait_fullmesh(SERVERS)
+current_leader_id = 1
+test_run:switch(SERVERS[current_leader_id])
+box.cfg{replication_synchro_timeout=1}
+test_run:switch('default')
+
+-- Testcase body.
+for i=1,10 do \
+ new_leader_id = random(current_leader_id, 1, #SERVERS) \
+ test_run:switch(SERVERS[new_leader_id]) \
+ box.cfg{read_only=false} \
+ f1 = fiber.create(function() \
+ pcall(box.space.sync:truncate{}) \
+ end) \
+ f2 = fiber.create(function() \
+ for i=1,10000 do box.space.sync:insert{i} end \
+ end) \
+ test_run:switch('default') \
+ test_run:switch(SERVERS[current_leader_id]) \
+ box.cfg{read_only=true} \
+ test_run:switch('default') \
+ current_leader_id = new_leader_id \
+end
+
+-- Teardown.