neutron/neutron/services/segments
Bence Romsics ed7bfa11de Avoid writing segments to the DB repeatedly
When:
* the segments service plugin is enabled and
* we have multiple rpc worker processes (as in the sum of rpc_workers
  and rpc_state_report_workers, since both kind processes agent
  state_reports) and
* many ovs-agents report physnets,
then rabbitmq dispatches the state_report messages between the workers
in a round robin fashion, therefore eventually the state_reports of the
same agent will hit all rpc workers.

Unfortunately all worker processes have a 'reported_hosts' set to
remember from which host it has seen agent reports already. But right
after a server start when that set is still empty, each worker will
unconditionally write the received physnet-segment information into
the db. This means we multiply the load on the db and rpc workers by
a factor of the rpc worker count.

This patch tries to reduce the load on the db by adding another early
return before the unconditional db write.

Change-Id: I935186b6ee95f0cae8dc05869d9742c8fb3353c3
Closes-Bug: #1952730
(cherry picked from commit 176503e610)
(cherry picked from commit dcb372b041)
(cherry picked from commit 0c909e3b55)
2021-12-08 15:27:03 +01:00
..
__init__.py Basic Extension and CRUD for Segments 2016-05-05 13:58:34 -06:00
db.py Avoid writing segments to the DB repeatedly 2021-12-08 15:27:03 +01:00
exceptions.py Filter subnets on fixed_ips segment 2020-03-13 22:51:36 +00:00
plugin.py Improve Subnet create performance 2021-06-23 15:35:53 +00:00