phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject phoenix git commit: PHOENIX-3767 Prevent spurious tracing spans from Hadoop being written in Phoenix Trace tables (Karan Mehta)
Date Fri, 26 May 2017 17:42:50 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 dc6f6c787 -> b344d4070


PHOENIX-3767 Prevent spurious tracing spans from Hadoop being written in Phoenix Trace tables
(Karan Mehta)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b344d407
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b344d407
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b344d407

Branch: refs/heads/4.x-HBase-1.1
Commit: b344d40706094e203db4a1feb035095a287dfcde
Parents: dc6f6c7
Author: Samarth Jain <samarth@apache.org>
Authored: Fri May 26 10:42:51 2017 -0700
Committer: Samarth Jain <samarth@apache.org>
Committed: Fri May 26 10:42:51 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java  | 1 -
 .../main/java/org/apache/phoenix/trace/TraceSpanReceiver.java    | 4 ++--
 .../java/org/apache/phoenix/trace/TraceMetricsSourceTest.java    | 3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b344d407/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
index 4477fa5..99c1f34 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
@@ -146,7 +146,6 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
      * @throws Exception
      */
     @Test
-    @Ignore
     public void testClientServerIndexingTracing() throws Exception {
 
         // one call for client side, one call for server side

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b344d407/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceSpanReceiver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceSpanReceiver.java b/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceSpanReceiver.java
index 3c71e27..fc58c5e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceSpanReceiver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceSpanReceiver.java
@@ -75,11 +75,11 @@ public class TraceSpanReceiver implements SpanReceiver {
 
     @Override
     public void receiveSpan(Span span) {
-        if (spanQueue.offer(span)) {
+        if (span.getTraceId() != 0 && spanQueue.offer(span)) {
             if (LOG.isTraceEnabled()) {
                 LOG.trace("Span buffered to queue " + span.toJson());
             }
-        } else if (LOG.isDebugEnabled()) {
+        } else if (span.getTraceId() != 0 && LOG.isDebugEnabled()) {
                 LOG.debug("Span NOT buffered due to overflow in queue " + span.toJson());
         }
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b344d407/phoenix-core/src/test/java/org/apache/phoenix/trace/TraceMetricsSourceTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/trace/TraceMetricsSourceTest.java
b/phoenix-core/src/test/java/org/apache/phoenix/trace/TraceMetricsSourceTest.java
index 7f307da..37cea88 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/trace/TraceMetricsSourceTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/trace/TraceMetricsSourceTest.java
@@ -71,6 +71,7 @@ public class TraceMetricsSourceTest {
   }
 
   private Span getSpan(){
-    return new MilliSpan("test span", 0, 1 , 2, "pid");
+    // Spans with Trace Id as 0 will be rejected (See PHOENIX-3767 for details)
+    return new MilliSpan("test span", 1, 1 , 2, "pid");
   }
 }


Mime
View raw message