From c0dafea10b08ba8bbca6c1f1141f258138862989 Mon Sep 17 00:00:00 2001 From: Eric Cano <Eric.Cano@cern.ch> Date: Wed, 21 Jun 2017 17:56:49 +0200 Subject: [PATCH] Fixed wrong limits passed to archiveMount.getNextJobBatch(). Also added extra logs in ArchiveMount::getNextJobBatch(). --- scheduler/OStoreDB/OStoreDB.cpp | 18 ++++++++++++++++++ .../daemon/MigrationTaskInjector.cpp | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 8ba61f303f..fadee6d8c4 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -1721,6 +1721,13 @@ std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> > OStoreDB::ArchiveMoun std::list<std::unique_ptr<OStoreDB::ArchiveJob>> privateRet; uint64_t currentBytes=0; uint64_t currentFiles=0; + { + log::ScopedParamContainer params(logContext); + params.add("tapepool", mountInfo.tapePool) + .add("queueObject", aq.getAddressIfSet()) + .add("queueSize", aq.dumpJobs().size()); + logContext.log(log::INFO, "In ArchiveMount::getNextJobBatch(): archive queue found."); + } while (aq.dumpJobs().size()) { // We should build the list of jobs we intend to grab. We will attempt to // dequeue them in one go, updating jobs in parallel. If some jobs turn out @@ -1738,6 +1745,17 @@ std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> > OStoreDB::ArchiveMoun candidateJobs.emplace_back(new OStoreDB::ArchiveJob(job.address, m_objectStore, m_agentReference, *this)); candidateJobs.back()->tapeFile.copyNb = job.copyNb; } + { + log::ScopedParamContainer params(logContext); + params.add("tapepool", mountInfo.tapePool) + .add("queueObject", aq.getAddressIfSet()) + .add("candidatesCount", candidateJobs.size()) + .add("currentFiles", currentFiles) + .add("currentBytes", currentBytes) + .add("requestedFiles", filesRequested) + .add("requestedBytes", bytesRequested); + logContext.log(log::INFO, "In ArchiveMount::getNextJobBatch(): will process a set of candidate jobs."); + } // We now have a batch of jobs to try and dequeue. Should not be empty. // First add the jobs to the owned list of the agent. std::list<std::string> addedJobs; diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp index 38d155f28e..3e0e077805 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp @@ -158,7 +158,7 @@ namespace daemon { throw castor::tape::tapeserver::daemon::ErrorFlag(); } Request req = m_parent.m_queue.pop(); - auto jobs = m_parent.m_archiveMount.getNextJobBatch(req.filesRequested, req.filesRequested, m_parent.m_lc); + auto jobs = m_parent.m_archiveMount.getNextJobBatch(req.filesRequested, req.bytesRequested, m_parent.m_lc); uint64_t files=jobs.size(); uint64_t bytes=0; for (auto & j:jobs) bytes+=j->archiveFile.fileSize; -- GitLab