You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2025/01/28 16:18:00 UTC

[PR] adds trace logging of tablet state computations [accumulo]

keith-turner opened a new pull request, #5290:
URL: https://github.com/apache/accumulo/pull/5290

   Adds trace level logging of the tablet state and tablet goal state. This logging will help understand why the manager is making the decisions it does regarding a particular tablet.  For example if the manager is not assigning a tablet that one would expect to be assigned turning on this logging could help.  Because the manager uses an iterator to filter tablet metadata in the tablet server, may need to look in the log of manager and tablet servers serving root and metadata tables to see it.
   
   Manually tested this by enabling the trace level logging and runnin some ITs.  Found a bug with calling TableMetadata.getExtent() in this testing and corrected that.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] adds trace logging of tablet state computations [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner merged PR #5290:
URL: https://github.com/apache/accumulo/pull/5290


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] adds trace logging of tablet state computations [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #5290:
URL: https://github.com/apache/accumulo/pull/5290#discussion_r1932941496


##########
core/src/main/java/org/apache/accumulo/core/metadata/TabletState.java:
##########
@@ -34,18 +39,25 @@ public static TabletState compute(TabletMetadata tm, Set<TServerInstance> liveTS
       future = tm.getLocation();
     }
     if (future != null) {
-      return liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
-          : TabletState.ASSIGNED_TO_DEAD_SERVER;
+      return trace(liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
+          : TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
     } else if (current != null) {
       if (liveTServers.contains(current.getServerInstance())) {
-        return TabletState.HOSTED;
+        return trace(TabletState.HOSTED, tm);
       } else {
-        return TabletState.ASSIGNED_TO_DEAD_SERVER;
+        return trace(TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
       }
     } else if (tm.getSuspend() != null) {
-      return TabletState.SUSPENDED;
+      return trace(TabletState.SUSPENDED, tm);
     } else {
-      return TabletState.UNASSIGNED;
+      return trace(TabletState.UNASSIGNED, tm);
     }
   }
+
+  private static TabletState trace(TabletState tabletState, TabletMetadata tm) {
+    // The prev row column for the table may not have been fetched so can not call tm.getExtent()
+    log.trace("Computed state of {} for {}", tabletState,
+        TabletsSection.encodeRow(tm.getTableId(), tm.getEndRow()));

Review Comment:
   Updated in 74efc33988fa97992facb29461b032a63c91758c.  Also updated TabletGoalState as it had the same problem.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] adds trace logging of tablet state computations [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #5290:
URL: https://github.com/apache/accumulo/pull/5290#discussion_r1932732554


##########
core/src/main/java/org/apache/accumulo/core/metadata/TabletState.java:
##########
@@ -34,18 +39,25 @@ public static TabletState compute(TabletMetadata tm, Set<TServerInstance> liveTS
       future = tm.getLocation();
     }
     if (future != null) {
-      return liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
-          : TabletState.ASSIGNED_TO_DEAD_SERVER;
+      return trace(liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
+          : TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
     } else if (current != null) {
       if (liveTServers.contains(current.getServerInstance())) {
-        return TabletState.HOSTED;
+        return trace(TabletState.HOSTED, tm);
       } else {
-        return TabletState.ASSIGNED_TO_DEAD_SERVER;
+        return trace(TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
       }
     } else if (tm.getSuspend() != null) {
-      return TabletState.SUSPENDED;
+      return trace(TabletState.SUSPENDED, tm);
     } else {
-      return TabletState.UNASSIGNED;
+      return trace(TabletState.UNASSIGNED, tm);
     }
   }
+
+  private static TabletState trace(TabletState tabletState, TabletMetadata tm) {
+    // The prev row column for the table may not have been fetched so can not call tm.getExtent()
+    log.trace("Computed state of {} for {}", tabletState,
+        TabletsSection.encodeRow(tm.getTableId(), tm.getEndRow()));

Review Comment:
   I wonder if this should be wrapped with log.isTraceEnabled(). This will always call TabletsSection.encodeRow, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] adds trace logging of tablet state computations [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #5290:
URL: https://github.com/apache/accumulo/pull/5290#discussion_r1932936105


##########
core/src/main/java/org/apache/accumulo/core/metadata/TabletState.java:
##########
@@ -34,18 +39,25 @@ public static TabletState compute(TabletMetadata tm, Set<TServerInstance> liveTS
       future = tm.getLocation();
     }
     if (future != null) {
-      return liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
-          : TabletState.ASSIGNED_TO_DEAD_SERVER;
+      return trace(liveTServers.contains(future.getServerInstance()) ? TabletState.ASSIGNED
+          : TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
     } else if (current != null) {
       if (liveTServers.contains(current.getServerInstance())) {
-        return TabletState.HOSTED;
+        return trace(TabletState.HOSTED, tm);
       } else {
-        return TabletState.ASSIGNED_TO_DEAD_SERVER;
+        return trace(TabletState.ASSIGNED_TO_DEAD_SERVER, tm);
       }
     } else if (tm.getSuspend() != null) {
-      return TabletState.SUSPENDED;
+      return trace(TabletState.SUSPENDED, tm);
     } else {
-      return TabletState.UNASSIGNED;
+      return trace(TabletState.UNASSIGNED, tm);
     }
   }
+
+  private static TabletState trace(TabletState tabletState, TabletMetadata tm) {
+    // The prev row column for the table may not have been fetched so can not call tm.getExtent()
+    log.trace("Computed state of {} for {}", tabletState,
+        TabletsSection.encodeRow(tm.getTableId(), tm.getEndRow()));

Review Comment:
   Yeah it should, would be good to avoid calling encodeRow().



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org