[Tarantool-patches] [PATCH v4 07/12] raft: filter rows based on known peer terms

Serge Petrenko sergepetrenko at tarantool.org
Mon Apr 19 12:30:47 MSK 2021



18.04.2021 19:27, Vladislav Shpilevoy пишет:
>> diff --git a/test/replication/gh-5445-leader-inconsistency.result b/test/replication/gh-5445-leader-inconsistency.result
>> new file mode 100644
>> index 000000000..5c6169f50
>> --- /dev/null
>> +++ b/test/replication/gh-5445-leader-inconsistency.result
>> @@ -0,0 +1,292 @@
> <...>
>
>> +-- Old leader returns and old unconfirmed rows from it must be ignored.
>> +-- Note, it wins the elections fairly.
>> +test_run:cmd('start server '..leader..' with args="3 0.4 voter"')
>> + | ---
>> + | - true
>> + | ...
>> +test_run:wait_lsn(leader, next_leader)
>> + | ---
>> + | ...
>> +test_run:switch(leader)
>> + | ---
>> + | - true
>> + | ...
>> +test_run:wait_cond(function() return box.space.test:get{2} == nil end)
>> + | ---
>> + | - true
>> + | ...
>> +box.cfg{election_mode='candidate'}
>> + | ---
>> + | ...
>> +
>> +test_run:switch('default')
>> + | ---
>> + | - true
>> + | ...
>> +test_run:switch(next_leader)
> You might want to add a check here, that the 'next_leader'
> node didn't re-apply any rows from the old leader. So {2} still
> does not exist even after these two nodes are in full sync.
>

But there is such a check below (at the very end):

test_run:switch(next_leader)
  | ---
  | - true
  | ...
test_run:wait_upstream(1, {status='follow'})
  | ---
  | - true
  | ...
box.space.test:select{} -- 1
  | ---
  | - - [1]
  | ...




-- 
Serge Petrenko



More information about the Tarantool-patches mailing list