> hi,all
> 
> 
>  the default inactivity probe interval of ovsdb relay server to nb/sb ovsdb 
> server is 5000ms.
>  I set an active connection as follow,set inactivity probe interval to 
> 120000ms :
> _uuid               : 5ddab5a4-a267-42b4-9dd4-76d55855a109
> external_ids        : {}
> inactivity_probe    : 120000
> is_connected        : true
> max_backoff         : []
> other_config        : {}
> status              : {sec_since_connect="0", state=ACTIVE}
> target              : "tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641"


Hmm.  How exactly did you configure that?

> 
> ovn-ovsdb-nb.openstack.svc.cluster.local is a vip 
> but the inactivity probe is still 5000> 
> 2021-08-24T12:34:17.313Z|04924|reconnect|DBG|tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641:
>  idle 120225 ms, sending inactivity probe
> 2021-08-24T12:36:17.759Z|05854|reconnect|DBG|tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641:
>  idle 120446 ms, sending inactivity probe
> 2021-08-24T12:37:06.326Z|06145|reconnect|DBG|tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641:
>  idle 6853 ms, sending inactivity probe
> 2021-08-24T12:37:11.330Z|06155|reconnect|DBG|tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641:
>  idle 5004 ms, sending inactivity probe

This looks like you have 2 different connections.  One with 5000 and
one with 120000 inactivity probe interval.

I suspect that relay server is started something like this:

ovsdb-server ... --remote=db:OVN_Northbound,NB_Global,connections \
   relay:OVN_Northbound:tcp:ovn-ovsdb-nb.openstack.svc.cluster.local:6641

And the connection showed above is configured in this 'connections' row, right?

Connections configured with '--remote' are not the same as 'relay' connections.
So, in this case ovsdb-server will create a relay with the remote specified
in a 'relay:' part and with a default inactivity probe interval.  And it will
open a connection to what is specified in a database row pointed by '--remote'
with a configured values for that connection.  It will expect a client on the
other side of the connection.  So, this connection will connect main server
with relay, but they both will just wait database queries from each other.

Configuring things this way you will also, probably, have a self-connection
from the main server to itself, right?


In general, currently, there is no way to configure inactivity probe interval
for "relay" --> "main server" connection, you can only configure it in the
opposite direction.
Does default inactivity interval cause problems for your setup?

I have a plan to implement that though.  There are several options how to do 
that:

1. Add a simple cmdline argument like '--relay-inactivity-probe=N' that will
   affect all the relay databases on this ovsdb-server process.

   Pros: Simple
   Cons: Affects all relay databases of this process, change requires restart,
         configuration applied to a single process.

2. appctl command that can be executed against relay server, e.g.
     ovs-appctl ovsdb-server/relay-set-inactivity-probe OVN_Northbound 120000

   Pros: Simple
   Cons: Doesn't survive restart, configuration applied to a single process.

3. Add more configuration options to the 'relay:' syntax, e.g.:
     relay:inactivity-probe=120000:OVN_Northbound:tcp:127.0.0.1:6641

   Pros: Simple
   Cons: Doesn't look like a good API.

4. Have a separate small database with a relay configuration, e.g.

     ovsdb-server ... relay:db:OVSDB_Relay,Relay,relays relay.db

   And a small tool to interact with this local database:

     ovs-relayctl add-relay OVN_Northbound \
                  tcp:127.0.0.1:6641 inactivity-probe=120000

   This will add a new relay configuration to the OVSDB_Relay database
   and ovsdb-server will start relaying it.

   Pros: Lots of things can be configured including inactivity probes and
         backoff.  Can be extended with relay specific configs in the future.
         Survives restart.  relay.db can be relayed from a separate 
ovsdb-server,
         if needed, so there is no need to configure each relay separately.
   Cons: A bit more complex implementation.

   Example of a complex setup would be:
        # start a main database server
     a. ovsdb-server --remote=db:OVN_Nortbound:NB_Global,connections ovnnb.db

        # start a small database server that only holds relay.db
     b. ovsdb-server --remote=pssl:6647:server relay.db
        ovs-relayctl add-relay OVN_Northbound tcp:your-server:6641 
inactivity-probe=120000

        # start a relay server that relays OVSDB_Relay and relays everything
        # that configured in this db.  If OVSDB_Relay db has configured
        # OVN_Northbound db, start accepting connections on remotes configured 
there.
     c. ovsdb-server --remote=db:OVN_Nortbound:NB_Global,connections   \
                  relay:db:OVSDB_Relay,Relay,relays \
                  relay:OVSDB_Relay:ssl:server:6647

     Once this started, server 'c' will connect to server 'b' and get the 
OVSDB_Relay
     database, then it will look at the content of OVSDB_Relay database and 
connect to
     the server 'a' to start relaying the OVN_Northbound database.

   Additional cons: Configuration looks insanely complex at a first glance :) 
even
                    if it's really not.

   Simpler setup without relaying the OVSDB_Relay database:

      a. ovsdb-server --remote=db:OVN_Nortbound:NB_Global,connections ovnnb.db

      b. ovsdb-server --remote=db:OVN_Nortbound:NB_Global,connections \
                      relay:db:OVSDB_Relay,Relay,relays relay.db
         ovs-relayctl add-relay OVN_Northbound tcp:your-server:6641 
inactivity-probe=120000

      Here relay.db is local for a particular relay, but this means that 
configuration
      (ovs-relayctl) command should be issued separately for each relay server.

Hope this makes some sense. :)
What do you think?  Which option looks better in your opinion?

Best regards, Ilya Maximets.
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to