Skip to content

Remove unnecessary catalogue DB queries from QueueCleanupRunner

As part of the analysis done in https://gitlab.cern.ch/cta/operations/-/issues/967 / #155 (closed), we have found that a large part of the RdbmsCatalogue::getTapesByVid(...) queries come from QueueCleanupRunner::runOnePass(...).

Indeed, as we can see on QueueCleanupRunner.cpp#L45, RdbmsCatalogue::getTapesByVid(...) is being called for unnecessarily for every queue in the object store.

We only need to do it the flag queue.doCleanup is true. This alone should allow us to reduce the number of queries by a large amount.

There is already similar fix on main / 214f79ab for this (not released yet), but I will recreate it separately on release_4.8.3 so that we can have this isolated fix on v4.8.4-1.

Edited by Joao Afonso