LogsDB: tweak catchup timeout

This commit is contained in:
Miroslav Crnic
2024-03-18 12:00:27 +00:00
parent c8cda7e4db
commit dfcabdba97
2 changed files with 14 additions and 8 deletions
+12 -7
View File
@@ -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
View File
@@ -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;