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
Show more breadcrumbs
dCache
cta
Commits
81f6ceff
Commit
81f6ceff
authored
3 years ago
by
Tigran Mkrtchyan
Browse files
Options
Downloads
Patches
Plain Diff
cta-dcache: use ScopedParamContainer to push debug context into logs
parent
08604b9d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cta-dcache/gRPC/FrontendGRpcSvc.cpp
+41
-2
41 additions, 2 deletions
cta-dcache/gRPC/FrontendGRpcSvc.cpp
with
41 additions
and
2 deletions
cta-dcache/gRPC/FrontendGRpcSvc.cpp
+
41
−
2
View file @
81f6ceff
...
...
@@ -33,6 +33,10 @@ Status CtaRpcImpl::Archive(::grpc::ServerContext* context, const ::cta::dcache::
m_log
->
log
(
cta
::
log
::
INFO
,
"Archive request"
);
cta
::
log
::
ScopedParamContainer
sp
(
*
m_log
);
sp
.
add
(
"remoteHost"
,
context
->
peer
());
sp
.
add
(
"request"
,
"archive"
);
const
std
::
string
storageClass
=
request
->
file
().
storageclass
();
m_log
->
log
(
cta
::
log
::
DEBUG
,
"Archive request for storageClass: "
+
storageClass
);
...
...
@@ -42,8 +46,16 @@ Status CtaRpcImpl::Archive(::grpc::ServerContext* context, const ::cta::dcache::
auto
instance
=
request
->
instance
().
name
();
sp
.
add
(
"instance"
,
instance
);
sp
.
add
(
"username"
,
request
->
cli
().
user
().
username
());
sp
.
add
(
"groupname"
,
request
->
cli
().
user
().
groupname
());
sp
.
add
(
"storageClass"
,
storageClass
);
sp
.
add
(
"fileID"
,
request
->
file
().
fid
());
try
{
uint64_t
archiveFileId
=
m_scheduler
->
checkAndGetNextArchiveFileId
(
instance
,
storageClass
,
requester
,
*
m_log
);
sp
.
add
(
"archiveID"
,
archiveFileId
);
cta
::
common
::
dataStructures
::
ArchiveRequest
archiveRequest
;
cta
::
checksum
::
ProtobufToChecksumBlob
(
request
->
file
().
csb
(),
archiveRequest
.
checksumBlob
);
...
...
@@ -63,9 +75,11 @@ Status CtaRpcImpl::Archive(::grpc::ServerContext* context, const ::cta::dcache::
archiveRequest
.
creationLog
.
time
=
time
(
nullptr
);
std
::
string
reqId
=
m_scheduler
->
queueArchiveWithGivenId
(
archiveFileId
,
instance
,
archiveRequest
,
*
m_log
);
sp
.
add
(
"reqId"
,
reqId
);
m_log
->
log
(
cta
::
log
::
INFO
,
"Archive request for storageClass: "
+
storageClass
+
" archiveFileId: "
+
std
::
to_string
(
archiveFileId
)
+
"RequestID: "
+
reqId
);
+
"
RequestID: "
+
reqId
);
response
->
set_fid
(
archiveFileId
);
response
->
set_reqid
(
reqId
);
...
...
@@ -81,13 +95,24 @@ Status CtaRpcImpl::Archive(::grpc::ServerContext* context, const ::cta::dcache::
Status
CtaRpcImpl
::
Delete
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
DeleteRequest
*
request
,
::
google
::
protobuf
::
Empty
*
response
)
{
cta
::
log
::
ScopedParamContainer
sp
(
*
m_log
);
sp
.
add
(
"remoteHost"
,
context
->
peer
());
m_log
->
log
(
cta
::
log
::
DEBUG
,
"Delete request"
);
sp
.
add
(
"request"
,
"delete"
);
auto
instance
=
request
->
instance
().
name
();
// Unpack message
cta
::
common
::
dataStructures
::
DeleteArchiveRequest
deleteRequest
;
deleteRequest
.
requester
.
name
=
request
->
cli
().
user
().
username
();
deleteRequest
.
requester
.
group
=
request
->
cli
().
user
().
groupname
();
sp
.
add
(
"instance"
,
instance
);
sp
.
add
(
"username"
,
request
->
cli
().
user
().
username
());
sp
.
add
(
"groupname"
,
request
->
cli
().
user
().
groupname
());
sp
.
add
(
"fileID"
,
request
->
file
().
fid
());
deleteRequest
.
diskFilePath
=
"/"
+
request
->
file
().
fid
();
deleteRequest
.
diskFileId
=
request
->
file
().
fid
();
deleteRequest
.
diskInstance
=
instance
;
...
...
@@ -112,11 +137,22 @@ Status CtaRpcImpl::Delete(::grpc::ServerContext* context, const ::cta::dcache::r
Status
CtaRpcImpl
::
Retrieve
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
RetrieveRequest
*
request
,
::
cta
::
dcache
::
rpc
::
RetrieveResponse
*
response
)
{
cta
::
log
::
ScopedParamContainer
sp
(
*
m_log
);
sp
.
add
(
"remoteHost"
,
context
->
peer
());
sp
.
add
(
"request"
,
"retrieve"
);
const
std
::
string
storageClass
=
request
->
file
().
storageclass
();
m_log
->
log
(
cta
::
log
::
DEBUG
,
"Retrieve request for storageClass: "
+
storageClass
);
auto
instance
=
request
->
instance
().
name
();
sp
.
add
(
"instance"
,
instance
);
sp
.
add
(
"username"
,
request
->
cli
().
user
().
username
());
sp
.
add
(
"groupname"
,
request
->
cli
().
user
().
groupname
());
sp
.
add
(
"storageClass"
,
storageClass
);
sp
.
add
(
"archiveID"
,
request
->
archiveid
());
sp
.
add
(
"fileID"
,
request
->
file
().
fid
());
// Unpack message
cta
::
common
::
dataStructures
::
RetrieveRequest
retrieveRequest
;
retrieveRequest
.
requester
.
name
=
request
->
cli
().
user
().
username
();
...
...
@@ -132,14 +168,17 @@ Status CtaRpcImpl::Retrieve(::grpc::ServerContext* context, const ::cta::dcache:
retrieveRequest
.
isVerifyOnly
=
false
;
retrieveRequest
.
archiveFileID
=
request
->
archiveid
();
sp
.
add
(
"archiveID"
,
request
->
archiveid
());
sp
.
add
(
"fileID"
,
request
->
file
().
fid
());
cta
::
utils
::
Timer
t
;
// Queue the request
std
::
string
reqId
=
m_scheduler
->
queueRetrieve
(
instance
,
retrieveRequest
,
*
m_log
);
sp
.
add
(
"reqId"
,
reqId
);
m_log
->
log
(
cta
::
log
::
INFO
,
"Retrieve request for storageClass: "
+
storageClass
+
" archiveFileId: "
+
std
::
to_string
(
retrieveRequest
.
archiveFileID
)
+
"RequestID: "
+
reqId
);
+
"
RequestID: "
+
reqId
);
response
->
set_reqid
(
reqId
);
return
Status
::
OK
;
...
...
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