-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Implement hidden aliases #52547
Implement hidden aliases #52547
Conversation
This commit introduces hidden aliases. These are similar to hidden indices, in that they are not visible by default, unless explicitly specified by name or by indicating that hidden indices/aliases are desired. The new alias property, `is_hidden` is implemented similarly to `is_write_index`, except that it must be consistent across all indices with a given alias - that is, all indices with a given alias must specify the alias as either hidden, or all specify it as non-hidden, either explicitly or by omitting the `is_hidden` property.
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
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 so far. I left a question just to make sure I am understanding properly.
server/src/main/java/org/elasticsearch/cluster/metadata/AliasOrIndex.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.
I left some suggestions about being consistent with @Nullable
for isHidden
even when we aren't completely consistent with other items. LGTM.
public Add(String index, String alias, @Nullable String filter, @Nullable String indexRouting, | ||
@Nullable String searchRouting, @Nullable Boolean writeIndex) { | ||
public Add(String index, String alias, @Nullable String filter, @Nullable String indexRouting, @Nullable String searchRouting, | ||
@Nullable Boolean writeIndex, Boolean isHidden) { |
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.
@Nullable Boolean writeIndex, Boolean isHidden) { | |
@Nullable Boolean writeIndex, @Nullable Boolean isHidden) { |
@@ -112,6 +115,10 @@ public Boolean writeIndex() { | |||
return writeIndex; | |||
} | |||
|
|||
public Boolean isHidden() { |
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.
public Boolean isHidden() { | |
@Nullable | |
public Boolean isHidden() { |
private final Boolean isHidden; | ||
|
||
private AliasMetaData(String alias, CompressedXContent filter, String indexRouting, String searchRouting, Boolean writeIndex, | ||
Boolean isHidden) { |
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.
Boolean isHidden) { | |
@Nullable Boolean isHidden) { |
@@ -120,6 +128,10 @@ public Boolean writeIndex() { | |||
return writeIndex; | |||
} | |||
|
|||
public Boolean isHidden() { |
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.
public Boolean isHidden() { | |
@Nullable | |
public Boolean isHidden() { |
Thanks for the review @jaymode, nice catches. |
This commit introduces hidden aliases. These are similar to hidden indices, in that they are not visible by default, unless explicitly specified by name or by indicating that hidden indices/aliases are desired. The new alias property, `is_hidden` is implemented similarly to `is_write_index`, except that it must be consistent across all indices with a given alias - that is, all indices with a given alias must specify the alias as either hidden, or all specify it as non-hidden, either explicitly or by omitting the `is_hidden` property.
This commit introduces hidden aliases. These are similar to hidden indices, in that they are not visible by default, unless explicitly specified by name or by indicating that hidden indices/aliases are desired. The new alias property, `is_hidden` is implemented similarly to `is_write_index`, except that it must be consistent across all indices with a given alias - that is, all indices with a given alias must specify the alias as either hidden, or all specify it as non-hidden, either explicitly or by omitting the `is_hidden` property.
This commit corrects the serialization versions for hidden alias data following the backport of elastic#52547.
This commit corrects the serialization versions for hidden alias data following the backport of #52547.
Relates: elastic/elasticsearch#52547 Relates: elastic/elasticsearch#53248 This commit adds the ability to mark indices and aliases as hidden.
This commit introduces hidden aliases. These are similar to hidden
indices, in that they are not visible by default, unless explicitly
specified by name or by indicating that hidden indices/aliases are
desired.
The new alias property,
is_hidden
is implemented similarly tois_write_index
, except that it must be consistent across all indiceswith a given alias - that is, all indices with a given alias must
specify the alias as either hidden, or all specify it as non-hidden,
either explicitly or by omitting the
is_hidden
property.This just implements hidden indices and makes a few tweaks to alias resolution to compensate - there's still a few problems that need to be addressed with visible aliases on hidden indices such as elastic/kibana#58722 (comment) and #52304.