Commit 749caab8 authored by David COME's avatar David COME
Browse files

Added a mechanism to set up the last Fseq

Because it was never set up mcorrectly and hard coded to zero
parent 3c310375
......@@ -133,6 +133,7 @@ namespace daemon {
return false;
} else {
std::vector<tapegateway::FileToMigrateStruct*>& jobs=filesToMigrateList->filesToMigrate();
m_lastFseq = jobs.front()->fseq() -1;
injectBulkMigrations(jobs);
return true;
}
......
......@@ -98,6 +98,10 @@ public:
* calls to requestInjection.
*/
void finish();
uint64_t lastFSeq() const {
return m_lastFseq;
}
private:
/**
* Create all the tape-read and write-disk tasks for set of files to retrieve
......@@ -183,6 +187,16 @@ private:
/// maximal number of cumulated byte requested. at once
const uint64_t m_maxByte;
/**The last fseq used on the tape. We should not see this but
* IT is computed by subtracting 1 to fSeg of the first file to migrate we
* receive. That part is done by the
* MigrationTaskInjector.::synchronousInjection. Thus, we compute it into
* that function and retrieve/set it within MountSession executeWrite
* after we make sure synchronousInjection returned true. To do so, we
* need to store it
*/
uint64_t m_lastFseq;
};
} //end namespace daemon
......
......@@ -217,6 +217,8 @@ void castor::tape::tapeserver::daemon::MountSession::executeWrite(LogContext & l
m_castorConf.tapebridgeBulkRequestMigrationMaxFiles,lc);
drtp.setTaskInjector(&mti);
if (mti.synchronousInjection()) {
twst.setlastFseq(mti.lastFSeq());
// We have something to do: start the session by starting all the
// threads.
mm.startThreads();
......
......@@ -45,10 +45,19 @@ public:
castor::log::LogContext & lc, MigrationReportPacker & repPacker,
uint64_t filesBeforeFlush, uint64_t bytesBeforeFlush):
TapeSingleThreadInterface<TapeWriteTaskInterface>(drive, vid, lc),
m_filesBeforeFlush(filesBeforeFlush),m_bytesBeforeFlush(bytesBeforeFlush),
m_drive(drive), m_reportPacker(repPacker), m_vid(vid), m_lastFseq(0),
m_compress(0) {}
m_filesBeforeFlush(filesBeforeFlush),
m_bytesBeforeFlush(bytesBeforeFlush),
m_drive(drive), m_reportPacker(repPacker), m_vid(vid),
m_lastFseq(-1),
m_compress(true) {}
/**
*
* @param lastFseq
*/
void setlastFseq(uint64_t lastFseq){
m_lastFseq=lastFseq;
}
private:
/**
* Function to open the WriteSession
......@@ -141,7 +150,23 @@ private:
castor::tape::drives::DriveInterface& m_drive;
MigrationReportPacker & m_reportPacker;
const std::string m_vid;
const uint32_t m_lastFseq;
/**
* the last fseq that has been written on the tape = the starting point
* of our session. The last Fseq is computed by subtracting 1 to fSeg
* of the first file to migrate we receive. That part is done by the
* MigrationTaskInjector.::synchronousInjection. Thus, we compute it into
* that function and retrieve/set it within MountSession executeWrite
* after we make sure synchronousInjection returned true.
*
* It should be const, but it cant
* (because there is no mutable function member in c++)
*/
uint64_t m_lastFseq;
/**
* Should the compression be enabled ? This is currently hard coded to true
*/
const bool m_compress;
};
}}}}
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