[Tarantool-patches] [PATCH v4 11/16] box: make promote on the current leader a no-op

Sergey Petrenko sergepetrenko at tarantool.org
Fri Jul 23 10:45:10 MSK 2021


22.07.2021 01:26, Vladislav Shpilevoy пишет:
> Thanks for the patch!
>
> Could you please add a test? Not even necessary in its own file. You
> could use qsync_basic/election_basic.

Ok, sure. I think gh-6034-election-promote-bump-term suits our needs better.

==============================

diff --git a/test/replication/gh-6034-election-promote-bump-term.result 
b/test/replication/gh-6034-election-promote-bump-term.result
index 8be4e8243..3999cfcc9 100644
--- a/test/replication/gh-6034-election-promote-bump-term.result
+++ b/test/replication/gh-6034-election-promote-bump-term.result
@@ -19,3 +19,12 @@ assert(box.info.election.term == term + 1)
   | ---
   | - true
   | ...
+
+-- Consequent promotes are no-ops on the leader.
+box.ctl.promote()
+ | ---
+ | ...
+assert(box.info.election.term == term + 1)
+ | ---
+ | - true
+ | ...
diff --git 
a/test/replication/gh-6034-election-promote-bump-term.test.lua 
b/test/replication/gh-6034-election-promote-bump-term.test.lua
index 1e814bf5d..52429394b 100644
--- a/test/replication/gh-6034-election-promote-bump-term.test.lua
+++ b/test/replication/gh-6034-election-promote-bump-term.test.lua
@@ -7,3 +7,7 @@ box.cfg{election_mode='off'}
  term = box.info.election.term
  box.ctl.promote()
  assert(box.info.election.term == term + 1)
+
+-- Consequent promotes are no-ops on the leader.
+box.ctl.promote()
+assert(box.info.election.term == term + 1)

==============================



More information about the Tarantool-patches mailing list