[ovs-git] [openvswitch/ovs] 8aa0f0: ovsdb-cs: Perform forced reconnects without a back...

Dumitru Ceara noreply at github.com
Fri Jul 23 16:36:12 UTC 2021


  Branch: refs/heads/branch-2.15
  Home:   https://github.com/openvswitch/ovs
  Commit: 8aa0f037471d1708fe94d9377d4999efda06703a
      https://github.com/openvswitch/ovs/commit/8aa0f037471d1708fe94d9377d4999efda06703a
  Author: Dumitru Ceara <dceara at redhat.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M lib/jsonrpc.c
    M lib/jsonrpc.h
    M lib/ovsdb-cs.c
    M python/ovs/db/idl.py
    M python/ovs/jsonrpc.py
    M tests/ovsdb-idl.at

  Log Message:
  -----------
  ovsdb-cs: Perform forced reconnects without a backoff.

The ovsdb-cs layer triggers a forced reconnect in various cases:
- when an inconsistency is detected in the data received from the
  remote server.
- when the remote server is running in clustered mode and transitioned
  to "follower", if the client is configured in "leader-only" mode.
- when explicitly requested by upper layers (e.g., by the user
  application, through the IDL layer).

In such cases it's desirable that reconnection should happen as fast as
possible, without the current exponential backoff maintained by the
underlying reconnect object.  Furthermore, since 3c2d6274bcee ("raft:
Transfer leadership before creating snapshots."), leadership changes
inside the clustered database happen more often and, therefore,
"leader-only" clients need to reconnect more often too.

Forced reconnects call jsonrpc_session_force_reconnect() which will not
reset backoff.  To make sure clients reconnect as fast as possible in
the aforementioned scenarios we first call the new API,
jsonrpc_session_reset_backoff(), in ovsdb-cs, for sessions that are in
state CS_S_MONITORING (i.e., the remote is likely still alive and
functioning fine).

jsonrpc_session_reset_backoff() resets the number of backoff-free
reconnect retries to the number of remotes configured for the session,
ensuring that all remotes are retried exactly once with backoff 0.

This commit also updates the Python IDL and jsonrpc implementations.
The Python IDL wasn't tracking the IDL_S_MONITORING state explicitly,
we now do that too.  Tests were also added to make sure the IDL forced
reconnects happen without backoff.

Reported-at: https://bugzilla.redhat.com/1977264
Suggested-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list