In the case of a large number of subclouds go offline, all the
endpoints of these subclouds need to update to unknown, currently we
are looping over every endpoint to update its status, the number of
total transactions for this operation is:
Total = number_of_subclouds X number_of_endpoint_types
The DB is throttled in this case, and it consumes a large amount of
time for dcmanager to process the RPC calls to update offline subclouds.
This commit introduces a DB API to update multiple endpoint statuses of
a subcloud, which transitions to unkown state, in a single DB
transaction.
Test:
- On the system controller, delete a large number of routes to the
subclouds to simulate many subclouds going offline.
- Time when dcmanager's message queue is cleared
The dcmanager's message queue is cleared faster after the change than
before the change.
- On the system controller, unmanage a subcloud.
All subcloud's endpoints change to unknown except the dc-cert endpoint.
Story: 2008960
Task: 43377
Signed-off-by: Yuxing Jiang <yuxing.jiang@windriver.com>
Change-Id: I941c1b47acc1f72ba54d879236632455c8bae628