kevinrr888 commented on code in PR #5416: URL: https://github.com/apache/accumulo/pull/5416#discussion_r2056548531
########## server/manager/src/main/java/org/apache/accumulo/manager/Manager.java: ########## @@ -677,19 +650,37 @@ public void run() { * balanceTablets() balances tables by DataLevel. Return the current set of migrations partitioned * by DataLevel */ - private static Map<DataLevel,Set<KeyExtent>> - partitionMigrations(final Set<KeyExtent> migrations) { + private Map<DataLevel,Set<KeyExtent>> partitionMigrations() { final Map<DataLevel,Set<KeyExtent>> partitionedMigrations = new EnumMap<>(DataLevel.class); // populate to prevent NPE for (DataLevel dl : DataLevel.values()) { - partitionedMigrations.put(dl, new HashSet<>()); + Set<KeyExtent> extents = new HashSet<>(); + // prev row needed for the extent + try (var tabletsMetadata = getContext().getAmple().readTablets().forLevel(dl) + .fetch(TabletMetadata.ColumnType.PREV_ROW, TabletMetadata.ColumnType.MIGRATION).build()) { + for (var tabletMetadata : tabletsMetadata) { + if (tabletMetadata.getMigration() != null) { + extents.add(tabletMetadata.getExtent()); + } + } + } + partitionedMigrations.put(dl, extents); } - migrations.forEach(ke -> { - partitionedMigrations.get(DataLevel.of(ke.tableId())).add(ke); - }); return partitionedMigrations; } + /** + * Delete the migration, if present, for the given extent if the migration destination is the + * provided tserver + */ + void conditionallyDeleteMigration(KeyExtent extent, TServerInstance tserver) { Review Comment: Dropped in 0a9455cdea88f167179953a1eb8073bf7a77c2f3 -- 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: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org