Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
RedisLabs Raft
Commits
c4e2dab1
Unverified
Commit
c4e2dab1
authored
Apr 25, 2022
by
Ozan Tezcan
Committed by
GitHub
Apr 25, 2022
Browse files
Delete unused return value of raft_update_commit_idx() (#103)
parent
391120db
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/raft_server.c
View file @
c4e2dab1
...
@@ -2053,7 +2053,7 @@ static int index_cmp(const void *a, const void *b)
...
@@ -2053,7 +2053,7 @@ static int index_cmp(const void *a, const void *b)
return
va
>
vb
?
-
1
:
1
;
return
va
>
vb
?
-
1
:
1
;
}
}
static
int
raft_update_commit_idx
(
raft_server_t
*
me
)
static
void
raft_update_commit_idx
(
raft_server_t
*
me
)
{
{
raft_index_t
indexes
[
me
->
num_nodes
];
raft_index_t
indexes
[
me
->
num_nodes
];
int
num_voters
=
0
;
int
num_voters
=
0
;
...
@@ -2077,8 +2077,6 @@ static int raft_update_commit_idx(raft_server_t* me)
...
@@ -2077,8 +2077,6 @@ static int raft_update_commit_idx(raft_server_t* me)
raft_entry_release
(
ety
);
raft_entry_release
(
ety
);
}
}
return
0
;
}
}
raft_index_t
raft_get_index_to_sync
(
raft_server_t
*
me
)
raft_index_t
raft_get_index_to_sync
(
raft_server_t
*
me
)
...
@@ -2109,10 +2107,7 @@ int raft_flush(raft_server_t* me, raft_index_t sync_index)
...
@@ -2109,10 +2107,7 @@ int raft_flush(raft_server_t* me, raft_index_t sync_index)
raft_node_set_match_idx
(
me
->
node
,
sync_index
);
raft_node_set_match_idx
(
me
->
node
,
sync_index
);
}
}
int
e
=
raft_update_commit_idx
(
me
);
raft_update_commit_idx
(
me
);
if
(
e
!=
0
)
{
return
e
;
}
raft_msg_id_t
last
=
me
->
read_queue_tail
?
me
->
read_queue_tail
->
msg_id
:
0
;
raft_msg_id_t
last
=
me
->
read_queue_tail
?
me
->
read_queue_tail
->
msg_id
:
0
;
...
@@ -2128,7 +2123,7 @@ int raft_flush(raft_server_t* me, raft_index_t sync_index)
...
@@ -2128,7 +2123,7 @@ int raft_flush(raft_server_t* me, raft_index_t sync_index)
raft_send_appendentries
(
me
,
me
->
nodes
[
i
]);
raft_send_appendentries
(
me
,
me
->
nodes
[
i
]);
}
}
e
=
raft_apply_all
(
me
);
int
e
=
raft_apply_all
(
me
);
if
(
e
!=
0
)
{
if
(
e
!=
0
)
{
return
e
;
return
e
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment