Skip to content

Commit f5f5490

Browse files
committed
Reduce HostRegexTableLoadBalancer RPCs for OOB checks (#6446)
The StatusThread.updateStatus() method in the Manager calls gatherTableInformation to get information about all of the TabletServers in the cluster, then calls balanceTablets(). balanceTablets() creates a partitioned view of the status information and uses that when creating the BalanceParams to pass to table balancer's balance(). The HostRegexTableLoadBalancer.balance method will periodically check for tablets that are hosted outside of the defined regex. Prior to this change it was making an RPC call to every tablet server outside of the defined regex. This change uses the gathered tablet server information such that the RPC call is made to the tablet server if the information indicates that the tablet server is hosting tablets for the table. The RPC is necessary to get the extent information to create the migrations, but it's only necessary when the tablet server is hosting tablets for the table.
1 parent b874c0e commit f5f5490

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

core/src/main/java/org/apache/accumulo/core/spi/balancer/HostRegexTableLoadBalancer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,14 @@ public long balance(BalanceParameters params) {
421421
+ " it may have been deleted or renamed.", table);
422422
continue;
423423
}
424+
// If current information in the Manager indicates that the tserver
425+
// is not hosting tablets for the table, then move on to the next
426+
// tserver
427+
if (e.getValue().getTableMap() != null
428+
&& !e.getValue().getTableMap().containsKey(tid.canonical())) {
429+
LOG.debug("TServer {} is not hosting any tablets for table {}", e.getKey(), table);
430+
continue;
431+
}
424432
try {
425433
List<TabletStatistics> outOfBoundsTablets = getOnlineTabletsForTable(e.getKey(), tid);
426434
if (outOfBoundsTablets == null) {

0 commit comments

Comments
 (0)