Commit 3bd24457 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[cta-taped] The repack management can be enabled or disabled via the...

[cta-taped] The repack management can be enabled or disabled via the DisableRepackManagement parameter in the configuration file
parent 7ab0ccbd
......@@ -291,6 +291,7 @@ void DriveState::setConfig(const cta::tape::daemon::TapedConfiguration& tapedCon
fillConfig(config->fileCatalogConfigFile);
fillConfig(config->authenticationProtocol);
fillConfig(config->authenticationSSSKeytab);
fillConfig(config->disableRepackManagement);
}
//------------------------------------------------------------------------------
......
......@@ -320,6 +320,11 @@ void MaintenanceHandler::exceptionThrowingRunChild(){
DiskReportRunner diskReportRunner(*scheduler);
RepackRequestManager repackRequestManager(*scheduler);
if(!runRepackRequestManager()){
m_processManager.logContext().log(log::INFO,
"In MaintenanceHandler::exceptionThrowingRunChild(): Repack management is disabled. No repack-related operations will run on this tapeserver.");
}
// Run the maintenance in a loop: garbage collector and disk reporter
try {
server::SocketPair::pollMap pollList;
......@@ -331,7 +336,9 @@ void MaintenanceHandler::exceptionThrowingRunChild(){
"In MaintenanceHandler::exceptionThrowingRunChild(): About to do a maintenance pass.");
gc.runOnePass(m_processManager.logContext());
diskReportRunner.runOnePass(m_processManager.logContext());
repackRequestManager.runOnePass(m_processManager.logContext());
if(runRepackRequestManager()){
repackRequestManager.runOnePass(m_processManager.logContext());
}
try {
server::SocketPair::poll(pollList, s_pollInterval - t.secs(), server::SocketPair::Side::parent);
receivedMessage=true;
......@@ -391,4 +398,11 @@ MaintenanceHandler::~MaintenanceHandler() {
}
}
//------------------------------------------------------------------------------
// MaintenanceHandler::runRepackRequestManager
//------------------------------------------------------------------------------
bool MaintenanceHandler::runRepackRequestManager() const {
return m_tapedConfig.disableRepackManagement.value() == "no";
}
}}} // namespace cta::tape::daemon
......@@ -44,6 +44,12 @@ public:
SubprocessHandler::ProcessingStatus processTimeout() override;
private:
void exceptionThrowingRunChild();
/**
* Returns true if the RepackRequestManager will be ran on this tapeserver,
* false otherwise
*/
bool runRepackRequestManager() const;
/** Reference to the process manager*/
cta::tape::daemon::ProcessManager & m_processManager;
/** The parameters */
......
......@@ -119,6 +119,8 @@ TapedConfiguration TapedConfiguration::createFromCtaConf(
// The central storage access configuration
ret.backendPath.setFromConfigurationFile(cf, generalConfigPath);
ret.fileCatalogConfigFile.setFromConfigurationFile(cf, generalConfigPath);
//Repack management configuration
ret.disableRepackManagement.setFromConfigurationFile(cf,generalConfigPath);
// Extract drive list from tpconfig + parsed config file
ret.driveConfigs = Tpconfig::parseFile(ret.tpConfigPath.value());
......@@ -151,6 +153,8 @@ TapedConfiguration TapedConfiguration::createFromCtaConf(
ret.backendPath.log(log);
ret.fileCatalogConfigFile.log(log);
ret.disableRepackManagement.log(log);
for (auto & i:ret.driveConfigs) {
i.second.log(log);
}
......
......@@ -136,6 +136,14 @@ struct TapedConfiguration {
/// The authentication protocol
cta::SourcedParameter<std::string> authenticationSSSKeytab{
"environment", "XrdSecSSSKT"};
//----------------------------------------------------------------------------
// Maintenance process configuration
//----------------------------------------------------------------------------
/// Usage of RepackRequestManager for repack-related operations
cta::SourcedParameter<std::string> disableRepackManagement {
"taped","DisableRepackManagement","no","Compile time default"
};
private:
/** A private dummy logger which will simplify the implementation of the
......
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