ctubbsii commented on code in PR #6423:
URL: https://github.com/apache/accumulo/pull/6423#discussion_r3423109542


##########
server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java:
##########
@@ -880,18 +876,20 @@ public TExternalCompactionList 
getCompletedCompactions(TInfo tinfo, TCredentials
 
   @Override
   public void cancel(TInfo tinfo, TCredentials credentials, String 
externalCompactionId)
-      throws TException {
+      throws ThriftSecurityException {
     var runningCompaction = 
RUNNING_CACHE.get(ExternalCompactionId.of(externalCompactionId));
     var extent = KeyExtent.fromThrift(runningCompaction.getJob().getExtent());
     try {
       NamespaceId nsId = getContext().getNamespaceId(extent.tableId());
       if (!security.canCompact(credentials, extent.tableId(), nsId)) {
-        throw new AccumuloSecurityException(credentials.getPrincipal(),
-            SecurityErrorCode.PERMISSION_DENIED).asThriftException();
+        throw new ThriftSecurityException(credentials.getPrincipal(),
+            SecurityErrorCode.PERMISSION_DENIED);
       }
     } catch (TableNotFoundException e) {
-      throw new ThriftTableOperationException(extent.tableId().canonical(), 
null,
-          TableOperation.COMPACT_CANCEL, TableOperationExceptionType.NOTFOUND, 
e.getMessage());
+      // if the table is deleted, there is no way to check user permissions to 
cancel
+      // the system should handle this automatically
+      throw new ThriftSecurityException(credentials.getPrincipal(),
+          SecurityErrorCode.PERMISSION_DENIED);

Review Comment:
   In discussing this with @dlmarion , I think the right answer is to log a 
warning on the server side, and then just return. If the table doesn't exist, 
the compaction will be cancelled anyway, so there's not really any reason to 
reject the NOOP RPC request.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to