@@ -353,6 +353,7 @@ private static class TableMgmtStats {
353
353
int [] counts = new int [TabletState .values ().length ];
354
354
private int totalUnloaded ;
355
355
private long totalVolumeReplacements ;
356
+ private int tabletsWithErrors ;
356
357
}
357
358
358
359
private TableMgmtStats manageTablets (Iterator <TabletManagement > iter ,
@@ -398,6 +399,7 @@ private TableMgmtStats manageTablets(Iterator<TabletManagement> iter,
398
399
"Error on TabletServer trying to get Tablet management information for extent: {}. Error message: {}" ,
399
400
tm .getExtent (), mtiError );
400
401
this .metrics .incrementTabletGroupWatcherError (this .store .getLevel ());
402
+ tableMgmtStats .tabletsWithErrors ++;
401
403
continue ;
402
404
}
403
405
@@ -670,7 +672,17 @@ public void run() {
670
672
671
673
iter = store .iterator (tableMgmtParams );
672
674
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
+ }
674
686
675
687
// provide stats after flushing changes to avoid race conditions w/ delete table
676
688
stats .end (managerState );
0 commit comments