We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 545a044 commit c26f6e4Copy full SHA for c26f6e4
contrib/raftable/raftable.c
@@ -46,6 +46,7 @@ static struct {
46
int *leader;
47
} shared;
48
49
+static bool try_next_leader = true;
50
static int leadersock = -1;
51
static WorkerConfig wcfg;
52
static char *peerstr;
@@ -78,8 +79,8 @@ static void disconnect_leader(void)
78
79
if (leadersock >= 0)
80
{
81
close(leadersock);
82
+ try_next_leader = true;
83
}
- select_next_peer();
84
leadersock = -1;
85
86
@@ -172,7 +173,8 @@ static bool connect_leader(timeout_t *timeout)
172
173
174
HostPort *leaderhp;
175
- if (*shared.leader == NOBODY) select_next_peer();
176
+// if (*shared.leader == NOBODY) select_next_peer();
177
+ if (try_next_leader) select_next_peer();
178
179
leaderhp = wcfg.peers + *shared.leader;
180
0 commit comments