|
37 | 37 | import org.apache.logging.log4j.LogManager;
|
38 | 38 | import org.apache.logging.log4j.Logger;
|
39 | 39 | import org.apache.logging.log4j.message.ParameterizedMessage;
|
40 |
| -import org.opensearch.LegacyESVersion; |
41 | 40 | import org.opensearch.action.ActionListener;
|
42 | 41 | import org.opensearch.action.support.GroupedActionListener;
|
43 | 42 | import org.opensearch.client.Client;
|
|
54 | 53 | import org.opensearch.common.Priority;
|
55 | 54 | import org.opensearch.common.Strings;
|
56 | 55 | import org.opensearch.common.collect.ImmutableOpenMap;
|
57 |
| -import org.opensearch.common.logging.DeprecationLogger; |
58 | 56 | import org.opensearch.common.settings.ClusterSettings;
|
59 | 57 | import org.opensearch.common.settings.Settings;
|
60 | 58 | import org.opensearch.common.util.set.Sets;
|
@@ -88,7 +86,6 @@ public class DiskThresholdMonitor {
|
88 | 86 | private final RerouteService rerouteService;
|
89 | 87 | private final AtomicLong lastRunTimeMillis = new AtomicLong(Long.MIN_VALUE);
|
90 | 88 | private final AtomicBoolean checkInProgress = new AtomicBoolean();
|
91 |
| - private final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(logger.getName()); |
92 | 89 |
|
93 | 90 | /**
|
94 | 91 | * The IDs of the nodes that were over the low threshold in the last check (and maybe over another threshold too). Tracked so that we
|
@@ -121,14 +118,6 @@ public DiskThresholdMonitor(
|
121 | 118 | this.rerouteService = rerouteService;
|
122 | 119 | this.diskThresholdSettings = new DiskThresholdSettings(settings, clusterSettings);
|
123 | 120 | this.client = client;
|
124 |
| - if (diskThresholdSettings.isAutoReleaseIndexEnabled() == false) { |
125 |
| - deprecationLogger.deprecate( |
126 |
| - DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY.replace(".", "_"), |
127 |
| - "[{}] will be removed in version {}", |
128 |
| - DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY, |
129 |
| - LegacyESVersion.V_7_4_0.major + 1 |
130 |
| - ); |
131 |
| - } |
132 | 121 | }
|
133 | 122 |
|
134 | 123 | private void checkFinished() {
|
@@ -371,23 +360,7 @@ public void onNewInfo(ClusterInfo info) {
|
371 | 360 | .collect(Collectors.toSet());
|
372 | 361 |
|
373 | 362 | if (indicesToAutoRelease.isEmpty() == false) {
|
374 |
| - if (diskThresholdSettings.isAutoReleaseIndexEnabled()) { |
375 |
| - logger.info("releasing read-only-allow-delete block on indices: [{}]", indicesToAutoRelease); |
376 |
| - updateIndicesReadOnly(indicesToAutoRelease, listener, false); |
377 |
| - } else { |
378 |
| - deprecationLogger.deprecate( |
379 |
| - DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY.replace(".", "_"), |
380 |
| - "[{}] will be removed in version {}", |
381 |
| - DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY, |
382 |
| - LegacyESVersion.V_7_4_0.major + 1 |
383 |
| - ); |
384 |
| - logger.debug( |
385 |
| - "[{}] disabled, not releasing read-only-allow-delete block on indices: [{}]", |
386 |
| - DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY, |
387 |
| - indicesToAutoRelease |
388 |
| - ); |
389 |
| - listener.onResponse(null); |
390 |
| - } |
| 363 | + updateIndicesReadOnly(indicesToAutoRelease, listener, false); |
391 | 364 | } else {
|
392 | 365 | logger.trace("no auto-release required");
|
393 | 366 | listener.onResponse(null);
|
@@ -421,11 +394,9 @@ private void markNodesMissingUsageIneligibleForRelease(
|
421 | 394 | ) {
|
422 | 395 | for (RoutingNode routingNode : routingNodes) {
|
423 | 396 | if (usages.containsKey(routingNode.nodeId()) == false) {
|
424 |
| - if (routingNode != null) { |
425 |
| - for (ShardRouting routing : routingNode) { |
426 |
| - String indexName = routing.index().getName(); |
427 |
| - indicesToMarkIneligibleForAutoRelease.add(indexName); |
428 |
| - } |
| 397 | + for (ShardRouting routing : routingNode) { |
| 398 | + String indexName = routing.index().getName(); |
| 399 | + indicesToMarkIneligibleForAutoRelease.add(indexName); |
429 | 400 | }
|
430 | 401 | }
|
431 | 402 | }
|
|
0 commit comments