Added ack call when the cluster state has not changed
The missing call could cause a cluster state update to hang in case there is no change no apply
This commit is contained in:
parent
5639002a8e
commit
f425d4af2f
|
@ -50,7 +50,6 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder;
|
import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder;
|
||||||
import static org.elasticsearch.common.util.concurrent.EsExecutors.daemonThreadFactory;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.daemonThreadFactory;
|
||||||
|
@ -315,6 +314,10 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
|
||||||
if (updateTask instanceof ProcessedClusterStateUpdateTask) {
|
if (updateTask instanceof ProcessedClusterStateUpdateTask) {
|
||||||
((ProcessedClusterStateUpdateTask) updateTask).clusterStateProcessed(source, previousClusterState, newClusterState);
|
((ProcessedClusterStateUpdateTask) updateTask).clusterStateProcessed(source, previousClusterState, newClusterState);
|
||||||
}
|
}
|
||||||
|
if (updateTask instanceof AckedClusterStateUpdateTask) {
|
||||||
|
//no need to wait for ack if nothing changed, the update can be counted as acknowledged
|
||||||
|
((AckedClusterStateUpdateTask)updateTask).onAllNodesAcked(null);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue