From bd8d47076c02c501bc789c9f5284577d50a20ed7 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Mon, 23 Dec 2024 18:59:15 -0300 Subject: [PATCH] Update SQLiteNode.cpp --- sqlitecluster/SQLiteNode.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlitecluster/SQLiteNode.cpp b/sqlitecluster/SQLiteNode.cpp index 74339d29f..d22f55ea8 100644 --- a/sqlitecluster/SQLiteNode.cpp +++ b/sqlitecluster/SQLiteNode.cpp @@ -1287,9 +1287,11 @@ void SQLiteNode::_onMESSAGE(SQLitePeer* peer, const SData& message) { if (peer == _leadPeer && currentCommitDifference >= 12'500 && !_blockedCommandPort) { SINFO("Node is lagging behind, closing command port so it can catch up."); _server.blockCommandPort(blockReason); + _blockedCommandPort = true; } else if (currentCommitDifference < 1'000 && _blockedCommandPort) { SINFO("Node is caught up enough, unblocking command port."); _server.unblockCommandPort(blockReason); + _blockedCommandPort = false; } // Classify and process the message if (SIEquals(message.methodLine, "LOGIN")) {