Skip to content

Implement hidden aliases#52547

Merged
AthenaEryma merged 21 commits intoelastic:masterfrom
AthenaEryma:hidden/aliases
Mar 3, 2020
Merged

Implement hidden aliases#52547
AthenaEryma merged 21 commits intoelastic:masterfrom
AthenaEryma:hidden/aliases

Conversation

@AthenaEryma
Copy link
Copy Markdown
Contributor

@AthenaEryma AthenaEryma 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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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.

@AthenaEryma AthenaEryma marked this pull request as ready for review February 29, 2020 01:12
@AthenaEryma AthenaEryma requested a review from jaymode February 29, 2020 01:12
@AthenaEryma AthenaEryma removed the WIP label Feb 29, 2020
Copy link
Copy Markdown
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
Copy Markdown
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) {

return writeIndex;
}

public Boolean isHidden() {
Copy link
Copy Markdown
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
Copy Markdown
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) {

return writeIndex;
}

public Boolean isHidden() {
Copy link
Copy Markdown
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
@AthenaEryma
Copy link
Copy Markdown
Contributor Author

Thanks for the review @jaymode, nice catches.

@AthenaEryma AthenaEryma merged commit 351c2f9 into elastic:master Mar 3, 2020
AthenaEryma added a commit to AthenaEryma/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.
AthenaEryma 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.
AthenaEryma added a commit to AthenaEryma/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.
AthenaEryma 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