Skip to content

System index deprecation warning is not critical #79633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static void checkSystemIndexAccess(
}
});
if (systemIndicesNames.isEmpty() == false) {
deprecationLogger.critical(
deprecationLogger.warn(
DeprecationCategory.API,
"open_system_index_access",
"this request accesses system indices: {}, but in a future major version, direct access to system "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ private void checkSystemIndexAccess(Context context, Set<Index> concreteIndices,

if (resolvedSystemIndices.isEmpty() == false) {
Collections.sort(resolvedSystemIndices);
deprecationLogger.critical(
deprecationLogger.warn(
DeprecationCategory.API,
"open_system_index_access",
"this request accesses system indices: {}, but in a future major version, direct access to system "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.elasticsearch.action.admin.indices.alias.get;

import org.apache.logging.log4j.Level;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.AliasMetadata;
Expand Down Expand Up @@ -120,8 +121,12 @@ public void testDeprecationWarningEmittedForTotalWildcard() {
assertThat(result.get(".b").size(), equalTo(1));
assertThat(result.get("c").size(), equalTo(1));
assertWarnings(
"this request accesses system indices: [.b], but in a future major version, direct access to system "
+ "indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.b], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);
}

Expand All @@ -147,8 +152,12 @@ public void testDeprecationWarningEmittedWhenSystemIndexIsRequested() {
assertThat(result.size(), equalTo(1));
assertThat(result.get(".b").size(), equalTo(1));
assertWarnings(
"this request accesses system indices: [.b], but in a future major version, direct access to system "
+ "indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.b], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);
}

Expand All @@ -173,8 +182,12 @@ public void testDeprecationWarningEmittedWhenSystemIndexIsRequestedByAlias() {
assertThat(result.size(), equalTo(1));
assertThat(result.get(".b").size(), equalTo(1));
assertWarnings(
"this request accesses system indices: [.b], but in a future major version, direct access to system "
+ "indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.b], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.cluster.metadata;

import org.apache.logging.log4j.Level;
import org.elasticsearch.Version;
import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.IndicesRequest;
Expand Down Expand Up @@ -2306,8 +2307,12 @@ public void testFullWildcardSystemIndexResolutionDeprecated() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, containsInAnyOrder("some-other-index", ".ml-stuff", ".ml-meta", ".watches"));
assertWarnings(
"this request accesses system indices: [.ml-meta, .ml-stuff, .watches], but in a future major version, "
+ "direct access to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.ml-meta, .ml-stuff, .watches], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);

}
Expand All @@ -2320,10 +2325,13 @@ public void testSingleSystemIndexResolutionDeprecated() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, containsInAnyOrder(".ml-meta"));
assertWarnings(
"this request accesses system indices: [.ml-meta], but in a future major version, direct access "
+ "to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.ml-meta], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);

}

public void testWildcardSystemIndexReslutionSingleMatchDeprecated() {
Expand All @@ -2334,8 +2342,12 @@ public void testWildcardSystemIndexReslutionSingleMatchDeprecated() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, containsInAnyOrder(".watches"));
assertWarnings(
"this request accesses system indices: [.watches], but in a future major version, direct access "
+ "to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.watches], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);

}
Expand All @@ -2348,8 +2360,12 @@ public void testWildcardSystemIndexResolutionMultipleMatchesDeprecated() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, containsInAnyOrder(".ml-meta", ".ml-stuff"));
assertWarnings(
"this request accesses system indices: [.ml-meta, .ml-stuff], but in a future major version, direct access "
+ "to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.ml-meta, .ml-stuff], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);

}
Expand Down Expand Up @@ -2396,8 +2412,12 @@ public void testExternalSystemIndexAccess() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, contains(".external-sys-idx"));
assertWarnings(
"this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
+ "to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.external-sys-idx], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);
}
}
Expand All @@ -2409,8 +2429,12 @@ public void testExternalSystemIndexAccess() {
List<String> indexNames = resolveConcreteIndexNameList(state, request);
assertThat(indexNames, contains(".external-sys-idx"));
assertWarnings(
"this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
+ "to system indices will be prevented by default"
true,
new DeprecationWarning(
Level.WARN,
"this request accesses system indices: [.external-sys-idx], "
+ "but in a future major version, direct access to system indices will be prevented by default"
)
);
}
}
Expand Down