Explorar o código

Only mark term when the heartbeat failed.

Jing Yang %!s(int64=3) %!d(string=hai) anos
pai
achega
2ae284f37b
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/heartbeats.rs

+ 2 - 1
src/heartbeats.rs

@@ -116,9 +116,10 @@ where
                 rpc_client.append_entries(args.clone())
             })
             .await?;
-        term_watermark.mark(response.term);
         if term == response.term {
             beat_ticker.tick(beat);
+        } else {
+            term_watermark.mark(response.term);
         }
         Ok(())
     }