-
Notifications
You must be signed in to change notification settings - Fork 619
HDDS-3981. Add more debug level log to XceiverClientGrpc for debug purpose #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
0729631
39a4825
a49773e
e1d7e9a
9e13176
6a3d7b3
6a7a413
0f027d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ | |
| import io.opentracing.Scope; | ||
| import io.opentracing.Span; | ||
| import io.opentracing.util.GlobalTracer; | ||
| import org.apache.hadoop.util.Time; | ||
| import org.apache.ratis.thirdparty.io.grpc.ManagedChannel; | ||
| import org.apache.ratis.thirdparty.io.grpc.Status; | ||
| import org.apache.ratis.thirdparty.io.grpc.netty.GrpcSslContexts; | ||
|
|
@@ -329,8 +330,11 @@ private XceiverClientReply sendCommandWithRetry( | |
| } | ||
| } | ||
|
|
||
| int index = -1; | ||
| for (DatanodeDetails dn : datanodeList) { | ||
| index++; | ||
| try { | ||
| long startTime = Time.monotonicNow(); | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Executing command {} on datanode {}", request, dn); | ||
| } | ||
|
|
@@ -339,6 +343,11 @@ private XceiverClientReply sendCommandWithRetry( | |
| // in case these don't exist for the specific datanode. | ||
| reply.addDatanode(dn); | ||
| responseProto = sendCommandAsync(request, dn).getResponse().get(); | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Executed command {} on datanode {}, cost = {}, " | ||
| + "retryCount = {}" + ", cmdType = {}", request, dn, | ||
| Time.monotonicNow() - startTime, index, request.getCmdType()); | ||
| } | ||
| if (validators != null && !validators.isEmpty()) { | ||
| for (CheckedBiFunction validator : validators) { | ||
| validator.apply(request, responseProto); | ||
|
|
@@ -354,7 +363,7 @@ private XceiverClientReply sendCommandWithRetry( | |
| responseProto = null; | ||
| } catch (ExecutionException e) { | ||
| LOG.debug("Failed to execute command {} on datanode {}", | ||
|
xiaoyuyao marked this conversation as resolved.
|
||
| request, dn.getUuid(), e); | ||
|
xiaoyuyao marked this conversation as resolved.
|
||
| request, dn, e); | ||
| if (Status.fromThrowable(e.getCause()).getCode() | ||
| == Status.UNAUTHENTICATED.getCode()) { | ||
| throw new SCMSecurityException("Failed to authenticate with " | ||
|
|
@@ -433,7 +442,7 @@ public XceiverClientReply sendCommandAsync( | |
| UUID dnId = dn.getUuid(); | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Send command {} to datanode {}", | ||
| request.getCmdType(), dn.getNetworkFullPath()); | ||
| request.getCmdType(), dn); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm wrong, I think we have already print the same debug message on Line 338-340 from the caller. Print just the IP address should be sufficient.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, you are right, the redundancy log content is useless, I've change it to |
||
| } | ||
| final CompletableFuture<ContainerCommandResponseProto> replyFuture = | ||
| new CompletableFuture<>(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In sendCommandAsync() below we already have a LOG.debug(cmdType, Dn). Can you move this there to avoid duplicate debug log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoyuyao I hope so, but I think it would be difficult, because, i want to log the retry index and cost time.
when the
sendCommandAsyncreturn back, the client still doesn't get the result from datanode. the result return until thegetreturn.If i have something wrong, please correct me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if we could move the LOG for latency around Line 464 where the container op latency metrics are updated. This way, we can piggyback LOG with the existing metrics update.
metrics.addContainerOpsLatency(request.getCmdType(),
System.nanoTime() - requestTime);
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoyuyao Thanks you for your reply and suggestion. I tried to add the LOG into the L464, like following
But, there are some question
Indexwhich stand for the retried datanode index of thedatanodeList.onErroralso? Otherwise, when we met error, theonNextwon't be executed.As
indexcan be calculate from the log context, I drop it.