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
6fac0618
Commit
6fac0618
authored
May 12, 2021
by
Michael Davis
Browse files
Revert "cta/CTA#584 Verifies checksum before writing disk replica"
This reverts commit
1d31d166
.
parent
4fd58382
Changes
1
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
6fac0618
...
...
@@ -127,7 +127,11 @@ public:
// end of file. append() also protects against reading too big tape blocks.
while
(
mb
->
m_payload
.
append
(
*
rf
))
{
tapeBlock
++
;
checksum_adler32
=
mb
->
m_payload
.
adler32
(
checksum_adler32
);
if
(
isVerifyOnly
)
{
// Normally, the checksum is calculated in DiskWriteTask::execute(). In verification-only mode, there is no
// write to disk. As we need to validate the checksum, we calculate it here.
checksum_adler32
=
mb
->
m_payload
.
adler32
(
checksum_adler32
);
}
}
}
catch
(
const
cta
::
exception
::
EndOfFile
&
)
{
// append() signaled the end of the file.
...
...
@@ -147,18 +151,17 @@ public:
// Don't write the file to disk
mb
->
markAsVerifyOnly
();
}
// If we reached the end of the file, validate the checksum (throws an exception on bad checksum)
if
(
!
stillReading
)
{
tapeReadChecksum
.
insert
(
cta
::
checksum
::
ADLER32
,
checksum_adler32
);
m_retrieveJob
->
archiveFile
.
checksumBlob
.
validate
(
tapeReadChecksum
);
}
// Pass the block to the disk write task
m_fifo
.
pushDataBlock
(
mb
);
mb
=
NULL
;
watchdog
.
notify
(
blockSize
);
localStats
.
waitReportingTime
+=
timer
.
secs
(
cta
::
utils
::
Timer
::
resetCounter
);
}
//end of while(stillReading)
// We have to signal the end of the tape read to the disk write task.
if
(
isVerifyOnly
)
{
tapeReadChecksum
.
insert
(
cta
::
checksum
::
ADLER32
,
checksum_adler32
);
m_retrieveJob
->
archiveFile
.
checksumBlob
.
validate
(
tapeReadChecksum
);
}
// we have to signal the end of the tape read to the disk write task.
m_fifo
.
pushDataBlock
(
NULL
);
// Log the successful transfer
localStats
.
totalTime
=
localTime
.
secs
();
...
...
@@ -192,18 +195,19 @@ public:
.
add
(
"userFilesCount"
,
localStats
.
userFilesCount
)
.
add
(
"userBytesCount"
,
localStats
.
userBytesCount
)
.
add
(
"verifiedFilesCount"
,
localStats
.
verifiedFilesCount
)
.
add
(
"verifiedBytesCount"
,
localStats
.
verifiedBytesCount
)
.
add
(
"checksumType"
,
"ADLER32"
)
.
add
(
"checksumValue"
,
cta
::
checksum
::
ChecksumBlob
::
ByteArrayToHex
(
tapeReadChecksum
.
at
(
cta
::
checksum
::
ADLER32
)));
.
add
(
"verifiedBytesCount"
,
localStats
.
verifiedBytesCount
);
if
(
isVerifyOnly
)
{
params
.
add
(
"checksumType"
,
"ADLER32"
)
.
add
(
"checksumValue"
,
cta
::
checksum
::
ChecksumBlob
::
ByteArrayToHex
(
tapeReadChecksum
.
at
(
cta
::
checksum
::
ADLER32
)));
}
lc
.
log
(
cta
::
log
::
INFO
,
"File successfully read from tape"
);
// Add the local counts to the session's
stats
.
add
(
localStats
);
}
//end of try
catch
(
const
cta
::
exception
::
Exception
&
ex
)
{
//
W
e end up here because:
//-- openReadFile brought us here (can
'
t position to the file)
//
w
e end up
t
here because
:
//-- openReadFile brought us here (cant position to the file)
//-- m_payload.append brought us here (error while reading the file)
//-- Checksum validation failed (after reading the last block from tape)
// Record the error in the watchdog
if
(
currentErrorToCount
.
size
())
{
watchdog
.
addToErrorCount
(
currentErrorToCount
);
...
...
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