Skip to content
Snippets Groups Projects
Commit 32019d8b authored by Eric Cano's avatar Eric Cano
Browse files

Added support for forcible shutdown in OStoreDB::ArchiveMount::getNextJobBatch()

It was wrongly added to OStoreDB::ArchiveMount::getNextJob() instead in a05ad490.
parent ac187f44
No related branches found
No related tags found
No related merge requests found
...@@ -1622,6 +1622,18 @@ std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> > OStoreDB::ArchiveMoun ...@@ -1622,6 +1622,18 @@ std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> > OStoreDB::ArchiveMoun
objectstore::RootEntry re(m_objectStore); objectstore::RootEntry re(m_objectStore);
objectstore::ScopedSharedLock rel(re); objectstore::ScopedSharedLock rel(re);
re.fetch(); re.fetch();
// First, check we should not forcibly go down. In such an occasion, we just find noting to do.
// Get drive register
{
objectstore::DriveRegister dr(re.getDriveRegisterAddress(), m_objectStore);
ScopedSharedLock drl(dr);
dr.fetch();
auto drs = dr.getDriveState(mountInfo.drive);
if (!drs.desiredDriveState.up && drs.desiredDriveState.forceDown) {
logContext.log(log::INFO, "In OStoreDB::ArchiveMount::getNextJobBatch(): returning no job as we are forcibly going down.");
return std::list<std::unique_ptr<SchedulerDatabase::ArchiveJob> >();
}
}
auto aql = re.dumpArchiveQueues(); auto aql = re.dumpArchiveQueues();
rel.release(); rel.release();
std::string aqAddress; std::string aqAddress;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment