Commit 7ebc5efc authored by Eric Cano's avatar Eric Cano
Browse files

Added thread name to MigrationReportPacker.

Added missing call to finish for the memory manager in MigrationTaskInjector.
Added missing setting of task injector to the disk read thread pool in MountSession::executeWrite.
Fixed missing setting of m_vid member variable in TapeWriteSingleThread.
Fixed settig of wrong parameteres in castorConf variable in MountSessionGooddayMigration unit test.
Added validation of the migrated files checksums in MountSessionGooddayMigration.
parent e1c581f0
......@@ -173,6 +173,7 @@ m_parent(parent) {
}
void MigrationReportPacker::WorkerThread::run(){
m_parent.m_lc.pushOrReplace(log::Param("thread", "ReportPacker"));
client::ClientInterface::RequestReport chrono;
try{
......
......@@ -49,7 +49,7 @@ namespace daemon {
uint64_t maxFiles, uint64_t byteSizeThreshold,castor::log::LogContext lc):
m_thread(*this),m_memManager(mm),m_tapeWriter(tapeWriter),
m_diskReader(diskReader),m_client(client),m_lc(lc),
m_maxFiles(maxFiles), m_maxByte(byteSizeThreshold)
m_maxFiles(maxFiles), m_maxByte(byteSizeThreshold)
{
}
......@@ -147,6 +147,7 @@ namespace daemon {
m_parent.m_lc.log(LOG_INFO,"No more file to migrate: triggering the end of session.\n");
m_parent.m_tapeWriter.finish();
m_parent.m_diskReader.finish();
m_parent.m_memManager.finish();
break;
} else {
m_parent.m_lc.log(LOG_INFO,"In MigrationTaskInjector::WorkerThread::run(): got empty list, but not last call");
......
......@@ -215,6 +215,7 @@ void castor::tape::tapeserver::daemon::MountSession::executeWrite(LogContext & l
MigrationTaskInjector mti(mm, drtp, twst, m_clientProxy,
m_castorConf.tapebridgeBulkRequestMigrationMaxBytes,
m_castorConf.tapebridgeBulkRequestMigrationMaxFiles,lc);
drtp.setTaskInjector(&mti);
if (mti.synchronousInjection()) {
// We have something to do: start the session by starting all the
// threads.
......
......@@ -46,7 +46,8 @@ public:
uint64_t filesBeforeFlush, uint64_t bytesBeforeFlush):
TapeSingleThreadInterface<TapeWriteTaskInterface>(drive, vid, lc),
m_filesBeforeFlush(filesBeforeFlush),m_bytesBeforeFlush(bytesBeforeFlush),
m_drive(drive), m_reportPacker(repPacker), m_lastFseq(0), m_compress(0) {}
m_drive(drive), m_reportPacker(repPacker), m_vid(vid), m_lastFseq(0),
m_compress(0) {}
private:
/**
......@@ -95,7 +96,9 @@ private:
virtual void run() {
try
{
m_logContext.pushOrReplace(log::Param("thread", "TapeWrite"));
// First we have to initialise the tape read session
m_logContext.log(LOG_DEBUG, "Starting tape write thread");
std::auto_ptr<castor::tape::tapeFile::WriteSession> rs(openWriteSession());
uint64_t bytes=0;
......@@ -118,6 +121,7 @@ private:
else{
flush("End of TapeWriteWorkerThread::run() (flushing",bytes,files);
m_reportPacker.reportEndOfSession();
m_logContext.log(LOG_DEBUG, "Finishing tape write thread");
return;
}
}
......
......@@ -48,7 +48,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <xfs/platform_defs-x86_64.h>
using namespace castor::tape::tapeserver;
......@@ -334,16 +333,16 @@ TEST(tapeServer, MountSessionGooddayMigration) {
MountSession::CastorConf castorConf;
castorConf.rtcopydBufsz = 1024*1024; // 1 MB memory buffers
castorConf.rtcopydNbBufs = 10;
castorConf.tapebridgeBulkRequestRecallMaxBytes = UINT64_C(100)*1000*1000*1000;
castorConf.tapebridgeBulkRequestRecallMaxFiles = 1000;
castorConf.tapebridgeBulkRequestMigrationMaxBytes = UINT64_C(100)*1000*1000*1000;
castorConf.tapebridgeBulkRequestMigrationMaxFiles = 1000;
castorConf.tapeserverdDiskThreads = 1;
MountSession sess(VDQMjob, logger, mockSys, tpConfig, castorConf);
sess.execute();
simRun.wait();
// for (std::vector<struct expectedResult>::iterator i = expected.begin();
// i != expected.end(); i++) {
// ASSERT_EQ(i->checksum, sim.m_receivedChecksums[i->fSeq]);
// }
for (std::vector<struct expectedResult>::iterator i = expected.begin();
i != expected.end(); i++) {
ASSERT_EQ(i->checksum, sim.m_receivedChecksums[i->fSeq]);
}
}
}
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