[accumulo] branch main updated: Removed unused methods from Compactor and CompactionCoordinator (#2168)

2021-06-16 Thread dlmarion
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 4251c28  Removed unused methods from Compactor and 
CompactionCoordinator (#2168)
4251c28 is described below

commit 4251c283a41c300ea485ed23e7eebb09ba5fdea4
Author: Dave Marion 
AuthorDate: Wed Jun 16 16:30:23 2021 -0400

Removed unused methods from Compactor and CompactionCoordinator (#2168)

Removed:
  Compactor.cancel from the Thrift API and class
  CompactionCoordinator.getMetadataEntryForExtent()
  CompactionCoodinator.getCompactorConnection()

Closes #2159
---
 .../core/compaction/thrift/CompactorService.java   | 1118 
 core/src/main/thrift/compaction-coordinator.thrift |   11 -
 .../coordinator/CompactionCoordinator.java |   24 -
 .../coordinator/CompactionCoordinatorTest.java |   17 -
 .../org/apache/accumulo/compactor/Compactor.java   |   23 -
 5 files changed, 1193 deletions(-)

diff --git 
a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java
 
b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java
index d049564..4530c5f 100644
--- 
a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java
+++ 
b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java
@@ -29,8 +29,6 @@ public class CompactorService {
 
   public interface Iface {
 
-public void cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
java.lang.String externalCompactionId) throws UnknownCompactionIdException, 
org.apache.thrift.TException;
-
 public org.apache.accumulo.core.tabletserver.thrift.TExternalCompactionJob 
getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws 
org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, 
org.apache.thrift.TException;
 
 public java.lang.String 
getRunningCompactionId(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws 
org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, 
org.apache.thrift.TException;
@@ -41,8 +39,6 @@ public class CompactorService {
 
   public interface AsyncIface {
 
-public void cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
java.lang.String externalCompactionId, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) throws 
org.apache.thrift.TException;
-
 public void 
getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
org.apache.thrift.async.AsyncMethodCallback
 resultHandler) throws org.apache.thrift.TException;
 
 public void 
getRunningCompactionId(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
org.apache.thrift.async.AsyncMethodCallback resultHandler) 
throws org.apache.thrift.TException;
@@ -71,31 +67,6 @@ public class CompactorService {
   super(iprot, oprot);
 }
 
-public void cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
java.lang.String externalCompactionId) throws UnknownCompactionIdException, 
org.apache.thrift.TException
-{
-  send_cancel(tinfo, credentials, externalCompactionId);
-  recv_cancel();
-}
-
-public void send_cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, 
java.lang.String externalCompactionId) throws org.apache.thrift.TException
-{
-  cancel_args args = new cancel_args();
-  args.setTinfo(tinfo);
-  args.setCredentials(credentials);
-  args.setExternalCompactionId(externalCompactionId);
-  sendBase("cancel", args);
-}
-
-public void recv_cancel() throws UnknownCompactionIdException, 
org.apache.thrift.TException
-{
-  cancel_result result = new cancel_result();
-  receiveBase(result, "cancel");
-  if (result.e != null) {
-throw result.e;
-  }
-  return;
-}
-
 public org.apache.accumulo.core.tabletserver.thrift.TExternalCompactionJob 
getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, 
org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws 
org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, 
org.apache.thrift.TException
 {
   send_getRunningCompaction(tinfo, credentials);
@@ -195,44 +166,6 

[accumulo] branch main updated: Add retry counter for log recovery with MinC (#2084)

2021-06-16 Thread jmanno
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 9d42e3b  Add retry counter for log recovery with MinC (#2084)
9d42e3b is described below

commit 9d42e3bf4cb3650b72b680f91855eeda6ff6ee53
Author: Jeffrey Manno 
AuthorDate: Wed Jun 16 13:46:41 2021 -0400

Add retry counter for log recovery with MinC (#2084)

* Add retrycounter for log recovery with MinC
---
 .../apache/accumulo/tserver/tablet/MinorCompactor.java | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
index 37dae21..c49f6d5 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
@@ -62,6 +62,7 @@ public class MinorCompactor extends FileCompactor {
   private static final Logger log = 
LoggerFactory.getLogger(MinorCompactor.class);
 
   private final TabletServer tabletServer;
+  private final MinorCompactionReason mincReason;
 
   public MinorCompactor(TabletServer tabletServer, Tablet tablet, InMemoryMap 
imm,
   TabletFile outputFile, MinorCompactionReason mincReason, 
TableConfiguration tableConfig) {
@@ -113,6 +114,7 @@ public class MinorCompactor extends FileCompactor {
   }
 }, Collections.emptyList(), tableConfig);
 this.tabletServer = tabletServer;
+this.mincReason = mincReason;
   }
 
   private boolean isTableDeleting() {
@@ -141,6 +143,7 @@ public class MinorCompactor extends FileCompactor {
 double growthFactor = 4;
 int maxSleepTime = 1000 * 60 * 3; // 3 minutes
 boolean reportedProblem = false;
+int retryCounter = 0;
 
 runningCompactions.add(this);
 try {
@@ -165,12 +168,21 @@ public class MinorCompactor extends FileCompactor {
   reportedProblem = true;
 } catch (RuntimeException | NoClassDefFoundError e) {
   // if this is coming from a user iterator, it is possible that the 
user could change the
-  // iterator config and that the
-  // minor compaction would succeed
-  log.warn("MinC failed ({}) to create {} retrying ...", 
e.getMessage(), outputFileName, e);
+  // iterator config and that the minor compaction would succeed
+  // If the minor compaction stalls for too long during recovery, it 
can interfere with
+  // other tables loading
+  // Throw exception if this happens so assignments can be rescheduled.
   ProblemReports.getInstance(tabletServer.getContext()).report(
   new ProblemReport(getExtent().tableId(), ProblemType.FILE_WRITE, 
outputFileName, e));
+  if (retryCounter >= 4 && 
mincReason.equals(MinorCompactionReason.RECOVERY)) {
+log.warn(
+"MinC ({}) is stuck for too long during recovery, throwing 
error to reschedule.",
+getExtent(), e);
+throw new RuntimeException(e);
+  }
+  log.warn("MinC failed ({}) to create {} retrying ...", 
e.getMessage(), outputFileName, e);
   reportedProblem = true;
+  retryCounter++;
 } catch (CompactionCanceledException e) {
   throw new IllegalStateException(e);
 }