ivakegg commented on code in PR #3677:
URL: https://github.com/apache/accumulo/pull/3677#discussion_r1283438529
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -901,6 +903,47 @@ public void close(boolean saveState) throws IOException {
void initiateClose(boolean saveState) {
log.trace("initiateClose(saveState={}) {}", saveState, getExtent());
+ // Check to see if last or current minc is failing. If so, then thrown
+ // an exception before closing the compactable and leaving the tablet
+ // in a half-closed state. Don't throw IllegalStateException because
+ // calling code will just continue to retry.
+ if (saveState) {
+ if (!isLastMinCSuccessful()) {
+ if (isMinorCompactionRunning()) {
+ // Then current minor compaction is retrying and failure is being
+ // reported.
+ String msg = "Aborting close on " + extent
+ + " because last minor compaction was not successful. Check the
server log.";
+ log.warn(msg);
+ throw new RuntimeException(msg);
+ } else {
+ // We don't know when the last minc occurred. Kick one off now.
+ if (!initiateMinorCompaction(MinorCompactionReason.CLOSE)) {
+ String msg = "Unable to initiate minc for close on " + extent
+ + ". Tablet might be closed or deleting.";
+ log.warn(msg);
+ throw new RuntimeException(msg);
+ }
+ // Not calling getTabletMemory().waitForMinC(); as it will wait
+ // indefinitely for a successful minor compaction. It's possible
+ // that won't happen. We just want to know if the current minc
+ // fails.
+ while (isMinorCompactionRunning()) {
+ UtilWaitThread.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
Review Comment:
This could wait forever ?
--
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]