-
Notifications
You must be signed in to change notification settings - Fork 25k
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
System index descriptors support mixed versions #71144
System index descriptors support mixed versions #71144
Conversation
System index descriptors are used to describe a system index, which are expected to change as new versions are developed. As part of this, the descriptors had a minimum supported version field so that the contents within that descriptor would not be applied if there were nodes older than that version. However, this falls short of being able to accurately describe what a system index should look like in a given cluster where there are mixed node versions. This change moves us towards being able to accurately describe and know what the system index should look like. A system index is now able to accept a list of the prior system index descriptor objects so that clusters with mixed versions can select the appropriate descriptor and ensure the index is created properly. As the node versions change during a rolling upgrade, the cluster will then be able to adapt the system index to the most recent version once all master and data nodes have been upgraded.
server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Tim Vernum <[email protected]>
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.
Looking good Jay! Thanks!
@@ -333,53 +333,63 @@ public void prepareIndexIfNeededThenExecute(final Consumer<Exception> consumer, | |||
systemIndexDescriptor.getAliasName() | |||
); |
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.
Nit: This logging maybe not accurate sometimes if either descriptorForVersion
has a different alias or descriptorForVersion
is null.
...in/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java
Outdated
Show resolved
Hide resolved
...in/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java
Outdated
Show resolved
Hide resolved
@jaymode Maybe you already have an answer for it but did not show it here because the PR is still a draft. When I zoomed out of the current issue of mappings, I noticed that Two possible solutions that I can think of are:
|
This would be my preference. It's simple, it has clearly understood behaviour & it meets all of the currently identified requirements. |
Co-authored-by: Yang Wang <[email protected]>
+1. I knew about this gap and will address soon. |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
Looks good!
server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java
Show resolved
Hide resolved
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.
LGTM
...in/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java
Outdated
Show resolved
Hide resolved
...in/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java
Show resolved
Hide resolved
Co-authored-by: Yang Wang <[email protected]>
System index descriptors are used to describe a system index, which are expected to change as new versions are developed. As part of this, the descriptors had a minimum supported version field so that the contents within that descriptor would not be applied if there were nodes older than that version. However, this falls short of being able to accurately describe what a system index should look like in a given cluster where there are mixed node versions. This change moves us towards being able to accurately describe and know what the system index should look like. A system index is now able to accept a list of the prior system index descriptor objects so that clusters with mixed versions can select the appropriate descriptor and ensure the index is created properly. As the node versions change during a rolling upgrade, the cluster will then be able to adapt the system index to the most recent version once all master and data nodes have been upgraded. Co-authored-by: Tim Vernum <[email protected]> Co-authored-by: Yang Wang <[email protected]> Backport of #71144
System index descriptors are used to describe a system index, which are
expected to change as new versions are developed. As part of this, the
descriptors had a minimum supported version field so that the contents
within that descriptor would not be applied if there were nodes older
than that version. However, this falls short of being able to
accurately describe what a system index should look like in a given
cluster where there are mixed node versions.
This change moves us towards being able to accurately describe and
know what the system index should look like. A system index is now
able to accept a list of the prior system index descriptor objects
so that clusters with mixed versions can select the appropriate
descriptor and ensure the index is created properly. As the node
versions change during a rolling upgrade, the cluster will then be
able to adapt the system index to the most recent version once all
master and data nodes have been upgraded.