This is an automated email from the ASF dual-hosted git repository.
krathbun 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 fd2a44502e Improves log messages for AcceptableException (#5992)
fd2a44502e is described below
commit fd2a44502e1eaedde943f9f01fa90e4558c535e4
Author: Kevin Rathbun <[email protected]>
AuthorDate: Wed Nov 26 09:16:19 2025 -0500
Improves log messages for AcceptableException (#5992)
* Improves log messages for AcceptableException
AcceptableExceptions logged now additionally include the table operation,
the exception type, and now always include a non-null description.
closes #5977
---
.../core/clientImpl/AcceptableThriftTableOperationException.java | 5 ++++-
core/src/main/java/org/apache/accumulo/core/fate/Fate.java | 3 ++-
.../src/main/java/org/apache/accumulo/manager/tableOps/Utils.java | 4 ++--
.../org/apache/accumulo/manager/tableOps/bulkVer1/BulkImport.java | 6 ++++--
.../org/apache/accumulo/manager/tableOps/compact/CompactRange.java | 2 +-
.../apache/accumulo/manager/tableOps/compact/CompactionDriver.java | 4 ++--
6 files changed, 15 insertions(+), 9 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/clientImpl/AcceptableThriftTableOperationException.java
b/core/src/main/java/org/apache/accumulo/core/clientImpl/AcceptableThriftTableOperationException.java
index c41ed80bc4..97bfefea84 100644
---
a/core/src/main/java/org/apache/accumulo/core/clientImpl/AcceptableThriftTableOperationException.java
+++
b/core/src/main/java/org/apache/accumulo/core/clientImpl/AcceptableThriftTableOperationException.java
@@ -23,6 +23,8 @@ import
org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType;
import
org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException;
import org.apache.accumulo.core.fate.AcceptableException;
+import edu.umd.cs.findbugs.annotations.NonNull;
+
/**
* Concrete implementation of {@link AcceptableException} for table operations.
*/
@@ -32,7 +34,8 @@ public class AcceptableThriftTableOperationException extends
ThriftTableOperatio
private static final long serialVersionUID = 1L;
public AcceptableThriftTableOperationException(String tableId, String
tableName,
- TableOperation op, TableOperationExceptionType type, String description)
{
+ @NonNull TableOperation op, @NonNull TableOperationExceptionType type,
+ @NonNull String description) {
super(tableId, tableName, op, type, description);
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
b/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
index c6f30dd4ab..906abc24b8 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
@@ -174,7 +174,8 @@ public class Fate<T> {
// as a warning. They're a normal, handled failure condition.
if (e instanceof AcceptableException) {
var tableOpEx = (AcceptableThriftTableOperationException) e;
- log.debug(msg + " for {}({}) {}", tableOpEx.getTableName(),
tableOpEx.getTableId(),
+ log.debug("{} for {}({}) op:{} exception-type:{} desc:{}", msg,
tableOpEx.getTableName(),
+ tableOpEx.getTableId(), tableOpEx.getOp(), tableOpEx.getType(),
tableOpEx.getDescription());
} else {
log.warn(msg, e);
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java
index 2e0f33c2a8..766332df28 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/Utils.java
@@ -82,7 +82,7 @@ public class Utils {
if (destNamespaceId.canonical().equals(new String(nId, UTF_8))
&& !tableId.canonical().equals(tid)) {
throw new AcceptableThriftTableOperationException(tid,
tableName, operation,
- TableOperationExceptionType.EXISTS, null);
+ TableOperationExceptionType.EXISTS, "Table already exists");
}
}
@@ -230,7 +230,7 @@ public class Utils {
if (n != null && !n.equals(namespaceId)) {
throw new AcceptableThriftTableOperationException(null, namespace,
operation,
- TableOperationExceptionType.NAMESPACE_EXISTS, null);
+ TableOperationExceptionType.NAMESPACE_EXISTS, "Namespace already
exists");
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer1/BulkImport.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer1/BulkImport.java
index ee0694fd56..dc232b4047 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer1/BulkImport.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer1/BulkImport.java
@@ -97,7 +97,8 @@ public class BulkImport extends ManagerRepo {
}
manager.getContext().clearTableListCache();
- if (manager.getContext().getTableState(tableId) == TableState.ONLINE) {
+ var tableState = manager.getContext().getTableState(tableId);
+ if (tableState == TableState.ONLINE) {
long reserve1, reserve2;
reserve1 = reserve2 = Utils.reserveHdfsDirectory(manager, sourceDir,
tid);
if (reserve1 == 0) {
@@ -106,7 +107,8 @@ public class BulkImport extends ManagerRepo {
return reserve2;
} else {
throw new AcceptableThriftTableOperationException(tableId.canonical(),
null,
- TableOperation.BULK_IMPORT, TableOperationExceptionType.OFFLINE,
null);
+ TableOperation.BULK_IMPORT, TableOperationExceptionType.OFFLINE,
+ "Table is " + tableState.name().toLowerCase());
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactRange.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactRange.java
index 3d37c4282a..a77621ef27 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactRange.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactRange.java
@@ -140,7 +140,7 @@ public class CompactRange extends ManagerRepo {
tableId, startRow, endRow);
} catch (NoNodeException nne) {
throw new AcceptableThriftTableOperationException(tableId.canonical(),
null,
- TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
+ TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, "Table
not found");
}
}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
index d0a65b149b..d2d56c59a4 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CompactionDriver.java
@@ -129,13 +129,13 @@ class CompactionDriver extends ManagerRepo {
manager.getContext().clearTableListCache();
if (tabletCount == 0 && !manager.getContext().tableNodeExists(tableId)) {
throw new AcceptableThriftTableOperationException(tableId.canonical(),
null,
- TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
+ TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, "Table
not found");
}
if (serversToFlush.size() == 0
&& manager.getContext().getTableState(tableId) == TableState.OFFLINE) {
throw new AcceptableThriftTableOperationException(tableId.canonical(),
null,
- TableOperation.COMPACT, TableOperationExceptionType.OFFLINE, null);
+ TableOperation.COMPACT, TableOperationExceptionType.OFFLINE, "Table
is offline");
}
if (tabletsToWaitFor == 0) {