Commit c76058ef authored by Eric Cano's avatar Eric Cano
Browse files

Expanded the minimal VFS creation script to align it with the one in the unit...

Expanded the minimal VFS creation script to align it with the one in the unit test. More base objects are now created.
Fixed uninitialized flag bug in TapeMountDecisionInfo::TapeMountDecisionInfo().
Removed unused VDQM parameter.
parent 1051b827
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "BackendVFS.hpp" #include "BackendVFS.hpp"
#include "RootEntry.hpp" #include "RootEntry.hpp"
#include "Agent.hpp"
#include <iostream> #include <iostream>
int main(void) { int main(void) {
...@@ -33,6 +34,20 @@ int main(void) { ...@@ -33,6 +34,20 @@ int main(void) {
cta::objectstore::RootEntry re(be); cta::objectstore::RootEntry re(be);
re.initialize(); re.initialize();
re.insert(); re.insert();
cta::objectstore::ScopedExclusiveLock rel(re);
re.fetch();
cta::objectstore::Agent ag(be);
ag.generateName("makeMinimalVFS");
ag.initialize();
cta::objectstore::CreationLog cl(cta::UserIdentity(1111, 1111), "systemhost",
time(NULL), "Initial creation of the object store structures");
re.addOrGetAgentRegisterPointerAndCommit(ag,cl);
rel.release();
ag.insertAndRegisterSelf();
rel.lock(re);
re.addOrGetDriveRegisterPointerAndCommit(ag, cl);
re.addOrGetSchedulerGlobalLockAndCommit(ag,cl);
rel.release();
std::cout << "New object store path: " << be.getParams()->getPath() << std::endl; std::cout << "New object store path: " << be.getParams()->getPath() << std::endl;
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << "Failed to initialise the root entry in a new VFS backend store" std::cerr << "Failed to initialise the root entry in a new VFS backend store"
......
...@@ -1220,7 +1220,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount> ...@@ -1220,7 +1220,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount>
OStoreDB::TapeMountDecisionInfo::TapeMountDecisionInfo( OStoreDB::TapeMountDecisionInfo::TapeMountDecisionInfo(
objectstore::Backend& os, objectstore::Agent& a): objectstore::Backend& os, objectstore::Agent& a):
m_objectStore(os), m_agent(a) {} m_lockTaken(false), m_objectStore(os), m_agent(a) {}
std::unique_ptr<SchedulerDatabase::RetrieveMount> std::unique_ptr<SchedulerDatabase::RetrieveMount>
......
...@@ -33,7 +33,6 @@ castor::tape::tapeserver::daemon::CatalogueConfig::CatalogueConfig() throw(): ...@@ -33,7 +33,6 @@ castor::tape::tapeserver::daemon::CatalogueConfig::CatalogueConfig() throw():
waitJobTimeoutSecs(0), waitJobTimeoutSecs(0),
mountTimeoutSecs(0), mountTimeoutSecs(0),
blockMoveTimeoutSecs(0), blockMoveTimeoutSecs(0),
vdqmDriveSyncIntervalSecs(0),
transferSessionTimerSecs(0) { transferSessionTimerSecs(0) {
} }
...@@ -53,8 +52,6 @@ castor::tape::tapeserver::daemon::CatalogueConfig ...@@ -53,8 +52,6 @@ castor::tape::tapeserver::daemon::CatalogueConfig
"MountTimeout", TAPESERVER_MOUNTTIMEOUT, log); "MountTimeout", TAPESERVER_MOUNTTIMEOUT, log);
config.blockMoveTimeoutSecs = castorConf.getConfEntInt("TapeServer", config.blockMoveTimeoutSecs = castorConf.getConfEntInt("TapeServer",
"BlkMoveTimeout", TAPESERVER_BLKMOVETIMEOUT, log); "BlkMoveTimeout", TAPESERVER_BLKMOVETIMEOUT, log);
config.vdqmDriveSyncIntervalSecs = castorConf.getConfEntInt("TapeServer",
"VdqmDriveSyncInterval", TAPESERVER_VDQMDRIVESYNCINTERVAL, log);
config.transferSessionTimerSecs = castorConf.getConfEntInt("TapeServer", config.transferSessionTimerSecs = castorConf.getConfEntInt("TapeServer",
"TransferSessionTimer", TAPESERVER_TRANSFERSESSION_TIMER, log); "TransferSessionTimer", TAPESERVER_TRANSFERSESSION_TIMER, log);
......
...@@ -57,13 +57,6 @@ struct CatalogueConfig { ...@@ -57,13 +57,6 @@ struct CatalogueConfig {
*/ */
time_t blockMoveTimeoutSecs; time_t blockMoveTimeoutSecs;
/**
* The time interval in seconds to wait between attempts to keep the vdqmd
* daemon synchronized with the state of a tape drive within the catalogue of
* the tapeserverd daemon.
*/
time_t vdqmDriveSyncIntervalSecs;
/** The delay in seconds the master process of the tapeserverd daemon should /** The delay in seconds the master process of the tapeserverd daemon should
* wait before launching another transfer session whilst the corresponding * wait before launching another transfer session whilst the corresponding
* drive is idle. * drive is idle.
......
...@@ -87,7 +87,15 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction ...@@ -87,7 +87,15 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// Create a sticky thread name, which will be overridden by the other threads // Create a sticky thread name, which will be overridden by the other threads
lc.pushOrReplace(log::Param("thread", "MainThread")); lc.pushOrReplace(log::Param("thread", "MainThread"));
// 2a) Get initial information from the client // 2a) Get initial information from the client
std::unique_ptr<cta::TapeMount> tapeMount(m_scheduler.getNextMount(m_driveConfig.getLogicalLibrary(), m_driveConfig.getUnitName())); std::unique_ptr<cta::TapeMount> tapeMount;
try {
tapeMount.reset(m_scheduler.getNextMount(m_driveConfig.getLogicalLibrary(), m_driveConfig.getUnitName()).release());
} catch (cta::exception::Exception & e) {
log::ScopedParamContainer localParams(lc);
localParams.add("errorMessage", e.getMessageValue());
lc.log(LOG_ERR, "Error while scheduling new mount. Putting the drive down.");
return MARK_DRIVE_AS_DOWN;
}
// No mount to be done found, that was fast... // No mount to be done found, that was fast...
if (!tapeMount.get()) if (!tapeMount.get())
return MARK_DRIVE_AS_UP; return MARK_DRIVE_AS_UP;
......
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