Merge "Cleanup stale entries only after worker manifest"

This commit is contained in:
Zuul 2021-06-25 14:05:10 +00:00 committed by Gerrit Code Review
commit e4f71bb162
2 changed files with 16 additions and 2 deletions

View File

@ -726,9 +726,16 @@ class AgentManager(service.PeriodicService):
if pci_device_list:
try:
# Don't ask conductor to cleanup stale entries while worker
# manifest is not complete. For N3000 device, it could get rid
# of a valid entry with a different PCI address but restored
# from previous database backup
cleanup_stale = \
os.path.exists(tsc.VOLATILE_WORKER_CONFIG_COMPLETE)
rpcapi.pci_device_update_by_host(context,
host_uuid,
pci_device_list)
pci_device_list,
cleanup_stale)
self._inventory_reported.add(self.PCI_DEVICE)
except exception.SysinvException:
LOG.exception("Sysinv Agent exception updating pci_device.")

View File

@ -532,10 +532,17 @@ class FpgaAgentManager(service.PeriodicService):
if pci_device_list:
LOG.info("reporting N3000 PCI devices for host %s: %s" %
(host_uuid, pci_device_list))
# Don't ask conductor to cleanup stale entries while worker
# manifest is not complete. For N3000 device, it could get rid
# of a valid entry with a different PCI address but restored
# from previous database backup
cleanup_stale = \
os.path.exists(tsc.VOLATILE_WORKER_CONFIG_COMPLETE)
rpcapi.pci_device_update_by_host(context,
host_uuid,
pci_device_list,
cleanup_stale=True)
cleanup_stale)
except Exception:
LOG.exception("Exception updating n3000 PCI devices, "
"this will likely cause problems.")