[ 
https://issues.apache.org/jira/browse/HDFS-11622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15960074#comment-15960074
 ] 

Masatake Iwasaki commented on HDFS-11622:
-----------------------------------------

bq. I am unclear about the use of trace ID at this point if all of them can be 
easily traced via their parents span ID. Even in cases where the trace doesn't 
form any DAG and is a linearly growing span, the information can still be 
tracked via parent span ID.

That's right. In HTrace 4, there is no trace while part of span id is the 
equivalent.
https://github.com/apache/incubator-htrace/blob/4.2/htrace-core4/src/main/java/org/apache/htrace/core/SpanId.java#L30-L31

I think trace id is useful to effectively get relevant spans from whole spans 
space, before traversing parent-child relationship. If you use HBase or similar 
to store spans, you can co-locate relevant spans by using trace id as leading 
bits of rowkey.

> TraceId hardcoded to 0 in DataStreamer, correlation between multiple spans is 
> lost
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-11622
>                 URL: https://issues.apache.org/jira/browse/HDFS-11622
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: tracing
>            Reporter: Karan Mehta
>
> In the {{run()}} method of {{DataStreamer}} class, the following code is 
> written. {{parents\[0\]}} refer to the {{spanId}} of the parent span.
> {code}
>               one = dataQueue.getFirst(); // regular data packet
>               long parents[] = one.getTraceParents();
>               if (parents.length > 0) {
>                      scope = Trace.startSpan("dataStreamer", new TraceInfo(0, 
> parents[0]));
>                 // TODO: use setParents API once it's available from HTrace 
> 3.2
>                 // scope = Trace.startSpan("dataStreamer", Sampler.ALWAYS);
>                 // scope.getSpan().setParents(parents);
>               }
> {code}
> The {{scope}} starts a new TraceSpan with a traceId hardcoded to 0. Ideally 
> it should be taken when {{currentPacket.addTraceParent(Trace.currentSpan())}} 
> is invoked. This JIRA is to propose an additional long field inside the 
> {{DFSPacket}} class which holds the parent {{traceId}}. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to