Do not auto subquery load DistributedPortBindings

We observe excessive DB calls to load DistributedPortBindings,
We have enabled DVR and have some huge virtual routers with around
60 router interfaces scheduled on around 200 compute nodes. Under such
situation, subquery load DistributedPortBinding looks like not a very wise
idea, because it is not explicitly used.

I glance through the code and have a feeling that ml2_distributed_port_bindings
is not used except explicitly called. So IMO it is safe to change it to
default lazy load without causing serious regression.

Closes-bug: #1973576
Change-Id: Ib2c48bd5ad55e9c754a8e4938e6c5eafacc75dcc
This commit is contained in:
shenjiatong 2022-05-15 10:12:47 +08:00
parent b12a6a0747
commit 182044d628
1 changed files with 0 additions and 1 deletions

View File

@ -129,6 +129,5 @@ class DistributedPortBinding(model_base.BASEV2):
models_v2.Port,
load_on_pending=True,
backref=orm.backref("distributed_port_binding",
lazy='subquery',
cascade='delete'))
revises_on_change = ('port', )