Skip to content

Commit

Permalink
remove assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ywangd committed Nov 18, 2024
1 parent c33066e commit 2c8feed
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,13 @@ protected void processInput(DesiredBalanceInput desiredBalanceInput) {
computationsExecuted.inc();

final DesiredBalance currentDesiredBalance = currentDesiredBalanceRef.get();
// Update is either not necessary (due to no changes) or the node has concurrently stands down as master
if (currentDesiredBalance.lastConvergedIndex() != index) {
assert initialDesiredBalance.lastConvergedIndex() == currentDesiredBalance.lastConvergedIndex() // no change
|| currentDesiredBalance == DesiredBalance.NOT_MASTER
|| currentDesiredBalance == DesiredBalance.INITIAL : currentDesiredBalance + " vs " + initialDesiredBalance;
if (currentDesiredBalance == DesiredBalance.NOT_MASTER || currentDesiredBalance == DesiredBalance.INITIAL) {
logger.debug(
() -> Strings.format(
"Desired balance computation for [%s] is discarded. Current=[%s], Initial=[%s]",
"Desired balance computation for [%s] is discarded since master has concurrently changed. "
+ "Current desiredBalance=[%s]",
index,
currentDesiredBalance,
initialDesiredBalance
currentDesiredBalance
)
);
} else if (currentDesiredBalance.finishReason() == DesiredBalance.ComputationFinishReason.STOP_EARLY) {
Expand Down

0 comments on commit 2c8feed

Please sign in to comment.