You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by cs...@apache.org on 2023/05/03 16:25:14 UTC

[accumulo] branch 2.1 updated: Handle exceptions during tablet metadata task (#3366)

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

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


The following commit(s) were added to refs/heads/2.1 by this push:
     new 3c8630e776 Handle exceptions during tablet metadata task (#3366)
3c8630e776 is described below

commit 3c8630e776646559d4319787b6f99ca1e817e63a
Author: Christopher L. Shannon <ch...@gmail.com>
AuthorDate: Wed May 3 12:25:08 2023 -0400

    Handle exceptions during tablet metadata task (#3366)
    
    Make sure to catch and log any errors when the tablet metadata
    verification task runs to check tablet metadata so that errors do not
    cause the task and server to halt.
    
    This closes #3346
---
 .../src/main/java/org/apache/accumulo/tserver/TabletServer.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index c5b68ab473..3fd3dfb5e7 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -841,7 +841,6 @@ public class TabletServer extends AbstractServer implements TabletHostingServer
         try (TabletsMetadata tabletsMetadata =
             getContext().getAmple().readTablets().forTablets(onlineTabletsSnapshot.keySet())
                 .fetch(FILES, LOGS, ECOMP, PREV_ROW).build()) {
-          mdScanSpan.end();
           duration = Duration.between(start, Instant.now());
           log.debug("Metadata scan took {}ms for {} tablets read.", duration.toMillis(),
               onlineTabletsSnapshot.keySet().size());
@@ -854,6 +853,11 @@ public class TabletServer extends AbstractServer implements TabletHostingServer
             tablet.compareTabletInfo(counter, tabletMetadata);
           }
         }
+      } catch (Exception e) {
+        log.error("Unable to complete verification of tablet metadata", e);
+        TraceUtil.setException(mdScanSpan, e, true);
+      } finally {
+        mdScanSpan.end();
       }
     });