From 1a05a5ac24222d3e00a7f1679b12e700004af534 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Mon, 18 Jan 2021 16:16:54 +0000 Subject: [PATCH] Introduce deprecation categories (#67443) Closes #64824. Introduce the concept of categories to deprecation logging. Every location where we log a deprecation message must now include a deprecation category. --- .../analysis/common/CommonAnalysisPlugin.java | 13 +++--- .../common/SynonymTokenFilterFactory.java | 3 +- .../ingest/useragent/UserAgentProcessor.java | 3 +- .../index/reindex/ReindexValidator.java | 3 +- .../azure/classic/AzureDiscoveryPlugin.java | 3 +- .../discovery/ec2/Ec2ClientSettings.java | 5 ++- .../common/logging/EvilLoggerTests.java | 3 +- .../common/logging/JsonLoggerTests.java | 27 +++++++----- .../alias/get/TransportGetAliasesAction.java | 5 ++- .../metadata/IndexNameExpressionResolver.java | 3 +- .../metadata/MetadataCreateIndexService.java | 8 ++-- .../org/elasticsearch/common/joda/Joda.java | 14 +++--- .../common/logging/DeprecatedMessage.java | 7 ++- .../common/logging/DeprecationCategory.java | 44 +++++++++++++++++++ .../common/logging/DeprecationLogger.java | 13 ++++-- .../common/settings/Setting.java | 4 +- .../elasticsearch/common/time/DateUtils.java | 3 +- .../common/unit/ByteSizeValue.java | 3 +- .../xcontent/LoggingDeprecationHandler.java | 7 +-- .../analysis/ShingleTokenFilterFactory.java | 5 ++- .../index/mapper/CompletionFieldMapper.java | 3 +- .../index/mapper/DateFieldMapper.java | 4 +- .../index/mapper/FieldMapper.java | 8 ++-- .../index/mapper/FieldNamesFieldMapper.java | 6 ++- .../index/mapper/IdFieldMapper.java | 3 +- .../index/mapper/IpFieldMapper.java | 5 ++- .../index/mapper/ObjectMapper.java | 3 +- .../index/mapper/RootObjectMapper.java | 3 +- .../index/mapper/TypeFieldType.java | 7 +-- .../index/mapper/TypeParsers.java | 4 +- .../RandomScoreFunctionBuilder.java | 3 +- .../index/similarity/SimilarityProviders.java | 11 ++--- .../index/similarity/SimilarityService.java | 3 +- .../indices/analysis/AnalysisModule.java | 5 ++- .../ingest/ConditionalProcessor.java | 3 +- .../java/org/elasticsearch/node/Node.java | 2 + .../rest/DeprecationRestHandler.java | 3 +- .../admin/indices/RestCloseIndexAction.java | 3 +- .../admin/indices/RestSyncedFlushAction.java | 3 +- .../script/AbstractSortScript.java | 5 ++- .../script/AggregationScript.java | 5 ++- .../org/elasticsearch/script/FieldScript.java | 5 ++- .../script/JodaCompatibleZonedDateTime.java | 10 +++-- .../org/elasticsearch/script/ScoreScript.java | 5 ++- .../elasticsearch/script/ScriptMetadata.java | 13 +++++- .../script/ScriptedMetricAggContexts.java | 7 +-- .../script/StoredScriptSource.java | 15 ++++--- .../script/TermsSetQueryScript.java | 5 ++- .../bucket/histogram/DateIntervalWrapper.java | 9 ++-- .../SignificantTermsAggregatorFactory.java | 3 +- .../completion/context/GeoContextMapping.java | 5 ++- .../transport/TransportInfo.java | 3 +- .../indices/TransportAnalyzeActionTests.java | 7 ++- .../logging/RateLimitingFilterTests.java | 34 +++++++------- .../index/analysis/AnalysisRegistryTests.java | 10 +++-- .../rest/DeprecationRestHandlerTests.java | 3 +- .../test/loggerusage/ESLoggerUsageTests.java | 3 +- .../query/DeprecatedQueryBuilder.java | 3 +- .../license/RestGetLicenseAction.java | 3 +- .../elasticsearch/xpack/core/XPackPlugin.java | 3 +- .../core/rest/action/RestXPackInfoAction.java | 3 +- .../authz/permission/IndicesPermission.java | 4 +- .../transform/action/GetTransformAction.java | 4 +- .../transforms/pivot/PivotConfig.java | 2 + .../MockDeprecatedAggregationBuilder.java | 3 +- .../MockDeprecatedQueryBuilder.java | 3 +- .../xpack/deprecation/DeprecationHttpIT.java | 7 +-- .../TestDeprecatedQueryBuilder.java | 9 +++- .../TestDeprecationHeaderRestAction.java | 3 +- .../xpack/ml/job/JobManager.java | 3 +- .../inference/RestGetTrainedModelsAction.java | 2 + .../xpack/ml/utils/DomainSplitFunction.java | 3 +- .../action/TransportPutRollupJobAction.java | 3 +- .../xpack/security/authc/ApiKeyService.java | 7 +-- .../authc/esnative/ReservedRealm.java | 4 +- .../ldap/ActiveDirectorySessionFactory.java | 4 +- .../authc/ldap/support/SessionFactory.java | 3 +- .../authz/store/CompositeRolesStore.java | 3 +- .../DeprecationRoleDescriptorConsumer.java | 3 +- ...eprecationRoleDescriptorConsumerTests.java | 3 +- .../mapper/SparseVectorFieldMapper.java | 3 +- .../rest/action/RestWatcherStatsAction.java | 4 +- 82 files changed, 336 insertions(+), 161 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/common/logging/DeprecationCategory.java diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java index 8475c902cd8e8..b2ed5de8f0696 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java @@ -116,6 +116,7 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; @@ -253,7 +254,7 @@ public TokenStream create(TokenStream tokenStream) { "The [edgeNGram] token filter name was deprecated in 6.4 and cannot be used in new indices. " + "Please change the filter name to [edge_ngram] instead."); } else { - deprecationLogger.deprecate("edgeNGram_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation", "The [edgeNGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [edge_ngram] instead."); } @@ -290,7 +291,7 @@ public TokenStream create(TokenStream tokenStream) { "The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. " + "Please change the filter name to [ngram] instead."); } else { - deprecationLogger.deprecate("nGram_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_deprecation", "The [nGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [ngram] instead."); } @@ -346,7 +347,7 @@ public Map> getTokenizers() { throw new IllegalArgumentException("The [nGram] tokenizer name was deprecated in 7.6. " + "Please use the tokenizer name to [ngram] for indices created in versions 8 or higher instead."); } else if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate("nGram_tokenizer_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", "The [nGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [ngram] instead."); } @@ -358,7 +359,7 @@ public Map> getTokenizers() { throw new IllegalArgumentException("The [edgeNGram] tokenizer name was deprecated in 7.6. " + "Please use the tokenizer name to [edge_nGram] for indices created in versions 8 or higher instead."); } else if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate("edgeNGram_tokenizer_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", "The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [edge_ngram] instead."); } @@ -551,7 +552,7 @@ public List getPreConfiguredTokenizers() { throw new IllegalArgumentException("The [nGram] tokenizer name was deprecated in 7.6. " + "Please use the tokenizer name to [ngram] for indices created in versions 8 or higher instead."); } else if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate("nGram_tokenizer_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", "The [nGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [ngram] instead."); } @@ -562,7 +563,7 @@ public List getPreConfiguredTokenizers() { throw new IllegalArgumentException("The [edgeNGram] tokenizer name was deprecated in 7.6. " + "Please use the tokenizer name to [edge_ngram] for indices created in versions 8 or higher instead."); } else if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate("edgeNGram_tokenizer_deprecation", + deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", "The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [edge_ngram] instead."); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java index 62189a1d7f34a..57c842385119e 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java @@ -23,6 +23,7 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.synonym.SynonymFilter; import org.apache.lucene.analysis.synonym.SynonymMap; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; @@ -57,7 +58,7 @@ public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory { this.settings = settings; if (settings.get("ignore_case") != null) { - DEPRECATION_LOGGER.deprecate("synonym_ignore_case_option", + DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_ignore_case_option", "The ignore_case option on the synonym_graph filter is deprecated. " + "Instead, insert a lowercase filter in the filter chain before the synonym_graph filter."); } diff --git a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java index 4d2bc2273eabe..f5966f000003b 100644 --- a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java +++ b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java @@ -19,6 +19,7 @@ package org.elasticsearch.ingest.useragent; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.ingest.AbstractProcessor; import org.elasticsearch.ingest.IngestDocument; @@ -186,7 +187,7 @@ public UserAgentProcessor create(Map factories, Strin boolean ignoreMissing = readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false); Object ecsValue = config.remove("ecs"); if (ecsValue != null) { - deprecationLogger.deprecate("ingest_useragent_ecs_settings", + deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ingest_useragent_ecs_settings", "setting [ecs] is deprecated as ECS format is the default and only option"); } diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java index dc54bc7ff080d..543a65b39e7e6 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java @@ -33,6 +33,7 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; @@ -66,7 +67,7 @@ void initialValidation(ReindexRequest request) { state); SearchSourceBuilder searchSource = request.getSearchRequest().source(); if (searchSource != null && searchSource.sorts() != null && searchSource.sorts().isEmpty() == false) { - deprecationLogger.deprecate("reindex_sort", SORT_DEPRECATED_MESSAGE); + deprecationLogger.deprecate(DeprecationCategory.API, "reindex_sort", SORT_DEPRECATED_MESSAGE); } } diff --git a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java index c2a614d52e747..a0a270f547739 100644 --- a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java +++ b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java @@ -23,6 +23,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.cloud.azure.classic.management.AzureComputeService; import org.elasticsearch.cloud.azure.classic.management.AzureComputeServiceImpl; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.settings.Setting; @@ -48,7 +49,7 @@ public class AzureDiscoveryPlugin extends Plugin implements DiscoveryPlugin { public AzureDiscoveryPlugin(Settings settings) { this.settings = settings; - deprecationLogger.deprecate("azure_discovery_plugin", "azure classic discovery plugin is deprecated."); + deprecationLogger.deprecate(DeprecationCategory.PLUGINS, "azure_discovery_plugin", "azure classic discovery plugin is deprecated."); logger.trace("starting azure classic discovery plugin..."); } diff --git a/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java index 8e97d4ba7455c..ef0ec8755bbae 100644 --- a/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java +++ b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java @@ -26,6 +26,7 @@ import com.amazonaws.auth.BasicSessionCredentials; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.SecureSetting; import org.elasticsearch.common.settings.SecureString; @@ -135,12 +136,12 @@ static AWSCredentials loadCredentials(Settings settings) { return null; } else { if (key.length() == 0) { - deprecationLogger.deprecate("ec2_invalid_settings", + deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings", "Setting [{}] is set but [{}] is not, which will be unsupported in future", SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey()); } if (secret.length() == 0) { - deprecationLogger.deprecate("ec2_invalid_settings", + deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings", "Setting [{}] is set but [{}] is not, which will be unsupported in future", ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey()); } diff --git a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java index d0d5f062cf6ef..27e9917a8c287 100644 --- a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java +++ b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java @@ -128,7 +128,8 @@ public void testConcurrentDeprecationLogger() throws IOException, UserException, } for (int j = 0; j < iterations; j++) { for (final Integer id : ids) { - deprecationLogger.deprecate(Integer.toString(id), "This is a maybe logged deprecation message" + id); + deprecationLogger.deprecate(DeprecationCategory.OTHER, Integer.toString(id), + "This is a maybe logged deprecation message" + id); } } diff --git a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java index fd8217d4c78fb..5769d85436df9 100644 --- a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java @@ -89,7 +89,7 @@ public void tearDown() throws Exception { public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { final DeprecationLogger testLogger = DeprecationLogger.getLogger("test"); - testLogger.deprecate("a key", "deprecated message1"); + testLogger.deprecate(DeprecationCategory.OTHER, "a key", "deprecated message1"); final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), System.getProperty("es.logs.cluster_name") + "_deprecated.json"); @@ -111,7 +111,8 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { hasEntry("data_stream.namespace", "default"), hasEntry("ecs.version", DeprecatedMessage.ECS_VERSION), hasEntry("key", "a key"), - not(hasKey("x-opaque-id")) + not(hasKey("x-opaque-id")), + hasEntry("elasticsearch.event.category", "other") ) ) ); @@ -124,7 +125,7 @@ public void testDeprecatedMessage() throws Exception { withThreadContext(threadContext -> { threadContext.putHeader(Task.X_OPAQUE_ID, "someId"); final DeprecationLogger testLogger = DeprecationLogger.getLogger("test"); - testLogger.deprecate("someKey", "deprecated message1"); + testLogger.deprecate(DeprecationCategory.OTHER, "someKey", "deprecated message1"); final Path path = PathUtils.get( System.getProperty("es.logs.base_path"), @@ -149,7 +150,8 @@ public void testDeprecatedMessage() throws Exception { hasEntry("data_stream.namespace", "default"), hasEntry("ecs.version", DeprecatedMessage.ECS_VERSION), hasEntry("key", "someKey"), - hasEntry("x-opaque-id", "someId") + hasEntry("x-opaque-id", "someId"), + hasEntry("elasticsearch.event.category", "other") ) ) ); @@ -336,8 +338,8 @@ public void testDuplicateLogMessages() throws Exception { // For the same key and X-Opaque-ID deprecation should be once withThreadContext(threadContext -> { threadContext.putHeader(Task.X_OPAQUE_ID, "ID1"); - deprecationLogger.deprecate("key", "message1"); - deprecationLogger.deprecate("key", "message2"); + deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1"); + deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2"); assertWarnings("message1", "message2"); final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), @@ -354,7 +356,8 @@ public void testDuplicateLogMessages() throws Exception { hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), hasEntry("message", "message1"), - hasEntry("x-opaque-id", "ID1")) + hasEntry("x-opaque-id", "ID1"), + hasEntry("elasticsearch.event.category", "other")) ) ); } @@ -364,8 +367,8 @@ public void testDuplicateLogMessages() throws Exception { //continuing with message1-ID1 in logs already, adding a new deprecation log line with message2-ID2 withThreadContext(threadContext -> { threadContext.putHeader(Task.X_OPAQUE_ID, "ID2"); - deprecationLogger.deprecate("key", "message1"); - deprecationLogger.deprecate("key", "message2"); + deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1"); + deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2"); assertWarnings("message1", "message2"); final Path path = PathUtils.get( @@ -385,7 +388,8 @@ public void testDuplicateLogMessages() throws Exception { hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), hasEntry("message", "message1"), - hasEntry("x-opaque-id", "ID1") + hasEntry("x-opaque-id", "ID1"), + hasEntry("elasticsearch.event.category", "other") ), allOf( hasEntry("type", "deprecation"), @@ -394,7 +398,8 @@ public void testDuplicateLogMessages() throws Exception { hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), hasEntry("message", "message1"), - hasEntry("x-opaque-id", "ID2") + hasEntry("x-opaque-id", "ID2"), + hasEntry("elasticsearch.event.category", "other") ) ) ); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index 9e9c0592bf6e0..1692e67a083be 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -30,6 +30,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.indices.SystemIndices; @@ -112,7 +113,7 @@ private static void checkSystemIndexAccess(GetAliasesRequest request, SystemIndi } } if (systemIndicesNames.isEmpty() == false) { - deprecationLogger.deprecate("open_system_index_access", + deprecationLogger.deprecate(DeprecationCategory.API, "open_system_index_access", "this request accesses system indices: {}, but in a future major version, direct access to system " + "indices will be prevented by default", systemIndicesNames); } else { @@ -125,7 +126,7 @@ private static void checkSystemAliasAccess(GetAliasesRequest request, SystemIndi .filter(alias -> systemIndices.isSystemIndex(alias)) .collect(Collectors.toList()); if (systemAliases.isEmpty() == false) { - deprecationLogger.deprecate("open_system_alias_access", + deprecationLogger.deprecate(DeprecationCategory.API, "open_system_alias_access", "this request accesses aliases with names reserved for system indices: {}, but in a future major version, direct" + "access to system indices and their aliases will not be allowed", systemAliases); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java index 15cc0a327a384..600b14857d294 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java @@ -28,6 +28,7 @@ import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.time.DateFormatter; @@ -321,7 +322,7 @@ private void checkSystemIndexAccess(Context context, Metadata metadata, Set