Commit b9c1cc60 authored by Steven Murray's avatar Steven Murray
Browse files

[Catalogue] operations#179 Slow `cta-admin sq` even when there is very little activity

Scheduler::getQueuesAndMountSummaries() now handles the case when a tape pool
cannot be found in the catalgue.
parent 4c26512b
......@@ -1644,17 +1644,20 @@ std::list<common::dataStructures::QueueAndMountSummary> Scheduler::getQueuesAndM
for (auto & mountOrQueue: ret) {
if (common::dataStructures::MountType::ArchiveForUser==mountOrQueue.mountType || common::dataStructures::MountType::ArchiveForRepack==mountOrQueue.mountType) {
const auto tapePool = m_catalogue.getTapePool(mountOrQueue.tapePool);
mountOrQueue.tapesCapacity = tapePool->capacityBytes;
mountOrQueue.filesOnTapes = tapePool->nbPhysicalFiles;
mountOrQueue.dataOnTapes = tapePool->dataBytes;
mountOrQueue.emptyTapes = tapePool->nbEmptyTapes;
mountOrQueue.disabledTapes = tapePool->nbDisabledTapes;
mountOrQueue.fullTapes = tapePool->nbFullTapes;
mountOrQueue.readOnlyTapes = tapePool->nbReadOnlyTapes;
// Please note that archived and exported tapes are NOT taken into account
// for the moment because they are not currently supported
const auto nbNonWritableTape = tapePool->nbDisabledTapes + tapePool->nbFullTapes + tapePool->nbReadOnlyTapes;
mountOrQueue.writableTapes = (tapePool->nbTapes >= nbNonWritableTape) ? tapePool->nbTapes - nbNonWritableTape : 0;
if (tapePool) {
mountOrQueue.tapesCapacity = tapePool->capacityBytes;
mountOrQueue.filesOnTapes = tapePool->nbPhysicalFiles;
mountOrQueue.dataOnTapes = tapePool->dataBytes;
mountOrQueue.emptyTapes = tapePool->nbEmptyTapes;
mountOrQueue.disabledTapes = tapePool->nbDisabledTapes;
mountOrQueue.fullTapes = tapePool->nbFullTapes;
mountOrQueue.readOnlyTapes = tapePool->nbReadOnlyTapes;
// Please note that archived and exported tapes are NOT taken into account
// for the moment because they are not currently supported
const auto nbNonWritableTape = tapePool->nbDisabledTapes + tapePool->nbFullTapes + tapePool->nbReadOnlyTapes;
mountOrQueue.writableTapes =
(tapePool->nbTapes >= nbNonWritableTape) ? tapePool->nbTapes - nbNonWritableTape : 0;
}
} else if (common::dataStructures::MountType::Retrieve==mountOrQueue.mountType) {
// Get info for this tape.
cta::catalogue::TapeSearchCriteria tsc;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment