Skip to content
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

[ML] Fix logic for moving .ml-state-write alias from legacy to new #69039

Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -118,7 +118,7 @@ public static void createIndexAndAliasIfNecessary(Client client,
// The initial index name must be suitable for rollover functionality.
String firstConcreteIndex = indexPatternPrefix + "-000001";
String[] concreteIndexNames =
resolver.concreteIndexNames(clusterState, IndicesOptions.lenientExpandOpen(), indexPattern);
resolver.concreteIndexNames(clusterState, IndicesOptions.strictExpandHidden(), indexPattern);
Optional<IndexMetadata> indexPointedByCurrentWriteAlias = clusterState.getMetadata().hasAlias(alias)
? clusterState.getMetadata().getIndicesLookup().get(alias).getIndices().stream().findFirst()
: Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private int numberOfAnnotationsAliases() {
int count = 0;
ImmutableOpenMap<String, List<AliasMetadata>> aliases = client().admin().indices()
.prepareGetAliases(AnnotationIndex.READ_ALIAS_NAME, AnnotationIndex.WRITE_ALIAS_NAME)
.setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN)
.setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_CLOSED_HIDDEN)
.get()
.getAliases();
if (aliases != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void testDeleteDedicatedJobWithDataInShared() throws Exception {
.indices()
.prepareGetIndex()
.setIndices(dedicatedIndex)
.setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN)
.setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_CLOSED_HIDDEN)
.get()
.indices().length, equalTo(0));

Expand Down