Skip to content

Commit 6d5d2fa

Browse files
committed
Add separate setting for logging interval, reduce default to 5 minutes.
1 parent 207dd0d commit 6d5d2fa

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/UndesiredAllocationsTracker.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ public class UndesiredAllocationsTracker {
4141
Setting.Property.NodeScope
4242
);
4343

44+
/**
45+
* The minimum amount of time between warnings about persistent undesired allocations
46+
*/
47+
public static final Setting<TimeValue> UNDESIRED_ALLOCATION_DURATION_LOG_INTERVAL_SETTING = Setting.timeSetting(
48+
"cluster.routing.allocation.desired_balance.undesired_duration_logging.interval",
49+
TimeValue.timeValueMinutes(5),
50+
TimeValue.timeValueMinutes(1),
51+
Setting.Property.Dynamic,
52+
Setting.Property.NodeScope
53+
);
54+
4455
/**
4556
* The max number of undesired allocations to track. We expect this to be relatively small.
4657
*/
@@ -63,7 +74,7 @@ public class UndesiredAllocationsTracker {
6374
this.timeProvider = timeProvider;
6475
this.undesiredAllocationDurationLogInterval = new FrequencyCappedAction(timeProvider::relativeTimeInMillis, TimeValue.ZERO);
6576
clusterSettings.initializeAndWatch(
66-
DesiredBalanceReconciler.UNDESIRED_ALLOCATIONS_LOG_INTERVAL_SETTING,
77+
UNDESIRED_ALLOCATION_DURATION_LOG_INTERVAL_SETTING,
6778
undesiredAllocationDurationLogInterval::setMinInterval
6879
);
6980
clusterSettings.initializeAndWatch(

server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ public void apply(Settings value, Settings current, Settings previous) {
238238
DesiredBalanceReconciler.UNDESIRED_ALLOCATIONS_LOG_INTERVAL_SETTING,
239239
DesiredBalanceReconciler.UNDESIRED_ALLOCATIONS_LOG_THRESHOLD_SETTING,
240240
UndesiredAllocationsTracker.UNDESIRED_ALLOCATION_DURATION_LOG_THRESHOLD_SETTING,
241+
UndesiredAllocationsTracker.UNDESIRED_ALLOCATION_DURATION_LOG_INTERVAL_SETTING,
241242
UndesiredAllocationsTracker.MAX_UNDESIRED_ALLOCATIONS_TO_TRACK,
242243
BreakerSettings.CIRCUIT_BREAKER_LIMIT_SETTING,
243244
BreakerSettings.CIRCUIT_BREAKER_OVERHEAD_SETTING,

0 commit comments

Comments
 (0)