Skip to content
GitLab
Menu
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
b9856c95
Commit
b9856c95
authored
Nov 20, 2014
by
Eric Cano
Browse files
Renamed the error counts to Error_... for easy counting and future proof parsing in the tape log.
parent
bdb84c35
Changes
7
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskReadTask.cpp
View file @
b9856c95
...
...
@@ -63,13 +63,13 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
//because the disk could the very reason why the previous one failed,
//so dont do the same mistake twice !
checkMigrationFailing
();
currentErrorToCount
=
"diskOpenForRead
ErrorCount
"
;
currentErrorToCount
=
"
Error_
diskOpenForRead"
;
std
::
auto_ptr
<
tape
::
diskFile
::
ReadFile
>
sourceFile
(
fileFactory
.
createReadFile
(
m_migratedFile
->
path
()));
log
::
ScopedParamContainer
URLcontext
(
lc
);
URLcontext
.
add
(
"path"
,
m_migratedFile
->
path
())
.
add
(
"actualURL"
,
sourceFile
->
URL
());
currentErrorToCount
=
"diskFileToReadSizeMismatch
Count
"
;
currentErrorToCount
=
"
Error_
diskFileToReadSizeMismatch"
;
if
(
migratingFileSize
!=
sourceFile
->
size
()){
throw
castor
::
exception
::
Exception
(
"Mismtach between size given by the client "
"and the real one"
);
...
...
@@ -92,7 +92,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
mb
->
m_fileid
=
m_migratedFile
->
fileid
();
mb
->
m_fileBlock
=
blockId
++
;
currentErrorToCount
=
"diskRead
ErrorCount
"
;
currentErrorToCount
=
"
Error_
diskRead"
;
migratingFileSize
-=
mb
->
m_payload
.
read
(
*
sourceFile
);
m_stats
.
readWriteTime
+=
localTime
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -100,7 +100,7 @@ void DiskReadTask::execute(log::LogContext& lc, diskFile::DiskFileFactory & file
//we either read at full capacity (ie size=capacity) or if there different,
//it should be the end => migratingFileSize should be 0. If it not, error
currentErrorToCount
=
"diskUnexpectedSizeWhenReading
Count
"
;
currentErrorToCount
=
"
Error_
diskUnexpectedSizeWhenReading"
;
if
(
mb
->
m_payload
.
size
()
!=
mb
->
m_payload
.
totalCapacity
()
&&
migratingFileSize
>
0
){
std
::
string
erroMsg
=
"Error while reading a file. Did not read at full capacity but the file is not fully read"
;
mb
->
markAsFailed
(
erroMsg
,
SEINTERNAL
);
...
...
castor/tape/tapeserver/daemon/DiskWriteTask.cpp
View file @
b9856c95
...
...
@@ -87,7 +87,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
if
(
!
writeFile
.
get
())
{
lc
.
log
(
LOG_DEBUG
,
"About to open disk file for writing"
);
// Synchronise the counter with the open time counter.
currentErrorToCount
=
"diskOpenForWrite
ErrorCount
"
;
currentErrorToCount
=
"
Error_
diskOpenForWrite"
;
transferTime
=
localTime
;
writeFile
.
reset
(
fileFactory
.
createWriteFile
(
m_recallingFile
->
path
()));
URLcontext
.
add
(
"actualURL"
,
writeFile
->
URL
());
...
...
@@ -96,7 +96,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
}
// Write the data.
currentErrorToCount
=
"diskWrite
ErrorCount
"
;
currentErrorToCount
=
"
Error_
diskWrite"
;
m_stats
.
dataVolume
+=
mb
->
m_payload
.
size
();
mb
->
m_payload
.
write
(
*
writeFile
);
m_stats
.
readWriteTime
+=
localTime
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -111,7 +111,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
//close has to be explicit, because it may throw.
//A close is done in WriteFile's destructor, but it may lead to some
//silent data loss
currentErrorToCount
=
"diskCloseAfterWrite
ErrorCount
"
;
currentErrorToCount
=
"
Error_
diskCloseAfterWrite"
;
writeFile
->
close
();
m_stats
.
closingTime
+=
localTime
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
m_stats
.
filesCount
++
;
...
...
castor/tape/tapeserver/daemon/TapeReadSingleThread.cpp
View file @
b9856c95
...
...
@@ -54,7 +54,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std
::
string
currentErrorToCount
=
"tapeUnload
ErrorCount
"
;
std
::
string
currentErrorToCount
=
"
Error_
tapeUnload"
;
try
{
// Do the final cleanup
// in the special case of a "manual" mode tape, we should skip the unload too.
...
...
@@ -68,7 +68,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::TapeCleaning::~TapeClean
// And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing)
currentErrorToCount
=
"tapeDismount
ErrorCount
"
;
currentErrorToCount
=
"
Error_
tapeDismount"
;
m_this
.
m_mc
.
dismountTape
(
m_this
.
m_volInfo
.
vid
,
m_this
.
m_drive
.
librarySlot
.
str
());
m_this
.
m_stats
.
unmountTime
+=
m_timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
m_this
.
m_logContext
.
log
(
LOG_INFO
,
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
!=
m_this
.
m_drive
.
librarySlot
.
getLibraryType
()
?
...
...
@@ -147,7 +147,7 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::openReadSession() {
void
castor
::
tape
::
tapeserver
::
daemon
::
TapeReadSingleThread
::
run
()
{
m_logContext
.
pushOrReplace
(
log
::
Param
(
"thread"
,
"TapeRead"
));
castor
::
utils
::
Timer
timer
,
totalTimer
;
std
::
string
currentErrorToCount
=
"
failedToS
etCapabilities
Count
"
;
std
::
string
currentErrorToCount
=
"
Error_s
etCapabilities"
;
try
{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
// through the st driver file descriptor.
...
...
@@ -171,9 +171,9 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// will also take care of the TapeServerReporter and of RecallTaskInjector
TapeCleaning
tapeCleaner
(
*
this
,
timer
);
// Before anything, the tape should be mounted
currentErrorToCount
=
"
tapeFailedTo
MountForRead
Count
"
;
currentErrorToCount
=
"
Error_tape
MountForRead"
;
mountTapeReadOnly
();
currentErrorToCount
=
"
tapeFailedToLoadCount
"
;
currentErrorToCount
=
"
Error_tapeLoad
"
;
waitForDrive
();
m_stats
.
mountTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
{
...
...
@@ -182,7 +182,7 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
m_logContext
.
log
(
LOG_INFO
,
"Tape mounted and drive ready"
);
}
// Then we have to initialise the tape read session
currentErrorToCount
=
"
tapeFailedTo
CheckLabelBeforeReading
Count
"
;
currentErrorToCount
=
"
Error_tapes
CheckLabelBeforeReading"
;
std
::
auto_ptr
<
castor
::
tape
::
tapeFile
::
ReadSession
>
rs
(
openReadSession
());
// From now on, the tasks will identify problems when executed.
currentErrorToCount
=
""
;
...
...
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
b9856c95
...
...
@@ -95,7 +95,7 @@ public:
std
::
string
currentErrorToCount
=
""
;
MemBlock
*
mb
=
NULL
;
try
{
currentErrorToCount
=
"
tapeFailedTo
PositionForRead
Count
"
;
currentErrorToCount
=
"
Error_tape
PositionForRead"
;
std
::
auto_ptr
<
castor
::
tape
::
tapeFile
::
ReadFile
>
rf
(
openReadFile
(
rs
,
lc
));
// At that point we already read the header.
localStats
.
headerVolume
+=
TapeSessionStats
::
headerVolumePerFile
;
...
...
@@ -104,7 +104,7 @@ public:
localStats
.
positionTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
watchdog
.
notifyBeginNewJob
(
*
m_fileToRecall
);
localStats
.
waitReportingTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
currentErrorToCount
=
"tapeReadData
Error
"
;
currentErrorToCount
=
"
Error_
tapeReadData"
;
while
(
stillReading
)
{
// Get a memory block and add information to its metadata
mb
=
m_mm
.
getFreeBlock
();
...
...
castor/tape/tapeserver/daemon/TapeWriteSingleThread.cpp
View file @
b9856c95
...
...
@@ -127,7 +127,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std
::
string
currentErrorToCount
=
"
failedToS
etCapabilities
Count
"
;
std
::
string
currentErrorToCount
=
"
Error_s
etCapabilities"
;
try
{
// Set capabilities allowing rawio (and hence arbitrary SCSI commands)
...
...
@@ -155,13 +155,13 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
// will also take care of the TapeServerReporter
//
TapeCleaning
cleaner
(
*
this
,
timer
);
currentErrorToCount
=
"
tapeFailedTo
MountForWrite
Count
"
;
currentErrorToCount
=
"
Error_tape
MountForWrite"
;
// Before anything, the tape should be mounted
// This call does the logging of the mount
mountTapeReadWrite
();
currentErrorToCount
=
"
tapeFailedToLoadCount
"
;
currentErrorToCount
=
"
Error_tapeLoad
"
;
waitForDrive
();
currentErrorToCount
=
"tapeNotWriteable
Count
"
;
currentErrorToCount
=
"
Error_
tapeNotWriteable"
;
isTapeWritable
();
m_stats
.
mountTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -170,7 +170,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
scoped
.
add
(
"mountTime"
,
m_stats
.
mountTime
);
m_logContext
.
log
(
LOG_INFO
,
"Tape mounted and drive ready"
);
}
currentErrorToCount
=
"
tapeFailedTo
PositionForWrite
Count
"
;
currentErrorToCount
=
"
Error_tape
PositionForWrite"
;
// Then we have to initialize the tape write session
std
::
auto_ptr
<
castor
::
tape
::
tapeFile
::
WriteSession
>
writeSession
(
openWriteSession
());
m_stats
.
positionTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -211,7 +211,7 @@ void castor::tape::tapeserver::daemon::TapeWriteSingleThread::run() {
bytes
+=
task
->
fileSize
();
//if one flush counter is above a threshold, then we flush
if
(
files
>=
m_filesBeforeFlush
||
bytes
>=
m_bytesBeforeFlush
)
{
currentErrorToCount
=
"
tapeFailedToFlushCount
"
;
currentErrorToCount
=
"
Error_tapeFlush
"
;
tapeFlush
(
"Normal flush because thresholds was reached"
,
bytes
,
files
,
timer
);
files
=
0
;
bytes
=
0
;
...
...
castor/tape/tapeserver/daemon/TapeWriteSingleThread.hpp
View file @
b9856c95
...
...
@@ -100,7 +100,7 @@ private:
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std
::
string
currentErrorToCount
=
"tapeUnload
ErrorCount
"
;
std
::
string
currentErrorToCount
=
"
Error_
tapeUnload"
;
try
{
// Do the final cleanup
// in the special case of a "manual" mode tape, we should skip the unload too.
...
...
@@ -114,7 +114,7 @@ private:
// And return the tape to the library
// In case of manual mode, this will be filtered by the rmc daemon
// (which will do nothing)
currentErrorToCount
=
"tapeDismount
ErrorCount
"
;
currentErrorToCount
=
"
Error_
tapeDismount"
;
m_this
.
m_mc
.
dismountTape
(
m_this
.
m_volInfo
.
vid
,
m_this
.
m_drive
.
librarySlot
.
str
());
m_this
.
m_stats
.
unmountTime
+=
m_timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
m_this
.
m_logContext
.
log
(
LOG_INFO
,
mediachanger
::
TAPE_LIBRARY_TYPE_MANUAL
!=
m_this
.
m_drive
.
librarySlot
.
getLibraryType
()
?
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.cpp
View file @
b9856c95
...
...
@@ -89,11 +89,11 @@ namespace daemon {
// process we're in, and to count the error if it occurs.
// We will not record errors for an empty string. This will allow us to
// prevent counting where error happened upstream.
std
::
string
currentErrorToCount
=
"tapeFSeqOutOfSequenceForWrite
Count
"
;
std
::
string
currentErrorToCount
=
"
Error_
tapeFSeqOutOfSequenceForWrite"
;
session
.
validateNextFSeq
(
m_fileToMigrate
->
fseq
());
try
{
//try to open the session
currentErrorToCount
=
"tapeWriteHeader
ErrorCount
"
;
currentErrorToCount
=
"
Error_
tapeWriteHeader"
;
watchdog
.
notifyBeginNewJob
(
*
m_fileToMigrate
);
std
::
auto_ptr
<
castor
::
tape
::
tapeFile
::
WriteFile
>
output
(
openWriteFile
(
session
,
lc
));
m_taskStats
.
transferTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -110,7 +110,7 @@ namespace daemon {
ckSum
=
mb
->
m_payload
.
adler32
(
ckSum
);
m_taskStats
.
checksumingTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
currentErrorToCount
=
"tapeWriteData
ErrorCount
"
;
currentErrorToCount
=
"
Error_
tapeWriteData"
;
mb
->
m_payload
.
write
(
*
output
);
currentErrorToCount
=
""
;
...
...
@@ -122,7 +122,7 @@ namespace daemon {
//finish the writing of the file on tape
//put the trailer
currentErrorToCount
=
"tapeWriteTrailer
ErrorCount
"
;
currentErrorToCount
=
"
Error_
tapeWriteTrailer"
;
output
->
close
();
currentErrorToCount
=
""
;
m_taskStats
.
transferTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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