Merge pull request #27167 from chbatey/regular-rebalance-log

Log rebalance progress at INFO per rebalance info
This commit is contained in:
Patrik Nordwall 2019-07-02 14:02:42 +02:00 committed by GitHub
commit a3ae0787ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -99,6 +99,7 @@ akka.cluster.sharding {
# The difference between number of shards in the region with most shards and
# the region with least shards must be greater than (>) the `rebalanceThreshold`
# for the rebalance to occur.
# It is also the maximum number of shards that will start rebalancing per rebalance-interval
# 1 gives the best distribution and therefore typically the best choice.
# Increasing the threshold can result in quicker rebalance but has the
# drawback of increased difference between number of shards (and therefore load)

View file

@ -866,7 +866,13 @@ abstract class ShardCoordinator(
}
}
def continueRebalance(shards: Set[ShardId]): Unit =
def continueRebalance(shards: Set[ShardId]): Unit = {
if (log.isInfoEnabled && (shards.nonEmpty || rebalanceInProgress.nonEmpty)) {
log.info(
"Starting rebalance for shards [{}]. Current shards rebalancing: [{}]",
shards.mkString(","),
rebalanceInProgress.keySet.mkString(","))
}
shards.foreach { shard =>
if (!rebalanceInProgress.contains(shard)) {
state.shards.get(shard) match {
@ -885,6 +891,7 @@ abstract class ShardCoordinator(
}
}
}
}