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

Make watch history indices hidden #52962

Merged
merged 4 commits into from
Feb 28, 2020

Conversation

jaymode
Copy link
Member

@jaymode jaymode commented Feb 28, 2020

This commit updates the template used for watch history indices with
hidden index setting so that new indices will be created as hidden.

Relates #50251

This commit updates the template used for watch history indices with
hidden index setting so that new indices will be created as hidden.

Additionally, some failing tests were encountered where a search would
find the documents in the history index but a subsequent search would
fail to find the documents. This is most likely due to different
refresh times between the primary and replica shards. The failures
were resolved by using an assertsBusy to retrieve the documents.

Relates elastic#50251
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Watcher)

@gwbrown
Copy link
Contributor

gwbrown commented Feb 28, 2020

I was confused why all the assertBusy()s are required now, until I figured out that the refresh() call isn't hitting the watch history indices, because it uses a wildcard and the indices are now hidden. I think a better solution would be to modify ESIntegTestCase#refresh to (possibly optionally, possibly always?) include hidden indices.

@jaymode
Copy link
Member Author

jaymode commented Feb 28, 2020

Thanks for catching that. I reverted all of those changes

Copy link
Contributor

@gwbrown gwbrown 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 6e6b948 into elastic:master Feb 28, 2020
@jaymode jaymode deleted the watcher_history_hidden branch February 28, 2020 22:07
jaymode added a commit to jaymode/elasticsearch that referenced this pull request Feb 28, 2020
This commit updates the template used for watch history indices with
the hidden index setting so that new indices will be created as hidden.

Relates elastic#50251
jaymode added a commit that referenced this pull request Mar 6, 2020
This commit updates the template used for watch history indices with
the hidden index setting so that new indices will be created as hidden.

Relates #50251
Backport of #52962
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request May 14, 2020
[WatcherIndexTemplateRegistry](https://github.com/elastic/elasticsearch/blob/7.7/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistry.java#L74)
as of elastic#52962 requires all nodes
to be on 7.7.0 before it allows the version 11 index template to be installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

Note - this PR targets 7.x and will be back ported to 7.7.next. This conditional
installation of the template is not present in master.

closes elastic#56732
jakelandis added a commit that referenced this pull request May 15, 2020
#56734)

WatcherIndexTemplateRegistry as of #52962 
requires all nodes to be on 7.7.0 before it allows the version 11 index template to be 
installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

closes #56732
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request May 15, 2020
elastic#56734)

WatcherIndexTemplateRegistry as of elastic#52962
requires all nodes to be on 7.7.0 before it allows the version 11 index template to be
installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

closes elastic#56732
jakelandis added a commit that referenced this pull request May 15, 2020
… to use (#56734) (#56848)

WatcherIndexTemplateRegistry as of #52962 
requires all nodes to be on 7.7.0 before it allows the version 11 index template to be 
installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

closes #56732
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request May 15, 2020
elastic#56734)

WatcherIndexTemplateRegistry as of elastic#52962 
requires all nodes to be on 7.7.0 before it allows the version 11 index template to be 
installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

closes elastic#56732
jakelandis added a commit that referenced this pull request May 26, 2020
… to use (#56734) (#56855)

WatcherIndexTemplateRegistry as of #52962 
requires all nodes to be on 7.7.0 before it allows the version 11 index template to be 
installed.

While in a mixed cluster, nothing prevents Watcher from running on the new
host before the all of the nodes are on 7.7.0. This will result in the
.watcher-history-11* index without the proper mappings. Without the proper
mapping a single document (for a large watch) can exceed the default 1000 field
limit and cause error to show in the logs.

This commit ensures the same logic for writing to the index is applied as for
installing the template. In a mixed cluster, the `10` index template will continue
to be written. Only once all of nodes are on 7.7.0+ will the `11` index template
be installed and used.

closes #56732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants