This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/elasticity by this push:
     new ca407eff84 logs special handling of conditional mutations in ample 
(#4674)
ca407eff84 is described below

commit ca407eff842b14a5d5410dca338e6471b9b4bd7e
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Fri Jun 14 13:37:55 2024 -0400

    logs special handling of conditional mutations in ample (#4674)
    
    Adds logging to ample for its handling of conditional mutations
    that were rejected of had an unknown status.
---
 .../metadata/ConditionalTabletsMutatorImpl.java    | 28 ++++++++++++++++++++--
 test/src/main/resources/log4j2-test.properties     |  3 +++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java
 
b/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java
index 2ddf62fbc8..11412e2e2a 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java
@@ -18,6 +18,8 @@
  */
 package org.apache.accumulo.server.metadata;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.time.Duration;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -141,6 +143,16 @@ public class ConditionalTabletsMutatorImpl implements 
Ample.ConditionalTabletsMu
 
       try {
         if (result.getStatus() == ConditionalWriter.Status.UNKNOWN) {
+          if (log.isTraceEnabled()) {
+            // log detailed information about the mutation
+            log.trace("Saw {} status for conditional mutation {} {}", 
result.getStatus(),
+                result.getTabletServer(), result.getMutation().prettyPrint());
+          } else if (log.isDebugEnabled()) {
+            // log a single line of info that makes it apparent this happened 
and gives enough
+            // information to investigate
+            log.debug("Saw {} status for conditional mutation {} {}", 
result.getStatus(),
+                result.getTabletServer(), new 
String(result.getMutation().getRow(), UTF_8));
+          }
           unknownResults.add(result);
         } else {
           resultsList.add(result);
@@ -241,10 +253,22 @@ public class ConditionalTabletsMutatorImpl implements 
Ample.ConditionalTabletsMu
               var handler = rejectedHandlers.get(extent);
               if (tabletMetadata == null && 
handler.callWhenTabletDoesNotExists()
                   && handler.test(null)) {
-                return Status.ACCEPTED;
+                status = Status.ACCEPTED;
               }
               if (tabletMetadata != null && handler.test(tabletMetadata)) {
-                return Status.ACCEPTED;
+                status = Status.ACCEPTED;
+              }
+
+              if (log.isTraceEnabled()) {
+                // log detailed info about tablet metadata and mutation
+                log.trace("Mutation was rejected, status:{} {} {}", status, 
tabletMetadata,
+                    result.getMutation().prettyPrint());
+              } else if (log.isDebugEnabled()) {
+                // log a single line of info that makes it apparent this 
happened and gives enough
+                // information to investigate
+                log.debug("Mutation was rejected, status:{} extent:{} row:{}", 
status,
+                    tabletMetadata == null ? null : tabletMetadata.getExtent(),
+                    new String(result.getMutation().getRow(), UTF_8));
               }
             }
 
diff --git a/test/src/main/resources/log4j2-test.properties 
b/test/src/main/resources/log4j2-test.properties
index 1df47e471b..ac62675d85 100644
--- a/test/src/main/resources/log4j2-test.properties
+++ b/test/src/main/resources/log4j2-test.properties
@@ -145,5 +145,8 @@ logger.39.level = trace
 logger.40.name = org.apache.accumulo.tablet
 logger.40.level = trace
 
+logger.41.name = org.apache.accumulo.server.metadata
+logger.41.level = trace
+
 rootLogger.level = debug
 rootLogger.appenderRef.console.ref = STDOUT

Reply via email to