Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
eos
QuarkDB
Commits
06beeab0
Commit
06beeab0
authored
Jun 27, 2018
by
Georgios Bitzes
Browse files
Simply retry requests rejected by the write tracker
And add a comment detailing what's going on.
parent
06b80d38
Pipeline
#428482
passed with stages
in 30 minutes and 25 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/raft/RaftDispatcher.cc
View file @
06beeab0
...
...
@@ -333,9 +333,12 @@ LinkStatus RaftDispatcher::service(Connection *conn, RedisRequest &req) {
LogIndex
index
=
journal
.
getLogSize
();
if
(
!
writeTracker
.
append
(
index
,
RaftEntry
(
snapshot
->
term
,
std
::
move
(
req
)),
conn
->
getQueue
(),
redisDispatcher
))
{
qdb_warn
(
"appending write for index = "
<<
index
<<
" and term "
<<
snapshot
->
term
<<
" failed when servicing client request"
);
return
conn
->
err
(
"unavailable"
);
// We were most likely hit by the following race:
// - We retrieved the state snapshot.
// - The raft term was changed in the meantime, we lost leadership.
// - The journal rejected the entry due to term mismatch.
// Let's simply retry.
return
this
->
service
(
conn
,
req
);
}
return
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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