Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
eos
QuarkDB
Commits
b1d7bc2d
Commit
b1d7bc2d
authored
Mar 12, 2020
by
Georgios Bitzes
Browse files
Slightly simplify buildPayload method in RaftReplicator
parent
4020e0ff
Pipeline
#1481388
passed with stages
in 142 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
b1d7bc2d
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
## Unreleased
## Unreleased
### Bug fixes
### Bug fixes
-
Under complicated conditions
, replication towards a particular follower could become stuck.
-
Under complicated conditions
(follower is very far behind leader + network instabilities),
(to workaround, restart leader node)
replication towards a particular follower could become stuck.
(to workaround, restart leader node)
-
Running
``DEL``
on a lease key would cause all nodes in a cluster to crash
-
Running
``DEL``
on a lease key would cause all nodes in a cluster to crash
with an assertion.
``DEL``
will now simply release the given lease, as if
with an assertion.
``DEL``
will now simply release the given lease, as if
``lease-release``
had been called.
``lease-release``
had been called.
...
@@ -21,8 +21,9 @@ checkpoint for long-term storage.
...
@@ -21,8 +21,9 @@ checkpoint for long-term storage.
-
Attempt to detect potential
``MANIFEST``
corruption early by measuring mtime lag
-
Attempt to detect potential
``MANIFEST``
corruption early by measuring mtime lag
compared to newest SST file.
compared to newest SST file.
Many thanks to Pete Eby (ORNL) for finding and reporting the bug causing replication
Many thanks to Crystal Chua (AARNet) for the bug report and all support offered
to become stuck.
related to RocksDB's
``MANIFEST``
corruption issue, as well as to Pete Eby (ORNL)
for finding and reporting the bug causing replication to become stuck.
## 0.4.1 (2020-01-17)
## 0.4.1 (2020-01-17)
...
...
src/raft/RaftReplicator.cc
View file @
b1d7bc2d
...
@@ -91,9 +91,9 @@ RaftReplicaTracker::~RaftReplicaTracker() {
...
@@ -91,9 +91,9 @@ RaftReplicaTracker::~RaftReplicaTracker() {
}
}
bool
RaftReplicaTracker
::
buildPayload
(
LogIndex
nextIndex
,
int64_t
payloadLimit
,
bool
RaftReplicaTracker
::
buildPayload
(
LogIndex
nextIndex
,
int64_t
payloadLimit
,
std
::
vector
<
std
::
string
>
&
entries
,
int64_t
&
payloadSize
,
RaftTerm
&
lastEntryTerm
)
{
std
::
vector
<
std
::
string
>
&
entries
,
RaftTerm
&
lastEntryTerm
)
{
payloadSize
=
std
::
min
(
payloadLimit
,
journal
.
getLogSize
()
-
nextIndex
);
int64_t
payloadSize
=
std
::
min
(
payloadLimit
,
journal
.
getLogSize
()
-
nextIndex
);
entries
.
resize
(
payloadSize
);
entries
.
resize
(
payloadSize
);
RaftJournal
::
Iterator
iterator
=
journal
.
getIterator
(
nextIndex
,
true
);
RaftJournal
::
Iterator
iterator
=
journal
.
getIterator
(
nextIndex
,
true
);
...
@@ -322,11 +322,13 @@ bool RaftReplicaTracker::sendPayload(RaftTalker &talker, LogIndex nextIndex, int
...
@@ -322,11 +322,13 @@ bool RaftReplicaTracker::sendPayload(RaftTalker &talker, LogIndex nextIndex, int
LogIndex
commitIndexForTarget
=
journal
.
getCommitIndex
();
LogIndex
commitIndexForTarget
=
journal
.
getCommitIndex
();
std
::
vector
<
RaftSerializedEntry
>
entries
;
std
::
vector
<
RaftSerializedEntry
>
entries
;
if
(
!
buildPayload
(
nextIndex
,
payloadLimit
,
entries
,
payloadSize
,
lastEntryTerm
))
{
if
(
!
buildPayload
(
nextIndex
,
payloadLimit
,
entries
,
lastEntryTerm
))
{
state
.
observed
(
snapshot
->
term
+
1
,
{});
state
.
observed
(
snapshot
->
term
+
1
,
{});
return
false
;
return
false
;
}
}
payloadSize
=
entries
.
size
();
contact
=
std
::
chrono
::
steady_clock
::
now
();
contact
=
std
::
chrono
::
steady_clock
::
now
();
reply
=
talker
.
appendEntries
(
reply
=
talker
.
appendEntries
(
snapshot
->
term
,
snapshot
->
term
,
...
...
src/raft/RaftReplicator.hh
View file @
b1d7bc2d
...
@@ -82,7 +82,7 @@ private:
...
@@ -82,7 +82,7 @@ private:
void
triggerResilvering
();
void
triggerResilvering
();
bool
buildPayload
(
LogIndex
nextIndex
,
int64_t
payloadLimit
,
std
::
vector
<
RaftSerializedEntry
>
&
entries
,
bool
buildPayload
(
LogIndex
nextIndex
,
int64_t
payloadLimit
,
std
::
vector
<
RaftSerializedEntry
>
&
entries
,
int64_t
&
payloadSize
,
RaftTerm
&
lastEntryTerm
);
RaftTerm
&
lastEntryTerm
);
bool
sendPayload
(
RaftTalker
&
talker
,
LogIndex
nextIndex
,
int64_t
payloadLimit
,
bool
sendPayload
(
RaftTalker
&
talker
,
LogIndex
nextIndex
,
int64_t
payloadLimit
,
std
::
future
<
redisReplyPtr
>
&
reply
,
std
::
chrono
::
steady_clock
::
time_point
&
contact
,
int64_t
&
payloadSize
,
std
::
future
<
redisReplyPtr
>
&
reply
,
std
::
chrono
::
steady_clock
::
time_point
&
contact
,
int64_t
&
payloadSize
,
...
...
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