From ad6f79ad0ca1c669b0c5553f51e8171283743f1f Mon Sep 17 00:00:00 2001
From: Yaroslav Dynnikov <yaroslav.dynnikov@gmail.com>
Date: Fri, 1 Jul 2022 15:15:48 +0300
Subject: [PATCH] fix: ignore raft messages with wrong destination

---
 src/traft/node.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/traft/node.rs b/src/traft/node.rs
index f746454c03..b24c2aa4e2 100644
--- a/src/traft/node.rs
+++ b/src/traft/node.rs
@@ -737,6 +737,9 @@ fn raft_main_loop(
                     Err(e) => notify.notify_err(e),
                 },
                 NormalRequest::Step(msg) => {
+                    if msg.to != raw_node.raft.id {
+                        continue;
+                    }
                     if let Err(e) = raw_node.step(msg) {
                         tlog!(Error, "{e}");
                     }
-- 
GitLab