Commit df5c532f authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Revert "Add notification from taped to the catalogue when tape mounted for read or write."

This reverts commit f9249bb1.
parent 3625e3f7
......@@ -55,8 +55,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession(
cta::tape::daemon::TapedProxy & initialProcess,
cta::server::ProcessCap & capUtils,
const DataTransferConfig & castorConf,
cta::Scheduler & scheduler,
cta::catalogue::Catalogue &catalogue):
cta::Scheduler & scheduler):
m_log(log),
m_sysWrapper(sysWrapper),
m_driveConfig(driveConfig),
......@@ -65,8 +64,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession(
m_mc(mc),
m_intialProcess(initialProcess),
m_capUtils(capUtils),
m_scheduler(scheduler),
m_catalogue(catalogue)
m_scheduler(scheduler)
{
}
......@@ -238,8 +236,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
TapeReadSingleThread trst(*drive, m_mc, tsr, m_volInfo,
m_castorConf.bulkRequestRecallMaxFiles,m_capUtils,rwd,lc,rrp,
m_castorConf.useLbp, m_castorConf.useRAO, m_castorConf.externalEncryptionKeyScript,*retrieveMount,
m_catalogue);
m_castorConf.useLbp, m_castorConf.useRAO, m_castorConf.externalEncryptionKeyScript,*retrieveMount);
DiskWriteThreadPool dwtp(m_castorConf.nbDiskThreads,
rrp,
rwd,
......@@ -341,8 +338,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
m_castorConf.maxBytesBeforeFlush,
m_castorConf.useLbp,
m_castorConf.externalEncryptionKeyScript,
*archiveMount,
m_catalogue);
*archiveMount);
DiskReadThreadPool drtp(m_castorConf.nbDiskThreads,
m_castorConf.bulkRequestMigrationMaxFiles,
......
......@@ -64,8 +64,7 @@ namespace daemon {
cta::tape::daemon::TapedProxy & initialProcess,
cta::server::ProcessCap &capUtils,
const DataTransferConfig & castorConf,
cta::Scheduler &scheduler,
cta::catalogue::Catalogue &catalogue);
cta::Scheduler &scheduler);
/**
* Execute the session and return the type of action to be performed
......@@ -147,10 +146,6 @@ namespace daemon {
* The scheduler, i.e. the local interface to the Objectstore DB
*/
cta::Scheduler &m_scheduler;
/**
* Reference to the catalogue interface
*/
cta::catalogue::Catalogue &m_catalogue;
/**
* Returns the string representation of the specified mount type
......
......@@ -487,7 +487,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayRecall) {
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
castor::tape::tapeserver::daemon::DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
// 8) Run the data transfer session
sess.execute();
......@@ -692,7 +692,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionWrongRecall) {
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
// 8) Run the data transfer session
sess.execute();
......@@ -900,7 +900,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionRAORecall) {
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
castor::tape::tapeserver::daemon::DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
// 8) Run the data transfer session
sess.execute();
......@@ -1073,7 +1073,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionNoSuchDrive) {
castor::messages::TapeserverProxyDummy initialProcess;
cta::server::ProcessCapDummy capUtils;
DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
ASSERT_NO_THROW(sess.execute());
std::string temp = logger.getLog();
ASSERT_NE(std::string::npos, logger.getLog().find("Could not stat path: /dev/noSuchDrive"));
......@@ -1223,7 +1223,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionFailtoMount) {
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys,
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
ASSERT_NO_THROW(sess.execute());
std::string temp = logger.getLog();
ASSERT_NE(std::string::npos, logger.getLog().find("Failed to mount the tape"));
......@@ -1354,7 +1354,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) {
cta::mediachanger::MediaChangerFacade mc(dummyLog);
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute();
std::string logToCheck = logger.getLog();
logToCheck += "";
......@@ -1504,7 +1504,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
cta::mediachanger::MediaChangerFacade mc(dummyLog);
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute();
std::string temp = logger.getLog();
temp += "";
......@@ -1659,7 +1659,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
cta::mediachanger::MediaChangerFacade mc(dummyLog);
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute();
std::string temp = logger.getLog();
temp += "";
......@@ -1819,7 +1819,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullOnFlushMigration) {
cta::mediachanger::MediaChangerFacade mc(dummyLog);
cta::server::ProcessCap capUtils;
castor::messages::TapeserverProxyDummy initialProcess;
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler, catalogue);
DataTransferSession sess("tapeHost", logger, mockSys, driveConfig, mc, initialProcess, capUtils, castorConf, scheduler);
sess.execute();
std::string temp = logger.getLog();
temp += "";
......
......@@ -38,8 +38,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeReadSingleThread(
const bool useLbp,
const bool useRAO,
const std::string & externalEncryptionKeyScript,
const cta::RetrieveMount& retrieveMount,
cta::catalogue::Catalogue &catalogue) :
const cta::RetrieveMount& retrieveMount) :
TapeSingleThreadInterface<TapeReadTask>(drive, mc, initialProcess, volInfo,
capUtils, lc, externalEncryptionKeyScript),
m_maxFilesRequest(maxFilesRequest),
......@@ -47,8 +46,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeReadSingleThread(
m_rrp(rrp),
m_useLbp(useLbp),
m_useRAO(useRAO),
m_retrieveMount(retrieveMount),
m_catalogue(catalogue){}
m_retrieveMount(retrieveMount){}
//------------------------------------------------------------------------------
//TapeCleaning::~TapeCleaning()
......@@ -302,7 +300,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
scoped.add("useLbp", m_useLbp);
scoped.add("detectedLbp", rs->isTapeWithLbp());
if (rs->isTapeWithLbp() && !m_useLbp) {
m_logContext.log(cta::log::WARNING, "Tapeserver started without LBP support"
m_logContext.log(cta::log::WARNING, "Tapserver started without LBP support"
" but the tape with LBP label mounted");
}
switch(m_drive.getLbpToUse()) {
......@@ -321,17 +319,6 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
}
m_initialProcess.reportState(cta::tape::session::SessionState::Running,
cta::tape::session::SessionType::Retrieve);
try {
m_catalogue.tapeMountedForRetrieve(m_volInfo.vid, m_drive.config.unitName);
} catch (cta::exception::Exception &ex) {
cta::log::ScopedParamContainer scoped(m_logContext);
params.add("tapeVid", m_volInfo.vid)
.add("tapeDrive", m_drive.config.unitName);
m_logContext.log(cta::log::WARNING,
"Failed to update catalogue for the tape mounted for retrieve.");
}
m_stats.waitReportingTime += timer.secs(cta::utils::Timer::resetCounter);
// Then we will loop on the tasks as they get from
// the task injector
......
......@@ -69,8 +69,7 @@ public:
const bool useLbp,
const bool useRAO,
const std::string & externalEncryptionKeyScript,
const cta::RetrieveMount &retrieveMount,
cta::catalogue::Catalogue &catalogue);
const cta::RetrieveMount &retrieveMount);
/**
* Set the task injector. Has to be done that way (and not in the constructor)
......@@ -160,10 +159,6 @@ private:
* on which we are reading
*/
const cta::RetrieveMount& m_retrieveMount;
/**
* Reference to the catalogue interface
*/
cta::catalogue::Catalogue &m_catalogue;
/// Helper virtual function to access the watchdog from parent class
virtual void countTapeLogError(const std::string & error) {
......
......@@ -38,8 +38,7 @@ castor::tape::tapeserver::drive::DriveInterface & drive,
cta::server::ProcessCap &capUtils,
uint64_t filesBeforeFlush, uint64_t bytesBeforeFlush,
const bool useLbp, const std::string & externalEncryptionKeyScript,
const cta::ArchiveMount & archiveMount,
cta::catalogue::Catalogue &catalogue):
const cta::ArchiveMount & archiveMount):
TapeSingleThreadInterface<TapeWriteTask>(drive, mc, tsr, volInfo,
capUtils, lc, externalEncryptionKeyScript),
m_filesBeforeFlush(filesBeforeFlush),
......@@ -50,8 +49,7 @@ castor::tape::tapeserver::drive::DriveInterface & drive,
m_compress(true),
m_useLbp(useLbp),
m_watchdog(mwd),
m_archiveMount(archiveMount),
m_catalogue(catalogue){}
m_archiveMount(archiveMount){}
//------------------------------------------------------------------------------
//TapeCleaning::~TapeCleaning()
......@@ -399,17 +397,6 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
m_initialProcess.reportState(cta::tape::session::SessionState::Running,
cta::tape::session::SessionType::Archive);
try {
m_catalogue.tapeMountedForArchive(m_volInfo.vid, m_drive.config.unitName);
} catch (cta::exception::Exception &ex) {
cta::log::ScopedParamContainer scoped(m_logContext);
params.add("tapeVid", m_volInfo.vid)
.add("tapeDrive", m_drive.config.unitName);
m_logContext.log(cta::log::WARNING,
"Failed to update catalogue for the tape mounted for archive.");
}
uint64_t bytes=0;
uint64_t files=0;
m_stats.waitReportingTime += timer.secs(cta::utils::Timer::resetCounter);
......
......@@ -70,8 +70,7 @@ public:
cta::server::ProcessCap &capUtils,
uint64_t filesBeforeFlush, uint64_t bytesBeforeFlush, const bool useLbp,
const std::string & externalEncryptionKeyScript,
const cta::ArchiveMount & archiveMount,
cta::catalogue::Catalogue &catalogue);
const cta::ArchiveMount & archiveMount);
/**
*
......@@ -198,11 +197,6 @@ private:
*/
const cta::ArchiveMount & m_archiveMount;
/**
* Reference to the catalogue interface
*/
cta::catalogue::Catalogue & m_catalogue;
protected:
/***
* Helper virtual function to access the watchdog from parent class
......
......@@ -1091,8 +1091,7 @@ int DriveHandler::runChild() {
driveHandlerProxy,
capUtils,
dataTransferConfig,
scheduler,
*catalogue);
scheduler);
auto ret = dataTransferSession.execute();
agentHeartbeat.stopAndWaitThread();
......
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