Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
76914527
Commit
76914527
authored
Oct 23, 2015
by
Daniele Kruse
Browse files
Trying to archive files for the first time: fixing bugs and adding missing information
parent
f20b955b
Changes
18
Hide whitespace changes
Inline
Side-by-side
scheduler/ArchiveMount.cpp
View file @
76914527
...
...
@@ -59,6 +59,13 @@ std::string cta::ArchiveMount::getPoolName() const {
return
m_dbMount
->
mountInfo
.
tapePool
;
}
//------------------------------------------------------------------------------
// getNbFiles
//------------------------------------------------------------------------------
uint32_t
cta
::
ArchiveMount
::
getNbFiles
()
const
{
return
m_dbMount
->
nbFilesCurrentlyOnTape
;
}
//------------------------------------------------------------------------------
// getMountTransactionId
//------------------------------------------------------------------------------
...
...
scheduler/ArchiveMount.hpp
View file @
76914527
...
...
@@ -101,6 +101,13 @@ namespace cta {
*/
virtual
std
::
string
getPoolName
()
const
;
/**
* Returns the mount transaction id.
*
* @return The mount transaction id.
*/
virtual
uint32_t
getNbFiles
()
const
;
/**
* Destructor.
*/
...
...
scheduler/OStoreDB/OStoreDB.cpp
View file @
76914527
...
...
@@ -1203,7 +1203,7 @@ std::unique_ptr<SchedulerDatabase::ArchiveMount>
m_agent
.
addToOwnership
(
t
.
getAddressIfSet
());
m_agent
.
commit
();
}
am
.
m_nextFseq
=
t
.
getLastFseq
()
+
1
;
am
.
nbFilesCurrentlyOnTape
=
t
.
getLastFseq
();
am
.
mountInfo
.
vid
=
t
.
getVid
();
t
.
setBusy
(
driveName
,
objectstore
::
Tape
::
MountType
::
Archive
,
hostName
,
startTime
,
m_agent
.
getAddressIfSet
());
...
...
@@ -1416,7 +1416,7 @@ auto OStoreDB::ArchiveMount::getNextJob() -> std::unique_ptr<SchedulerDatabase::
tp
.
commit
();
privateRet
->
archiveFile
=
privateRet
->
m_atfr
.
getArchiveFile
();
privateRet
->
remoteFile
=
privateRet
->
m_atfr
.
getRemoteFile
();
privateRet
->
nameServerTapeFile
.
tapeFileLocation
.
fSeq
=
m_nextFseq
++
;
privateRet
->
nameServerTapeFile
.
tapeFileLocation
.
fSeq
=
++
nbFilesCurrentlyOnTape
;
privateRet
->
nameServerTapeFile
.
tapeFileLocation
.
copyNb
=
privateRet
->
m_copyNb
;
privateRet
->
nameServerTapeFile
.
tapeFileLocation
.
vid
=
mountInfo
.
vid
;
privateRet
->
nameServerTapeFile
.
tapeFileLocation
.
blockId
=
...
...
scheduler/OStoreDB/OStoreDB.hpp
View file @
76914527
...
...
@@ -80,7 +80,6 @@ public:
ArchiveMount
(
objectstore
::
Backend
&
,
objectstore
::
Agent
&
);
objectstore
::
Backend
&
m_objectStore
;
objectstore
::
Agent
&
m_agent
;
uint64_t
m_nextFseq
;
public:
virtual
const
MountInfo
&
getMountInfo
();
virtual
std
::
unique_ptr
<
ArchiveJob
>
getNextJob
();
...
...
scheduler/RetrieveMount.cpp
View file @
76914527
...
...
@@ -40,6 +40,13 @@ cta::MountType::Enum cta::RetrieveMount::getMountType() const{
return
MountType
::
RETRIEVE
;
}
//------------------------------------------------------------------------------
// getNbFiles
//------------------------------------------------------------------------------
uint32_t
cta
::
RetrieveMount
::
getNbFiles
()
const
{
return
m_dbMount
->
nbFilesCurrentlyOnTape
;
}
//------------------------------------------------------------------------------
// getVid
//------------------------------------------------------------------------------
...
...
scheduler/RetrieveMount.hpp
View file @
76914527
...
...
@@ -73,6 +73,13 @@ namespace cta {
* @return The mount transaction id.
*/
virtual
std
::
string
getMountTransactionId
()
const
;
/**
* Returns the mount transaction id.
*
* @return The mount transaction id.
*/
virtual
uint32_t
getNbFiles
()
const
;
/**
* Indicates that the mount was completed.
...
...
scheduler/SchedulerDatabase.hpp
View file @
76914527
...
...
@@ -172,6 +172,7 @@ public:
virtual
std
::
unique_ptr
<
ArchiveJob
>
getNextJob
()
=
0
;
virtual
void
complete
(
time_t
completionTime
)
=
0
;
virtual
~
ArchiveMount
()
{}
uint32_t
nbFilesCurrentlyOnTape
;
};
/**
...
...
@@ -250,6 +251,7 @@ public:
virtual
std
::
unique_ptr
<
RetrieveJob
>
getNextJob
()
=
0
;
virtual
void
complete
(
time_t
completionTime
)
=
0
;
virtual
~
RetrieveMount
()
{}
uint32_t
nbFilesCurrentlyOnTape
;
};
class
RetrieveJob
{
...
...
scheduler/TapeMount.hpp
View file @
76914527
...
...
@@ -49,7 +49,14 @@ namespace cta {
*
* @return The mount transaction id.
*/
virtual
std
::
string
getMountTransactionId
()
const
=
0
;
virtual
std
::
string
getMountTransactionId
()
const
=
0
;
/**
* Returns the mount transaction id.
*
* @return The mount transaction id.
*/
virtual
uint32_t
getNbFiles
()
const
=
0
;
/**
* Indicates that the mount was completed.
...
...
tapeserver/castor/messages/ArchiveJobFromCTA.proto
View file @
76914527
...
...
@@ -20,4 +20,5 @@ package castor.messages;
message
ArchiveJobFromCTA
{
required
string
vid
=
1
;
required
string
unitname
=
2
;
required
uint32
nbfiles
=
3
;
}
tapeserver/castor/messages/TapeserverProxy.hpp
View file @
76914527
...
...
@@ -84,7 +84,7 @@ public:
* @return The number of files currently stored on the tape
*/
virtual
uint32_t
gotArchiveJobFromCTA
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
)
=
0
;
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
)
=
0
;
/**
* Notifies the tapeserverd daemon that the mount-session child-process got
...
...
tapeserver/castor/messages/TapeserverProxyDummy.cpp
View file @
76914527
...
...
@@ -25,7 +25,7 @@
// gotArchiveJobFromCTA
//------------------------------------------------------------------------------
uint32_t
castor
::
messages
::
TapeserverProxyDummy
::
gotArchiveJobFromCTA
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
)
{
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
)
{
return
0
;
}
...
...
tapeserver/castor/messages/TapeserverProxyDummy.hpp
View file @
76914527
...
...
@@ -41,7 +41,7 @@ public:
* @return The number of files currently stored on the tape
*/
virtual
uint32_t
gotArchiveJobFromCTA
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
);
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
);
/**
* Notifies the tapeserverd daemon that the mount-session child-process got
...
...
tapeserver/castor/messages/TapeserverProxyZmq.cpp
View file @
76914527
...
...
@@ -56,11 +56,11 @@ castor::messages::TapeserverProxyZmq::TapeserverProxyZmq(log::Logger &log,
// gotArchiveJobFromCTA
//------------------------------------------------------------------------------
uint32_t
castor
::
messages
::
TapeserverProxyZmq
::
gotArchiveJobFromCTA
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
)
{
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
)
{
MutexLocker
lock
(
&
m_mutex
);
try
{
const
Frame
rqst
=
createArchiveJobFromCTAFrame
(
vid
,
unitName
);
const
Frame
rqst
=
createArchiveJobFromCTAFrame
(
vid
,
unitName
,
nbFiles
);
sendFrame
(
m_serverSocket
,
rqst
);
NbFilesOnTape
reply
;
...
...
@@ -303,7 +303,7 @@ castor::messages::Frame castor::messages::TapeserverProxyZmq::
//------------------------------------------------------------------------------
castor
::
messages
::
Frame
castor
::
messages
::
TapeserverProxyZmq
::
createArchiveJobFromCTAFrame
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
)
{
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
)
{
try
{
Frame
frame
;
...
...
@@ -314,6 +314,7 @@ castor::messages::Frame castor::messages::TapeserverProxyZmq::
ArchiveJobFromCTA
body
;
body
.
set_vid
(
vid
);
body
.
set_unitname
(
unitName
);
body
.
set_nbfiles
(
nbFiles
);
frame
.
serializeProtocolBufferIntoBody
(
body
);
return
frame
;
...
...
tapeserver/castor/messages/TapeserverProxyZmq.hpp
View file @
76914527
...
...
@@ -57,7 +57,7 @@ public:
* @return The number of files currently stored on the tape
*/
virtual
uint32_t
gotArchiveJobFromCTA
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
);
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
);
/**
* Notifies the tapeserverd daemon that the mount-session child-process got
...
...
@@ -219,7 +219,7 @@ private:
* @return The frame.
*/
Frame
createArchiveJobFromCTAFrame
(
const
std
::
string
&
vid
,
const
std
::
string
&
unitName
);
const
std
::
string
&
unitName
,
const
uint32_t
nbFiles
);
/**
* Creates a frame containing a RetrieveJobFromCTA message.
...
...
tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp
View file @
76914527
...
...
@@ -101,6 +101,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
return
MARK_DRIVE_AS_UP
;
m_volInfo
.
vid
=
tapeMount
->
getVid
();
m_volInfo
.
mountType
=
tapeMount
->
getMountType
();
m_volInfo
.
nbFiles
=
tapeMount
->
getNbFiles
();
// 2b) ... and log.
// Make the DGN and TPVID parameter permanent.
log
::
ScopedParamContainer
params
(
lc
);
...
...
@@ -290,8 +291,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
//theses 2 numbers should match. Otherwise, it means the stager went mad
if
(
firstFseqFromClient
!=
nbOfFileOnTape
+
1
)
{
lc
.
log
(
LOG_ERR
,
"First file to write's fseq and number of files on "
"the tape according to the VMGR dont match"
);
std
::
stringstream
ss
;
ss
<<
"First file to write's fseq("
<<
firstFseqFromClient
<<
") and number of files on the tape ("
<<
nbOfFileOnTape
<<
" + 1) dont match"
;
lc
.
log
(
LOG_ERR
,
ss
.
str
());
//no mount at all, drive to be kept up = return 0
return
MARK_DRIVE_AS_UP
;
}
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeMessageHandler.cpp
View file @
76914527
...
...
@@ -337,19 +337,10 @@ castor::messages::Frame castor::tape::tapeserver::daemon::TapeMessageHandler::
castor
::
messages
::
ArchiveJobFromCTA
rqstBody
;
rqst
.
parseBodyIntoProtocolBuffer
(
rqstBody
);
CatalogueDrive
&
drive
=
m_driveCatalogue
.
findDrive
(
rqstBody
.
unitname
());
CatalogueDrive
&
drive
=
m_driveCatalogue
.
findDrive
(
rqstBody
.
unitname
());
drive
.
getTransferSession
().
receivedMigrationJob
(
rqstBody
.
vid
());
{
std
::
ostringstream
msg
;
msg
<<
__FUNCTION__
<<
": Not fully implemented because the number of"
" files on tape is not known because there is no vmgr in the CTA"
" project"
;
throw
castor
::
exception
::
Exception
(
msg
.
str
());
}
//messages::Frame reply = createNbFilesOnTapeFrame(tapeInfo.nbFiles);
//return reply;
messages
::
Frame
reply
=
createNbFilesOnTapeFrame
(
rqstBody
.
nbfiles
());
return
reply
;
}
catch
(
castor
::
exception
::
Exception
&
ne
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
...
...
tapeserver/castor/tape/tapeserver/daemon/TapeServerReporter.cpp
View file @
76914527
...
...
@@ -96,7 +96,7 @@ TapeServerReporter::TapeServerReporter(
m_lc
.
log
(
LOG_ERR
,
"TapeServerReporter is running but calling a synchronous operation on it"
"Could cause a race with the underlying zmq sockets in the proxy"
);
}
return
m_tapeserverProxy
.
gotArchiveJobFromCTA
(
m_volume
.
vid
,
m_unitName
);
return
m_tapeserverProxy
.
gotArchiveJobFromCTA
(
m_volume
.
vid
,
m_unitName
,
m_volume
.
nbFiles
);
}
//------------------------------------------------------------------------------
//gotReadMountDetailsFromClient
...
...
tapeserver/castor/tape/tapeserver/daemon/VolumeInfo.hpp
View file @
76914527
...
...
@@ -43,6 +43,8 @@ namespace daemon {
std
::
string
vid
;
/** The mount type: archive or retrieve */
cta
::
MountType
::
Enum
mountType
;
/** The number of files currently on tape*/
uint32_t
nbFiles
;
};
}
// namespace daemon
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment