neutron/neutron/tests/functional/common
Jakub Libosvar 50eee19723 ovn: Use ovsdb-client to create neutron_pg_drop
Previously we used short living OVN database connection to create
neutron_pg_drop Port Group before workers were spawned. The
pre_fork_initialize actually happens after the api workers are spawned
anyways and it blocks spawning of other workers, such as maintenance,
rpc or periodic. If the OVN database was large it may take several
minutes to connect to the database at scale and this blocks spawning of
other workers. That means connecting to OVN in pre_fork is not a good
idea.

This patch replaces the mechanism by using ovsdb-client to send a
transaction without connecting to the database and downloading the whole
content. The command does following, everything is on the server side:

 1) With timeout 0 it waits for neutron_pg_drop Port Group. If the PG is
    present, the transaction finishes and nothing happens.

 2) If the PG is not present, it times out immediately and commits new
    entries that effectivelly creates neutron_pg_drop Port Group with
    implicit ACLs to block ingress and egress traffic.

Closes-Bug: #1991579
Co-Authored-By: Terry Wilson <twilson@redhat.com>

Change-Id: I27af495f96a3ea88dd31345dbfb55f1be8faabd6
2022-10-04 02:15:58 +00:00
..
ovn ovn: Use ovsdb-client to create neutron_pg_drop 2022-10-04 02:15:58 +00:00
__init__.py Switch to using neutron.common.utils:replace_file() 2015-11-16 08:44:04 +01:00
test_utils.py [Functional] Fix tests for oslo.db>=12.1.0 2022-09-08 17:48:28 +00:00