[Tarantool-patches] [PATCH v4 00/12] raft: introduce manual elections and fix a bug with re-applying rolled back transactions

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Apr 20 01:37:10 MSK 2021


On top of the branch I made this:

====================
diff --git a/src/box/box.cc b/src/box/box.cc
index 59925962d..b026dfe05 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -1582,16 +1582,21 @@ box_promote(void)
 		 */
 		if (box_election_mode == ELECTION_MODE_MANUAL)
 			raft_stop_candidate(box_raft(), false);
+		else
+			assert(false);
 		if (rc != 0) {
+			assert(false);
 			in_promote = false;
 			return -1;
 		}
 		if (!box_raft()->is_enabled) {
+			assert(false);
 			diag_set(ClientError, ER_RAFT_DISABLED);
 			in_promote = false;
 			return -1;
 		}
 		if (box_raft()->state != RAFT_STATE_LEADER) {
+			assert(false);
 			diag_set(ClientError, ER_INTERFERING_PROMOTE,
 				 box_raft()->leader);
 			in_promote = false;
====================

And all the tests passed (except hanging election qsync stress, but it
didn't crash). This means there are not enough tests. But I didn't
have time to help adding any to cover this assertions yet.


More information about the Tarantool-patches mailing list