-
Notifications
You must be signed in to change notification settings - Fork 25.5k
AutoCreate should work for non-primary system indices #77045
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
williamrandolph
merged 6 commits into
elastic:master
from
williamrandolph:system-indices-autocreate-non-primary-index
Sep 2, 2021
Merged
AutoCreate should work for non-primary system indices #77045
williamrandolph
merged 6 commits into
elastic:master
from
williamrandolph:system-indices-autocreate-non-primary-index
Sep 2, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pinging @elastic/es-core-infra (Team:Core/Infra) |
gwbrown
approved these changes
Aug 31, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple minor comments but otherwise LGTM. Thanks!
...lClusterTest/java/org/elasticsearch/action/admin/indices/create/AutoCreateSystemIndexIT.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/create/AutoCreateAction.java
Outdated
Show resolved
Hide resolved
💔 Backport failed
To backport manually run |
williamrandolph
added a commit
that referenced
this pull request
Sep 2, 2021
Previously, we handled the case of a write request to a system index alias without a backing index by auto-creating the primary index. This had the unfortunate side-effect of making it impossible to auto-create non-primary system indices. This commit fixes the bug so that we can handle both cases. * Add internal cluster test for system index auto create * Allow auto-creation of non-primary indices for a system index pattern * Use primary index if autocreate is called with system index alias name
williamrandolph
added a commit
that referenced
this pull request
Sep 2, 2021
Previously, we handled the case of a write request to a system index alias without a backing index by auto-creating the primary index. This had the unfortunate side-effect of making it impossible to auto-create non-primary system indices. This commit fixes the bug so that we can handle both cases. * Add internal cluster test for system index auto create * Allow auto-creation of non-primary indices for a system index pattern * Use primary index if autocreate is called with system index alias name
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Core/Infra/Core
Core issues without another label
Team:Core/Infra
Meta label for core/infra team
v7.15.1
v7.16.0
v8.0.0-alpha2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on a Machine Learning PR, @benwtrent noticed that certain bulk requests didn't work with system indices. Specifically, if we submitted a bulk request adding a document to an index that matched a system index pattern, did not yet exist, and didn't have the same name as the "primary index" for the system index descriptor, the request would fail. It turns out that we simply hadn't handled this case in #65970, apparently as an oversight. (In most or all other cases, the primary index is the only writeable index for a system index pattern.)
This PR fixes the bug and allows our code to autocreate non-primary system indices.