Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
eos
QuarkDB
Commits
b69be9ed
Commit
b69be9ed
authored
Apr 15, 2020
by
Georgios Bitzes
Browse files
raft: re-add support for pre-vote in RaftTalker
parent
f03b5eea
Pipeline
#1561219
passed with stages
in 113 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/raft/RaftTalker.cc
View file @
b69be9ed
...
...
@@ -203,10 +203,16 @@ std::future<redisReplyPtr> RaftTalker::appendEntries(
return
qcl
->
execute
(
payload
);
}
std
::
future
<
redisReplyPtr
>
RaftTalker
::
requestVote
(
const
RaftVoteRequest
&
req
)
{
std
::
future
<
redisReplyPtr
>
RaftTalker
::
requestVote
(
const
RaftVoteRequest
&
req
,
bool
preVote
)
{
RedisRequest
payload
;
payload
.
emplace_back
(
"RAFT_REQUEST_VOTE"
);
if
(
preVote
)
{
payload
.
emplace_back
(
"RAFT_REQUEST_PRE_VOTE"
);
}
else
{
payload
.
emplace_back
(
"RAFT_REQUEST_VOTE"
);
}
payload
.
emplace_back
(
std
::
to_string
(
req
.
term
));
payload
.
emplace_back
(
req
.
candidate
.
toString
());
payload
.
emplace_back
(
std
::
to_string
(
req
.
lastIndex
));
...
...
src/raft/RaftTalker.hh
View file @
b69be9ed
...
...
@@ -47,7 +47,7 @@ public:
RaftTerm
prevTerm
,
LogIndex
commit
,
const
std
::
vector
<
RaftSerializedEntry
>
&
entries
);
std
::
future
<
redisReplyPtr
>
requestVote
(
const
RaftVoteRequest
&
req
);
std
::
future
<
redisReplyPtr
>
requestVote
(
const
RaftVoteRequest
&
req
,
bool
preVote
=
false
);
std
::
future
<
redisReplyPtr
>
fetch
(
LogIndex
index
);
std
::
future
<
redisReplyPtr
>
resilveringStart
(
const
ResilveringEventID
&
id
);
...
...
Write
Preview
Supports
Markdown
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