async checkHeartbeat() {
    if (this.remoteNodeEvictionPrevented) {
      // Fake the heartbeat while the node eviction prevention is enabled
      // otherwise when the node eviction prevention is disabled
      // the node will be evicted if it did not send a heartbeat before disabling the protection.
      this.lastHeartbeat = Date.now();
      return;
    }

    if (this.state === stateEnum.EVICTED) {
      return;
    }

    const now = Date.now();

    if (now - this.lastHeartbeat > this.heartbeatDelay) {
      if (this.state === stateEnum.MISSING_HEARTBEAT) {
        await this.evictNode({
          broadcast: true,
          reason: "heartbeat timeout",
        });
      } else {
        this.state = stateEnum.MISSING_HEARTBEAT;
      }
    } else {
      this.state = stateEnum.SANE;
    }
  }
Checks that we did receive a heartbeat from the remote node
If a heartbeat is missing, we allow 1 heartbeat round for the remote node
to recover, otherwise we evict it from the cluster.