mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2026-05-07 04:41:31 -05:00
LogsDB: tweak catchup timeout
This commit is contained in:
+12
-7
@@ -544,15 +544,20 @@ class ReqResp {
|
||||
|
||||
void resendTimedOutRequests() {
|
||||
auto now = eggsNow();
|
||||
auto cutoffTime = now - LogsDB::RESPONSE_TIMEOUT;
|
||||
auto defaultCutoffTime = now - LogsDB::RESPONSE_TIMEOUT;
|
||||
auto releaseCutoffTime = now - LogsDB::SEND_RELEASE_INTERVAL;
|
||||
auto readCutoffTime = now - LogsDB::READ_TIMEOUT;
|
||||
auto cutoffTime = now;
|
||||
for (auto& r : _requests) {
|
||||
if (unlikely(r.second.header.kind == LogMessageKind::RELEASE)) {
|
||||
if (r.second.sentTime < releaseCutoffTime) {
|
||||
r.second.sentTime = now;
|
||||
_requestsToSend.emplace_back(&r.second);
|
||||
}
|
||||
continue;
|
||||
switch (r.second.header.kind) {
|
||||
case LogMessageKind::RELEASE:
|
||||
cutoffTime = releaseCutoffTime;
|
||||
break;
|
||||
case LogMessageKind::LOG_READ:
|
||||
cutoffTime = readCutoffTime;
|
||||
break;
|
||||
default:
|
||||
cutoffTime = defaultCutoffTime;
|
||||
}
|
||||
if (r.second.sentTime < cutoffTime) {
|
||||
r.second.sentTime = now;
|
||||
|
||||
+2
-1
@@ -71,10 +71,11 @@ public:
|
||||
static constexpr size_t REPLICA_COUNT = 5;
|
||||
static constexpr Duration PARTITION_TIME_SPAN = 12_hours;
|
||||
static constexpr Duration RESPONSE_TIMEOUT = 10_ms;
|
||||
static constexpr Duration READ_TIMEOUT = 1_sec;
|
||||
static constexpr Duration SEND_RELEASE_INTERVAL = 300_ms;
|
||||
static constexpr Duration LEADER_INACTIVE_TIMEOUT = 1_sec;
|
||||
static constexpr size_t IN_FLIGHT_APPEND_WINDOW = 1 << 8;
|
||||
static constexpr size_t CATCHUP_WINDOW = 1 << 4 ;
|
||||
static constexpr size_t CATCHUP_WINDOW = 1 << 8 ;
|
||||
|
||||
LogsDB() = delete;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user