[Tarantool-patches] [PATCH] raft: make sure the leader stays ro till it clears the limbo

Serge Petrenko sergepetrenko at tarantool.org
Wed Nov 25 11:48:24 MSK 2020


24.11.2020 17:14, Cyrill Gorcunov пишет:
> On Tue, Nov 24, 2020 at 04:18:20PM +0300, Serge Petrenko wrote:
> ...
>>   	if (raft->state != RAFT_STATE_LEADER)
>> +		box_update_ro_summary();
>>   		return 0;
> Either indent is broken or curled braces are missed?

Yep, thanks!

Fixed on the branch.

diff --git a/src/box/raft.c b/src/box/raft.c
index fa2396b4f..aa84b82a6 100644
--- a/src/box/raft.c
+++ b/src/box/raft.c
@@ -164,9 +164,10 @@ box_raft_on_update_f(struct trigger *trigger, void 
*event)
          * only after it clears its synchro queue. It won't be able to 
process
          * requests earlier, anyway.
          */
-       if (raft->state != RAFT_STATE_LEADER)
+       if (raft->state != RAFT_STATE_LEADER) {
                 box_update_ro_summary();
                 return 0;
+       }
         /*
          * If the node became a leader, time to clear the synchro 
queue. But it
          * must be done in the worker fiber so as not to block the state

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list