Commit 10af85d6 authored by Jozsef Makai's avatar Jozsef Makai

MGM: recycling from r to q on startup

parent 3ddcbbfd
......@@ -774,7 +774,6 @@ WFE::Job::DoIt(bool issync)
eos::common::Mapping::VirtualIdentity lRootVid;
XrdOucErrInfo lError;
eos::common::Mapping::Root(lRootVid);
eos_static_info("queue=\"%s\"", mActions[0].mQueue.c_str());
int retc = 0;
time_t storetime = 0;
......@@ -2280,9 +2279,9 @@ void
WFE::MoveFromRBackToQ() {
std::string queries[2];
for (size_t i = 0; i < 2; ++i) {
queries[i] = gOFS->MgmProcWorkflowPath.c_str();
queries[i] += "/";
for (auto& query : queries) {
query = gOFS->MgmProcWorkflowPath.c_str();
query += "/";
}
{
......@@ -2303,9 +2302,8 @@ WFE::MoveFromRBackToQ() {
XrdOucString stdErr;
eos::common::Mapping::VirtualIdentity rootvid;
eos::common::Mapping::Root(rootvid);
for (size_t i = 0; i < 2; ++i) {
eos_static_debug("query-path=%s", queries[i].c_str());
gOFS->_find(queries[i].c_str(),
for (const auto& query : queries) {
gOFS->_find(query.c_str(),
errInfo,
stdErr,
rootvid,
......@@ -2327,8 +2325,6 @@ WFE::MoveFromRBackToQ() {
if (job.Load(wfEntry) == 0) {
if (!job.IsSync()) {
job.Move("r", "q", job.mActions[0].mTime);
} else {
job.Delete("r", job.mActions[0].mSavedOnDay);
}
} else {
eos_static_err("msg=\"cannot load workflow entry during recycling from r queue\" value=\"%s\"", wfEntry.c_str());
......
......@@ -320,6 +320,11 @@ XrdMgmOfs::InitializeFileView()
// Load all the quota nodes from the namespace
Quota::LoadNodes();
if (MgmMaster.IsMaster() && Initialized == kBooted) {
WFE::MoveFromRBackToQ();
}
return nullptr;
}
......@@ -1470,7 +1475,7 @@ XrdMgmOfs::Configure(XrdSysError& Eroute)
eos_crit("Cannot add global config queue %s\n", FstConfigQueue.c_str());
}
std::string out = "";
std::string out;
eos::common::GlobalConfig::gConfig.PrintBroadCastMap(out);
fprintf(stderr, "%s", out.c_str());
......@@ -1607,14 +1612,14 @@ XrdMgmOfs::Configure(XrdSysError& Eroute)
// Create recycle directory
try {
eosmd = eosView->getContainer(Recycle::gRecyclingPrefix.c_str());
eosmd = eosView->getContainer(Recycle::gRecyclingPrefix);
} catch (const eos::MDException& e) {
eosmd = nullptr;
}
if (!eosmd) {
try {
eosmd = eosView->createContainer(Recycle::gRecyclingPrefix.c_str(), true);
eosmd = eosView->createContainer(Recycle::gRecyclingPrefix, true);
eosmd->setMode(S_IFDIR | S_IRWXU);
eosView->updateContainerStore(eosmd.get());
eos_info("%s permissions are %o", Recycle::gRecyclingPrefix.c_str(),
......@@ -1740,7 +1745,7 @@ XrdMgmOfs::Configure(XrdSysError& Eroute)
std::ostringstream oss;
oss << "ipc://" << MgmArchiveDir.c_str() << "archive_frontend.ipc";
mArchiveEndpoint = oss.str();
XrdMqSharedHash* hash = 0;
XrdMqSharedHash* hash = nullptr;
// Disable some features if we are only a redirector
if (!MgmRedirector) {
......
Markdown is supported
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