Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Today at 12:05 p.m. CEST
GitLab will be temporarily unavailable due to brief maintenance.
Show more breadcrumbs
dCache
cta
Commits
cd2f0d9b
Commit
cd2f0d9b
authored
7 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Improved logging of CTA catalogue
parent
aff349fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/OracleCatalogue.cpp
+37
-5
37 additions, 5 deletions
catalogue/OracleCatalogue.cpp
catalogue/SqliteCatalogue.cpp
+36
-5
36 additions, 5 deletions
catalogue/SqliteCatalogue.cpp
with
73 additions
and
10 deletions
catalogue/OracleCatalogue.cpp
+
37
−
5
View file @
cd2f0d9b
...
...
@@ -138,13 +138,46 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
}
if
(
nullptr
==
archiveFile
.
get
())
{
std
::
list
<
cta
::
log
::
Param
>
params
;
params
.
push_back
(
cta
::
log
::
Param
(
"fileId"
,
std
::
to_string
(
archiveFile
Id
)
));
m_
log
(
log
::
WARNING
,
"Ignoring request to delete
A
rchive
F
ile because it does not exist in the catalogue"
,
params
);
log
::
ScopedParamContainer
spc
(
lc
)
;
spc
.
add
(
"fileId"
,
std
::
to_string
(
archiveFile
->
archiveFileID
));
lc
.
log
(
log
::
WARNING
,
"Ignoring request to delete
a
rchive
f
ile because it does not exist in the catalogue"
);
return
;
}
if
(
diskInstanceName
!=
archiveFile
->
diskInstance
)
{
log
::
ScopedParamContainer
spc
(
lc
);
spc
.
add
(
"fileId"
,
std
::
to_string
(
archiveFile
->
archiveFileID
))
.
add
(
"diskInstance"
,
archiveFile
->
diskInstance
)
.
add
(
"requestDiskInstance"
,
diskInstanceName
)
.
add
(
"diskFileId"
,
archiveFile
->
diskFileId
)
.
add
(
"diskFileInfo.path"
,
archiveFile
->
diskFileInfo
.
path
)
.
add
(
"diskFileInfo.owner"
,
archiveFile
->
diskFileInfo
.
owner
)
.
add
(
"diskFileInfo.group"
,
archiveFile
->
diskFileInfo
.
group
)
.
add
(
"fileSize"
,
std
::
to_string
(
archiveFile
->
fileSize
))
.
add
(
"checksumType"
,
archiveFile
->
checksumType
)
.
add
(
"checksumValue"
,
archiveFile
->
checksumValue
)
.
add
(
"creationTime"
,
std
::
to_string
(
archiveFile
->
creationTime
))
.
add
(
"reconciliationTime"
,
std
::
to_string
(
archiveFile
->
reconciliationTime
))
.
add
(
"storageClass"
,
archiveFile
->
storageClass
)
.
add
(
"getConnTime"
,
getConnTime
)
.
add
(
"createStmtTime"
,
createStmtTime
)
.
add
(
"selectFromArchiveFileTime"
,
selectFromArchiveFileTime
);
for
(
auto
it
=
archiveFile
->
tapeFiles
.
begin
();
it
!=
archiveFile
->
tapeFiles
.
end
();
it
++
)
{
std
::
stringstream
tapeCopyLogStream
;
tapeCopyLogStream
<<
"copy number: "
<<
it
->
first
<<
" vid: "
<<
it
->
second
.
vid
<<
" fSeq: "
<<
it
->
second
.
fSeq
<<
" blockId: "
<<
it
->
second
.
blockId
<<
" creationTime: "
<<
it
->
second
.
creationTime
<<
" compressedSize: "
<<
it
->
second
.
compressedSize
<<
" checksumType: "
<<
it
->
second
.
checksumType
//this shouldn't be here: repeated field
<<
" checksumValue: "
<<
it
->
second
.
checksumValue
//this shouldn't be here: repeated field
<<
" copyNb: "
<<
it
->
second
.
copyNb
;
//this shouldn't be here: repeated field
spc
.
add
(
"TAPE FILE"
,
tapeCopyLogStream
.
str
());
}
lc
.
log
(
log
::
WARNING
,
"Failed to delete archive file because the disk instance of the request does not match that "
"of the archived file"
);
exception
::
UserError
ue
;
ue
.
getMessage
()
<<
"Failed to delete archive file with ID "
<<
archiveFileId
<<
" because the disk instance of "
"the request does not match that of the archived file: archiveFileId="
<<
archiveFileId
<<
" path="
<<
...
...
@@ -180,7 +213,6 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
.
add
(
"diskFileInfo.path"
,
archiveFile
->
diskFileInfo
.
path
)
.
add
(
"diskFileInfo.owner"
,
archiveFile
->
diskFileInfo
.
owner
)
.
add
(
"diskFileInfo.group"
,
archiveFile
->
diskFileInfo
.
group
)
.
add
(
"diskFileInfo.recoveryBlob"
,
archiveFile
->
diskFileInfo
.
recoveryBlob
)
.
add
(
"fileSize"
,
std
::
to_string
(
archiveFile
->
fileSize
))
.
add
(
"checksumType"
,
archiveFile
->
checksumType
)
.
add
(
"checksumValue"
,
archiveFile
->
checksumValue
)
...
...
@@ -206,7 +238,7 @@ void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
<<
" copyNb: "
<<
it
->
second
.
copyNb
;
//this shouldn't be here: repeated field
spc
.
add
(
"TAPE FILE"
,
tapeCopyLogStream
.
str
());
}
lc
.
log
(
log
::
INFO
,
"Archive
F
ile
D
eleted"
);
lc
.
log
(
log
::
INFO
,
"Archive
f
ile
d
eleted
from CTA catalogue
"
);
}
catch
(
exception
::
UserError
&
)
{
throw
;
}
catch
(
exception
::
Exception
&
ex
)
{
...
...
This diff is collapsed.
Click to expand it.
catalogue/SqliteCatalogue.cpp
+
36
−
5
View file @
cd2f0d9b
...
...
@@ -67,13 +67,45 @@ void SqliteCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
const
auto
getArchiveFileTime
=
t
.
secs
();
if
(
nullptr
==
archiveFile
.
get
())
{
std
::
list
<
cta
::
log
::
Param
>
params
;
params
.
push_back
(
cta
::
log
::
Param
(
"fileId"
,
std
::
to_string
(
archiveFile
Id
)
));
m_
log
(
log
::
WARNING
,
"Ignoring request to delete
A
rchive
F
ile because it does not exist in the catalogue"
,
params
);
log
::
ScopedParamContainer
spc
(
lc
)
;
spc
.
add
(
"fileId"
,
std
::
to_string
(
archiveFile
->
archiveFileID
));
lc
.
log
(
log
::
WARNING
,
"Ignoring request to delete
a
rchive
f
ile because it does not exist in the catalogue"
);
return
;
}
if
(
diskInstanceName
!=
archiveFile
->
diskInstance
)
{
log
::
ScopedParamContainer
spc
(
lc
);
spc
.
add
(
"fileId"
,
std
::
to_string
(
archiveFile
->
archiveFileID
))
.
add
(
"diskInstance"
,
archiveFile
->
diskInstance
)
.
add
(
"requestDiskInstance"
,
diskInstanceName
)
.
add
(
"diskFileId"
,
archiveFile
->
diskFileId
)
.
add
(
"diskFileInfo.path"
,
archiveFile
->
diskFileInfo
.
path
)
.
add
(
"diskFileInfo.owner"
,
archiveFile
->
diskFileInfo
.
owner
)
.
add
(
"diskFileInfo.group"
,
archiveFile
->
diskFileInfo
.
group
)
.
add
(
"fileSize"
,
std
::
to_string
(
archiveFile
->
fileSize
))
.
add
(
"checksumType"
,
archiveFile
->
checksumType
)
.
add
(
"checksumValue"
,
archiveFile
->
checksumValue
)
.
add
(
"creationTime"
,
std
::
to_string
(
archiveFile
->
creationTime
))
.
add
(
"reconciliationTime"
,
std
::
to_string
(
archiveFile
->
reconciliationTime
))
.
add
(
"storageClass"
,
archiveFile
->
storageClass
)
.
add
(
"getConnTime"
,
getConnTime
)
.
add
(
"getArchiveFileTime"
,
getArchiveFileTime
);
for
(
auto
it
=
archiveFile
->
tapeFiles
.
begin
();
it
!=
archiveFile
->
tapeFiles
.
end
();
it
++
)
{
std
::
stringstream
tapeCopyLogStream
;
tapeCopyLogStream
<<
"copy number: "
<<
it
->
first
<<
" vid: "
<<
it
->
second
.
vid
<<
" fSeq: "
<<
it
->
second
.
fSeq
<<
" blockId: "
<<
it
->
second
.
blockId
<<
" creationTime: "
<<
it
->
second
.
creationTime
<<
" compressedSize: "
<<
it
->
second
.
compressedSize
<<
" checksumType: "
<<
it
->
second
.
checksumType
//this shouldn't be here: repeated field
<<
" checksumValue: "
<<
it
->
second
.
checksumValue
//this shouldn't be here: repeated field
<<
" copyNb: "
<<
it
->
second
.
copyNb
;
//this shouldn't be here: repeated field
spc
.
add
(
"TAPE FILE"
,
tapeCopyLogStream
.
str
());
}
lc
.
log
(
log
::
WARNING
,
"Failed to delete archive file because the disk instance of the request does not match that "
"of the archived file"
);
exception
::
UserError
ue
;
ue
.
getMessage
()
<<
"Failed to delete archive file with ID "
<<
archiveFileId
<<
" because the disk instance of "
"the request does not match that of the archived file: archiveFileId="
<<
archiveFileId
<<
" path="
<<
...
...
@@ -109,7 +141,6 @@ void SqliteCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
.
add
(
"diskFileInfo.path"
,
archiveFile
->
diskFileInfo
.
path
)
.
add
(
"diskFileInfo.owner"
,
archiveFile
->
diskFileInfo
.
owner
)
.
add
(
"diskFileInfo.group"
,
archiveFile
->
diskFileInfo
.
group
)
.
add
(
"diskFileInfo.recoveryBlob"
,
archiveFile
->
diskFileInfo
.
recoveryBlob
)
.
add
(
"fileSize"
,
std
::
to_string
(
archiveFile
->
fileSize
))
.
add
(
"checksumType"
,
archiveFile
->
checksumType
)
.
add
(
"checksumValue"
,
archiveFile
->
checksumValue
)
...
...
@@ -134,7 +165,7 @@ void SqliteCatalogue::deleteArchiveFile(const std::string &diskInstanceName, con
<<
" copyNb: "
<<
it
->
second
.
copyNb
;
//this shouldn't be here: repeated field
spc
.
add
(
"TAPE FILE"
,
tapeCopyLogStream
.
str
());
}
lc
.
log
(
log
::
INFO
,
"Archive
F
ile
D
eleted"
);
lc
.
log
(
log
::
INFO
,
"Archive
f
ile
d
eleted
from CTA catalogue
"
);
}
catch
(
exception
::
UserError
&
)
{
throw
;
}
catch
(
exception
::
Exception
&
ex
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment