ISPN-5089 Store divisors in a temporary variable to avoid java.lang.ArithmeticException: / by zero
Revert "Revert rebalancing per cache"

This reverts commit 8cbba22ae625c7dd3e8f5ff389b71f4b49aec2b4.