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
d0644b7a
Commit
d0644b7a
authored
Nov 09, 2020
by
Cedric Caffy
Browse files
[repack] Repack now fails if the repack buffer VID directory cannot be created during expansion
parent
6001894f
Changes
6
Hide whitespace changes
Inline
Side-by-side
ReleaseNotes.md
View file @
d0644b7a
# v3.1-10
## Summary
### Features
### Bug fixes
cta/CTA#837 Repack now fails if the repack buffer VID directory cannot be created during expansion
# v3.1-9
## Summary
...
...
cta.spec.in
View file @
d0644b7a
...
...
@@ -490,6 +490,8 @@ Currently contains a helper for the client-ar script, which should be installed
%attr(0755,root,root) /usr/bin/cta-client-ar-abortPrepare
%changelog
* Wed Nov 18 2020 julien.leduc (at) cern.ch - 3.1-10
- cta/CTA#837 Repack now fails if the repack buffer VID directory cannot be created during expansion
* Wed Nov 04 2020 julien.leduc (at) cern.ch - 3.1-9
- Upstream EOS 4.8.26-1
- cta/CTA#907 For backpressure, the EOS free space can be fetched by calling an external script
...
...
disk/DiskFile.cpp
View file @
d0644b7a
...
...
@@ -771,6 +771,7 @@ void XRootdDirectory::rmdir() {
bool
XRootdDirectory
::
exist
()
{
XrdCl
::
StatInfo
*
statInfo
;
XrdCl
::
XRootDStatus
statStatus
=
m_xrootFileSystem
.
Stat
(
m_truncatedDirectoryURL
,
statInfo
,
c_xrootTimeout
);
cta
::
exception
::
XrootCl
::
throwOnError
(
statStatus
,
"In XRootdDirectory::exist() : failed to stat the directory at "
+
m_URL
);
if
(
statStatus
.
errNo
==
XErrorCode
::
kXR_NotFound
){
return
false
;
}
...
...
disk/DiskFile.hpp
View file @
d0644b7a
...
...
@@ -230,6 +230,10 @@ namespace cta {
* Remove the directory located at this->m_URL
*/
virtual
void
rmdir
()
=
0
;
std
::
string
getURL
()
{
return
m_URL
;
}
virtual
~
Directory
()
throw
()
{}
protected:
...
...
scheduler/Scheduler.cpp
View file @
d0644b7a
...
...
@@ -461,27 +461,20 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques
//We only create the folder if there are some files to Repack
cta
::
disk
::
DirectoryFactory
dirFactory
;
dir
.
reset
(
dirFactory
.
createDirectory
(
dirBufferURL
.
str
()));
if
(
dir
->
exist
()){
//Repack tape repair workflow
try
{
try
{
if
(
dir
->
exist
()){
//Repack tape repair workflow
filesInDirectory
=
dir
->
getFilesName
();
}
catch
(
const
cta
::
exception
::
XrootCl
&
ex
)
{
log
::
ScopedParamContainer
spc
(
lc
);
spc
.
add
(
"vid"
,
repackInfo
.
vid
);
spc
.
add
(
"errorMessage"
,
ex
.
getMessageValue
());
lc
.
log
(
log
::
WARNING
,
"In Scheduler::expandRepackRequest(), received XRootdException while listing files in the buffer"
);
}
}
else
{
if
(
repackInfo
.
noRecall
){
//The buffer directory should be created if the --no-recall flag has been passed
//So we throw an exception
throw
ExpandRepackRequestException
(
"In Scheduler::expandRepackRequest(): the flag --no-recall is set but no buffer directory has been created."
);
}
try
{
}
else
{
if
(
repackInfo
.
noRecall
){
//The buffer directory should be created if the --no-recall flag has been passed
//So we throw an exception
throw
ExpandRepackRequestException
(
"In Scheduler::expandRepackRequest(): the flag --no-recall is set but no buffer directory has been created."
);
}
dir
->
mkdir
();
}
catch
(
const
cta
::
exception
::
XrootCl
&
ex
){
throw
ExpandRepackRequestException
(
ex
.
getMessageValue
());
}
}
catch
(
const
cta
::
exception
::
XrootCl
&
ex
)
{
throw
ExpandRepackRequestException
(
"In Scheduler::expandRepackRequest(): errors while doing some checks on the repack buffer. ExceptionMsg = "
+
ex
.
getMessageValue
());
}
}
...
...
@@ -580,7 +573,7 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques
}
}
if
(
retrieveSubRequest
.
copyNbsToRearchive
.
size
()
<
filesToArchive
){
deleteRepackBuffer
(
std
::
move
(
dir
));
deleteRepackBuffer
(
std
::
move
(
dir
)
,
lc
);
throw
ExpandRepackRequestException
(
"In Scheduler::expandRepackRequest(): Missing archive routes for the creation of the new copies of the files"
);
}
}
else
{
...
...
@@ -592,7 +585,7 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques
}
}
else
{
//No storage class have been found for the current tapefile throw an exception
deleteRepackBuffer
(
std
::
move
(
dir
));
deleteRepackBuffer
(
std
::
move
(
dir
)
,
lc
);
throw
ExpandRepackRequestException
(
"In Scheduler::expandRepackRequest(): No storage class have been found for the file to add copies"
);
}
}
...
...
@@ -642,7 +635,7 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques
// value in case of crash.
nbRetrieveSubrequestsQueued
=
repackRequest
->
m_dbReq
->
addSubrequestsAndUpdateStats
(
retrieveSubrequests
,
archiveRoutesMap
,
fSeq
,
maxAddedFSeq
,
totalStatsFile
,
diskSystemList
,
lc
);
}
catch
(
const
cta
::
ExpandRepackRequestException
&
e
){
deleteRepackBuffer
(
std
::
move
(
dir
));
deleteRepackBuffer
(
std
::
move
(
dir
)
,
lc
);
throw
e
;
}
timingList
.
insertAndReset
(
"addSubrequestsAndUpdateStatsTime"
,
t
);
...
...
@@ -654,7 +647,7 @@ void Scheduler::expandRepackRequest(std::unique_ptr<RepackRequest>& repackReques
if
(
archiveFilesFromCatalogue
.
empty
()
&&
totalStatsFile
.
totalFilesToArchive
==
0
&&
(
totalStatsFile
.
totalFilesToRetrieve
==
0
||
nbRetrieveSubrequestsQueued
==
0
)){
//If no files have been retrieve, the repack buffer will have to be deleted
//TODO : in case of Repack tape repair, we should not try to delete the buffer
deleteRepackBuffer
(
std
::
move
(
dir
));
deleteRepackBuffer
(
std
::
move
(
dir
)
,
lc
);
}
repackRequest
->
m_dbReq
->
expandDone
();
lc
.
log
(
log
::
INFO
,
"In Scheduler::expandRepackRequest(), repack request expanded"
);
...
...
@@ -1096,9 +1089,15 @@ cta::optional<common::dataStructures::LogicalLibrary> Scheduler::getLogicalLibra
return
ret
;
}
void
Scheduler
::
deleteRepackBuffer
(
std
::
unique_ptr
<
cta
::
disk
::
Directory
>
repackBuffer
)
{
if
(
repackBuffer
!=
nullptr
&&
repackBuffer
->
exist
()){
repackBuffer
->
rmdir
();
void
Scheduler
::
deleteRepackBuffer
(
std
::
unique_ptr
<
cta
::
disk
::
Directory
>
repackBuffer
,
cta
::
log
::
LogContext
&
lc
)
{
try
{
if
(
repackBuffer
!=
nullptr
&&
repackBuffer
->
exist
()){
repackBuffer
->
rmdir
();
}
}
catch
(
const
cta
::
exception
::
XrootCl
&
ex
)
{
log
::
ScopedParamContainer
spc
(
lc
);
spc
.
add
(
"exceptionMsg"
,
ex
.
getMessageValue
());
lc
.
log
(
log
::
ERR
,
"In Scheduler::deleteRepackBuffer() unable to delete the directory located in "
+
repackBuffer
->
getURL
());
}
}
...
...
scheduler/Scheduler.hpp
View file @
d0644b7a
...
...
@@ -306,7 +306,7 @@ private:
cta
::
optional
<
common
::
dataStructures
::
LogicalLibrary
>
getLogicalLibrary
(
const
std
::
string
&
libraryName
,
double
&
getLogicalLibraryTime
);
void
deleteRepackBuffer
(
std
::
unique_ptr
<
cta
::
disk
::
Directory
>
repackBuffer
);
void
deleteRepackBuffer
(
std
::
unique_ptr
<
cta
::
disk
::
Directory
>
repackBuffer
,
cta
::
log
::
LogContext
&
lc
);
uint64_t
getNbFilesAlreadyArchived
(
const
common
::
dataStructures
::
ArchiveFile
&
archiveFile
);
...
...
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