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

System index descriptors support mixed versions #71144

Merged
merged 17 commits into from
Apr 6, 2021

Conversation

jaymode
Copy link
Member

@jaymode jaymode commented Mar 31, 2021

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.

jaymode added 2 commits March 31, 2021 13:18
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.
Copy link
Member

@ywangd ywangd left a 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()
);
Copy link
Member

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.

@ywangd
Copy link
Member

ywangd commented Apr 1, 2021

@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 SecurityIndexManager still uses only the "main" systemIndexDescriptor to determine states in most places. A simple example is SecurityIndexManager#aliasName . It is not an issue for now because we have the same alias name across different versions. But it is in theory incorrect. The more complicated example is the SecurityIndexManager#clusterChanged method.

Two possible solutions that I can think of are:

  • Replace the usages with descriptorForVersion, though I am not sure how confident it is to say current descriptorForVersion is indeed the descriptor currently installed.
  • Disallow priorSystemIndexDescriptor to have different aliasName, indexFormat and primaryIndex. But it could be too constraining.

@tvernum
Copy link
Contributor

tvernum commented Apr 1, 2021

Disallow priorSystemIndexDescriptor to have different aliasName, indexFormat and primaryIndex.

This would be my preference. It's simple, it has clearly understood behaviour & it meets all of the currently identified requirements.

@jaymode
Copy link
Member Author

jaymode commented Apr 1, 2021

This would be my preference. It's simple, it has clearly understood behaviour & it meets all of the currently identified requirements.

+1. I knew about this gap and will address soon.

@jaymode jaymode marked this pull request as ready for review April 2, 2021 20:26
@jaymode jaymode requested a review from williamrandolph April 2, 2021 20:26
@jaymode jaymode added :Core/Infra/Core Core issues without another label >enhancement v7.13.0 v8.0.0 labels Apr 2, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 2, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@jaymode jaymode requested review from ywangd and tvernum April 2, 2021 20:27
Copy link
Contributor

@williamrandolph williamrandolph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jaymode jaymode merged commit f9e9483 into elastic:master Apr 6, 2021
@jaymode jaymode deleted the prior_system_index_descriptors branch April 6, 2021 19:47
jaymode added a commit that referenced this pull request Apr 7, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >enhancement Team:Core/Infra Meta label for core/infra team v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants