mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-01 18:56:00 +08:00
Fix timeout issue when using >3 coordinators
The calculation to determine how many non-timeout replies had been received was incorrect, causing rollback/rollforward requests to not be sent, causing the dynamic knob subsystem to get stuck.
This commit is contained in:
parent
7fc4f0d649
commit
e8354d82bd
@ -22,6 +22,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <numeric>
|
||||
|
||||
#include "fdbserver/Knobs.h"
|
||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||
@ -171,7 +172,11 @@ class GetCommittedVersionQuorum {
|
||||
throw;
|
||||
} else if (self->totalRepliesReceived == self->cfis.size() && self->quorumVersion.canBeSet() &&
|
||||
!self->quorumVersion.isError()) {
|
||||
if (self->replies.size() >= self->cfis.size() / 2 + 1) {
|
||||
size_t nonTimeoutReplies =
|
||||
std::accumulate(self->replies.begin(), self->replies.end(), 0, [](int value, auto const& p) {
|
||||
return value + p.second.size();
|
||||
});
|
||||
if (nonTimeoutReplies >= self->cfis.size() / 2 + 1) {
|
||||
// Make sure to trigger the quorumVersion if a timeout
|
||||
// occurred, a quorum disagree on the committed version, and
|
||||
// there are no more incoming responses. Note that this means
|
||||
|
Loading…
x
Reference in New Issue
Block a user