File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -399,15 +399,15 @@ private List<LongWithAttributes> getUndesiredAllocationsExcludingShuttingDownNod
399399
400400 private List <LongWithAttributes > getIfPublishing (ToLongFunction <AllocationStats > value ) {
401401 var currentStats = lastReconciliationAllocationStats ;
402- if (currentStats != EMPTY_ALLOCATION_STATS ) {
402+ if (nodeIsMaster && currentStats != EMPTY_ALLOCATION_STATS ) {
403403 return List .of (new LongWithAttributes (value .applyAsLong (currentStats )));
404404 }
405405 return List .of ();
406406 }
407407
408408 private List <DoubleWithAttributes > getUndesiredAllocationsRatioMetrics () {
409409 var currentStats = lastReconciliationAllocationStats ;
410- if (currentStats != EMPTY_ALLOCATION_STATS ) {
410+ if (nodeIsMaster && currentStats != EMPTY_ALLOCATION_STATS ) {
411411 return List .of (new DoubleWithAttributes (currentStats .undesiredAllocationsRatio ()));
412412 }
413413 return List .of ();
You can’t perform that action at this time.
0 commit comments