Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ywangd committed Nov 25, 2024
1 parent 0fc0e42 commit b5b7b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ public void allocate(RoutingAllocation allocation, ActionListener<Void> listener
logger.debug("Executing allocate for [{}]", index);
queue.add(index, listener);
// This can only run on master, so unset not-master if exists
currentDesiredBalanceRef.compareAndSet(DesiredBalance.NOT_MASTER, DesiredBalance.INITIAL);
if (currentDesiredBalanceRef.compareAndSet(DesiredBalance.NOT_MASTER, DesiredBalance.INITIAL)) {
logger.debug("initialized desired balance for becoming master");
}
desiredBalanceComputation.onNewInput(DesiredBalanceInput.create(index, allocation));

if (allocation.routingTable().indicesRouting().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ protected void submitReconcileTask(DesiredBalance desiredBalance) {
lastListener.onResponse(null);
}
};
assertThat(desiredBalanceShardsAllocator.getDesiredBalance(), sameInstance(DesiredBalance.INITIAL));
assertThat(desiredBalanceShardsAllocator.getDesiredBalance(), sameInstance(DesiredBalance.NOT_MASTER));
try {
final PlainActionFuture<Void> future = new PlainActionFuture<>();
desiredBalanceShardsAllocator.allocate(
Expand Down

0 comments on commit b5b7b5a

Please sign in to comment.