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

Workaround for bug CASTOR-4829: tapegateway: should request positioning by...

Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq.
This forces the tape gateways recalls to be positioned by block (which should be the case in practice currently).
This workaround can be removed once the tape gateway version 2.1.15 is deployed.
This workaround is necessary for mixed environement with 2.1.14 tape gateways and 2.1.15 tapeserverd (intended at initial release time).
parent 9f9575a8
......@@ -219,6 +219,10 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
RecallTaskInjector rti(mm, trst, dwtp, m_clientProxy,
m_castorConf.bulkRequestRecallMaxFiles,
m_castorConf.bulkRequestRecallMaxBytes,lc);
// Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq
// In order to implement the fix, the task injector needs to know the type
// of the client
rti.setClientType(m_volInfo.clientType);
trst.setTaskInjector(&rti);
// We are now ready to put everything in motion. First step is to check
......
......@@ -104,6 +104,12 @@ void RecallTaskInjector::startThreads() {
//------------------------------------------------------------------------------
void RecallTaskInjector::injectBulkRecalls(const std::vector<castor::tape::tapegateway::FileToRecallStruct*>& jobs) {
for (std::vector<tapegateway::FileToRecallStruct*>::const_iterator it = jobs.begin(); it != jobs.end(); ++it) {
// Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq
// When the client is a tape gateway, we should *always* position by block id.
if (tapegateway::TAPE_GATEWAY == m_clientType) {
(*it)->setPositionCommandCode(tapegateway::TPPOSIT_BLKID);
}
LogContext::ScopedParam sp[]={
LogContext::ScopedParam(m_lc, Param("NSHOSTNAME", (*it)->nshost())),
......
......@@ -27,6 +27,9 @@
#include "castor/log/LogContext.hpp"
#include "castor/server/BlockingQueue.hpp"
#include "castor/server/Threading.hpp"
//Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq
#include "castor/tape/tapegateway/PositionCommandCode.hpp"
#include "castor/tape/tapegateway/ClientType.hpp"
namespace castor{
namespace tape{
......@@ -72,6 +75,13 @@ public:
virtual ~RecallTaskInjector();
/**
* Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq
*/
void setClientType(tapegateway::ClientType clientType) {
m_clientType = clientType;
}
/**
* Function for a feed-back loop purpose between RecallTaskInjector and
* TapeReadSingleThread. When TapeReadSingleThread::popAndRequestMoreJobs detects
......@@ -191,6 +201,9 @@ private:
//maximal number of cumulated byte requested. at once
const uint64_t m_maxBytes;
// Workaround for bug CASTOR-4829: tapegateway: should request positioning by blockid for recalls instead of fseq
tapegateway::ClientType m_clientType;
};
} //end namespace daemon
......
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