Skip to content

Commit cca3683

Browse files
authored
Added check for tablets with errors, when looking for volume replacements. (apache#4287)
Added check for tablets with errors, when looking for volume replacements. fixes apache#4234
1 parent f320ca3 commit cca3683

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ private static class TableMgmtStats {
353353
int[] counts = new int[TabletState.values().length];
354354
private int totalUnloaded;
355355
private long totalVolumeReplacements;
356+
private int tabletsWithErrors;
356357
}
357358

358359
private TableMgmtStats manageTablets(Iterator<TabletManagement> iter,
@@ -398,6 +399,7 @@ private TableMgmtStats manageTablets(Iterator<TabletManagement> iter,
398399
"Error on TabletServer trying to get Tablet management information for extent: {}. Error message: {}",
399400
tm.getExtent(), mtiError);
400401
this.metrics.incrementTabletGroupWatcherError(this.store.getLevel());
402+
tableMgmtStats.tabletsWithErrors++;
401403
continue;
402404
}
403405

@@ -670,7 +672,17 @@ public void run() {
670672

671673
iter = store.iterator(tableMgmtParams);
672674
var tabletMgmtStats = manageTablets(iter, tableMgmtParams, currentTServers, true);
673-
lookForTabletsNeedingVolReplacement = tabletMgmtStats.totalVolumeReplacements != 0;
675+
676+
// If currently looking for volume replacements, determine if the next round needs to look.
677+
if (lookForTabletsNeedingVolReplacement) {
678+
// Continue to look for tablets needing volume replacement if there was an error
679+
// processing tablets in the call to manageTablets() or if we are still performing volume
680+
// replacement. We only want to stop looking for tablets that need volume replacement when
681+
// we have successfully processed all tablet metadata and no more volume replacements are
682+
// being performed.
683+
lookForTabletsNeedingVolReplacement = tabletMgmtStats.totalVolumeReplacements != 0
684+
|| tabletMgmtStats.tabletsWithErrors != 0;
685+
}
674686

675687
// provide stats after flushing changes to avoid race conditions w/ delete table
676688
stats.end(managerState);

0 commit comments

Comments
 (0)