diff --git a/common/dataStructures/RepackInfo.cpp b/common/dataStructures/RepackInfo.cpp index c5855d9cd717cadd6a3ab68cff9a664e25cfa093..2f8700cc1ac877fe96f52e2d2deba4b3abbd8064 100644 --- a/common/dataStructures/RepackInfo.cpp +++ b/common/dataStructures/RepackInfo.cpp @@ -37,10 +37,6 @@ std::string toString(RepackInfo::Type type) { std::string toString(RepackInfo::Status status) { switch(status) { - case RepackInfo::Status::Aborted: - return "Aborted"; - case RepackInfo::Status::Aborting: - return "Aborting"; case RepackInfo::Status::Complete: return "Complete"; case RepackInfo::Status::Failed: diff --git a/common/dataStructures/RepackInfo.hpp b/common/dataStructures/RepackInfo.hpp index 4b38c97b1cbff7342ec3d73f9fe0f54600d9ba93..1d188ca172352bc50d68cea9dfbfa1d6826bddbb 100644 --- a/common/dataStructures/RepackInfo.hpp +++ b/common/dataStructures/RepackInfo.hpp @@ -43,10 +43,8 @@ struct RepackInfo { ToExpand = 2, Starting = 3, Running = 4, - Aborting = 5, - Aborted = 6, - Complete = 7, - Failed = 8, + Complete = 5, + Failed = 6, Undefined = 999 } status; uint64_t totalFilesToArchive; diff --git a/objectstore/RetrieveRequest.cpp b/objectstore/RetrieveRequest.cpp index 8058477b6e0a25a72f5a60622cce333d74e24fcf..7325e3fc71bf22eddf8f7d4b2e1e87fa871998d6 100644 --- a/objectstore/RetrieveRequest.cpp +++ b/objectstore/RetrieveRequest.cpp @@ -729,7 +729,7 @@ void RetrieveRequest::updateLifecycleTiming(serializers::RetrieveRequest& payloa typedef ::cta::objectstore::serializers::RetrieveJobStatus RetrieveJobStatus; LifecycleTimingsSerDeser lifeCycleSerDeser; lifeCycleSerDeser.deserialize(payload.lifecycle_timings()); - switch(retrieveJob.status() == RetrieveJobStatus::RJS_ToTransferForUser){ + switch(retrieveJob.status()){ case RetrieveJobStatus::RJS_ToTransferForUser: if(retrieveJob.totalretries() == 0){ //totalretries = 0 then this is the first selection of the request diff --git a/objectstore/cta.proto b/objectstore/cta.proto index 3c3e30afc38ce4e6fc180e26f3c5662f5a6dc3c7..1e4d465f5a761c0054cf4d83774e54779ec158e3 100644 --- a/objectstore/cta.proto +++ b/objectstore/cta.proto @@ -492,10 +492,8 @@ enum RepackRequestStatus { RRS_ToExpand = 2; RRS_Starting = 3; RRS_Running = 4; - RRS_Aborting = 5; - RRS_Aborted = 6; - RRS_Complete = 7; - RRS_Failed = 8; + RRS_Complete = 5; + RRS_Failed = 6; } // In order to properly handle retries in case of failure during reporting, we hold diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 758fe391fe8dddf7392790eff857b89ae115d018..fd445943c84a690c6b4c90b2a5de1609fa6dd890 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -1038,7 +1038,7 @@ void OStoreDB::setRetrieveJobBatchReportedToUser(std::list<cta::SchedulerDatabas log::ScopedParamContainer params(lc); params.add("fileId", j->archiveFile.archiveFileID) .add("objectAddress", castFromSchedDBJob(j)->m_retrieveRequest.getAddressIfSet()); - lc.log(log::ERR, "In OStoreDB::setRetrieveJobBatchReported(): unexpected job status. Leaving the job as-is."); + lc.log(log::ERR, "In OStoreDB::setRetrieveJobBatchReportedToUser(): unexpected job status. Leaving the job as-is."); } } } @@ -1793,6 +1793,7 @@ void OStoreDB::RepackRetrieveSuccessesReportBatch::report(log::LogContext& lc) { objectstore::ScopedExclusiveLock rrl(m_repackRequest); timingList.insertAndReset("successStatsLockTime", t); m_repackRequest.fetch(); + m_repackRequest.setStatus(common::dataStructures::RepackInfo::Status::Running); timingList.insertAndReset("successStatsFetchTime", t); m_repackRequest.reportRetriveSuccesses(ssl); timingList.insertAndReset("successStatsUpdateTime", t); @@ -2291,7 +2292,7 @@ void OStoreDB::RepackRequest::addSubrequests(std::list<Subrequest>& repackSubreq //------------------------------------------------------------------------------ void OStoreDB::RepackRequest::expandDone() { // We are now done with the repack request. We can set its status. - ScopedSharedLock rrl(m_repackRequest); + ScopedExclusiveLock rrl(m_repackRequest); m_repackRequest.fetch(); // After expansion, 2 statuses are possible: starting (nothing reported as done) or running (anything reported as done). // We can find that out from the statistics... diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index 7abb7a8c1086d4ee14038d8fb0a61f005bbc0b17..ad12e5c892c0e611b9c4a8fd6f92308fcdcbd563 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -526,6 +526,7 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques fSeq = std::max(fSeq, maxAddedFSeq + 1); repackRequest->m_dbReq->setLastExpandedFSeq(fSeq); } + repackRequest->m_dbReq->expandDone(); } //------------------------------------------------------------------------------ diff --git a/scheduler/SchedulerDatabase.cpp b/scheduler/SchedulerDatabase.cpp index 866d19a13fe490ae3b6e2857f3462670bd968e3c..4c257ef242e7f756b4507b6d67f9cde89aaa26a5 100644 --- a/scheduler/SchedulerDatabase.cpp +++ b/scheduler/SchedulerDatabase.cpp @@ -27,7 +27,7 @@ cta::SchedulerDatabase::~SchedulerDatabase() throw() { } SchedulerDatabase::RepackRequestStatistics::RepackRequestStatistics() { typedef common::dataStructures::RepackInfo::Status Status; - for (auto & s: {Status::Aborted, Status::Aborting, Status::Complete, Status::Failed, Status::Pending, + for (auto & s: {Status::Complete, Status::Failed, Status::Pending, Status::Running, Status::Starting, Status::ToExpand}) operator [](s) = 0; }