On 11/17/20 5:13 PM, Lorenzo Bianconi wrote:
> Introduce the following info useful for cluster debugging to
> cluster/status command:
> - time elapsed from last start/complete election
> - election trigger (e.g. timeout)
> - number of disconnections
> - time elapsed from last raft messaged received
> 
> Signed-off-by: Lorenzo Bianconi <[email protected]>
> ---
> Changes since v2:
> - move last_msg_tx in raft_handle_rpc()
> - store election_start and election_won in ms
> - improve comments
> ---
>  ovsdb/raft-private.h |  2 ++
>  ovsdb/raft.c         | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 37 insertions(+)
> 
> diff --git a/ovsdb/raft-private.h b/ovsdb/raft-private.h
> index 76b097b89..a69e37e5c 100644
> --- a/ovsdb/raft-private.h
> +++ b/ovsdb/raft-private.h
> @@ -90,6 +90,8 @@ struct raft_server {
>      /* For use in adding and removing servers: */
>      struct uuid requester_sid;  /* Nonzero if requested via RPC. */
>      struct unixctl_conn *requester_conn; /* Only if requested via unixctl. */
> +
> +    long long int last_msg_ts; /* Last received msg timestamp in ms. */
>  };
>  
>  void raft_server_destroy(struct raft_server *);
> diff --git a/ovsdb/raft.c b/ovsdb/raft.c
> index 760dfca6d..70215165f 100644
> --- a/ovsdb/raft.c
> +++ b/ovsdb/raft.c
> @@ -264,6 +264,12 @@ struct raft {
>      long long int election_base;    /* Time of last heartbeat from leader. */
>      long long int election_timeout; /* Time at which we start an election. */
>  
> +    long long int election_start;    /* Start election time. */
> +    long long int election_won;      /* Time of election completion. */
> +    bool leadership_transfer;        /* Was the leadership transferred? */

Really tiny nit: the comments here should probably be aligned with the
ones that already existed above.

Otherwise, this change looks good to me, thanks!

Acked-by: Dumitru Ceara <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to