-
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
Downsampling: copyindex.hidden
setting from source
#89177
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
if (sourceIndexMetadata.isHidden() == false) { | ||
settings.put(IndexMetadata.SETTING_INDEX_HIDDEN, false); | ||
} |
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.
There's a small catch here. If the setting index.hidden
was not set at all in the source index, the default value is false
. Here, we explicitly set the value to false
. Hopefully, this does not interfere with anything else.
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.
Could we do something like
if (sourceIndexMetadata.isHidden() == false && sourceIndexMetadata.getSettings().keySet().contains(IndexMetadata.SETTING_INDEX_HIDDEN)) {
settings.put(IndexMetadata.SETTING_INDEX_HIDDEN, false);
}
To only set the setting if it does indeed exist on the source as explicitly set?
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.
When the rollup index is created setting index.hidden
is set to true. So, after rollup ends we want to revert this value.
I changed the code so that it removes setting (calling setNull()
) if it is not set at all in the source index.
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.
Sounds good to me 👍
...ugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java
Outdated
Show resolved
Hide resolved
Just a minor comment. For the rest LGTM. |
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, I left one suggestion though, about how we might be able to do it without the explicit setting.
if (sourceIndexMetadata.isHidden() == false) { | ||
settings.put(IndexMetadata.SETTING_INDEX_HIDDEN, false); | ||
} |
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.
Could we do something like
if (sourceIndexMetadata.isHidden() == false && sourceIndexMetadata.getSettings().keySet().contains(IndexMetadata.SETTING_INDEX_HIDDEN)) {
settings.put(IndexMetadata.SETTING_INDEX_HIDDEN, false);
}
To only set the setting if it does indeed exist on the source as explicitly set?
if it has not been set to source index.
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
Rollup indices are initially created as hidden (
index.hidden: true
).At the end of the rollup process, we must set this setting to the value the source index has