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

Implement hidden aliases #52547

Merged
merged 21 commits into from
Mar 3, 2020
Merged

Implement hidden aliases #52547

merged 21 commits into from
Mar 3, 2020

Conversation

gwbrown
Copy link
Contributor

@gwbrown gwbrown commented Feb 20, 2020

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 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.

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.
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@jaymode jaymode 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 so far. I left a question just to make sure I am understanding properly.

@gwbrown gwbrown marked this pull request as ready for review February 29, 2020 01:12
@gwbrown gwbrown requested a review from jaymode February 29, 2020 01:12
@gwbrown gwbrown removed the WIP label Feb 29, 2020
Copy link
Member

@jaymode jaymode left a 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) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@Nullable Boolean writeIndex, Boolean isHidden) {
@Nullable Boolean writeIndex, @Nullable Boolean isHidden) {

@@ -112,6 +115,10 @@ public Boolean writeIndex() {
return writeIndex;
}

public Boolean isHidden() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Boolean isHidden) {
@Nullable Boolean isHidden) {

@@ -120,6 +128,10 @@ public Boolean writeIndex() {
return writeIndex;
}

public Boolean isHidden() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public Boolean isHidden() {
@Nullable
public Boolean isHidden() {

@jaymode jaymode mentioned this pull request Mar 3, 2020
23 tasks
@gwbrown
Copy link
Contributor Author

gwbrown commented Mar 3, 2020

Thanks for the review @jaymode, nice catches.

@gwbrown gwbrown merged commit 351c2f9 into elastic:master Mar 3, 2020
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Mar 4, 2020
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.
gwbrown added a commit that referenced this pull request Mar 6, 2020
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.
gwbrown added a commit to gwbrown/elasticsearch that referenced this pull request Mar 6, 2020
This commit corrects the serialization versions for hidden alias data
following the backport of elastic#52547.
gwbrown added a commit that referenced this pull request Mar 7, 2020
This commit corrects the serialization versions for hidden alias data
following the backport of #52547.
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Apr 16, 2020
Relates: elastic/elasticsearch#52547
Relates: elastic/elasticsearch#53248

This commit adds the ability to mark indices
and aliases as hidden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants