Skip to content

[Monitoring] Remove _type usages in _search requests #38819

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

Merged
merged 1 commit into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,8 @@
}
},
{
"bool": {
"should": [
{
"term": {
"_type": "cluster_state"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This filter was being used for legacy documents to ease migration through 6.x. However, we should not see such documents in 6.7 onwards. So it's safe to remove this filter in 7.0 onwards IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

To check I understand, all documents will have an explicit type field starting in 6.7, so we don't need this extra 'or' clause that matches on document type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. In fact, documents in .monitoring-* should've had an explicit type field much before 6.7 but I'm not sure exactly when that was introduced (@pickypg?).

Copy link
Member

Choose a reason for hiding this comment

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

Any document created in 5.5+ should have _type of doc and, cluster_state in particular will no longer exist (even as a type since cluster_state and cluster_stats were merged together).

So, of interest to the Watch, the source cluster creates the watch, therefore it would appropriately handles its own data. As a result, this is safe to change, but it means that if someone just upgraded from 5.4 to 5.6 to 6.7, then it would effectively ignore the pre-5.5 data once they got to 6.7 with that type dropped. Given its purpose, that's safe.

}
},
{
"term": {
"type": "cluster_stats"
}
}
]
"term": {
"type": "cluster_stats"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,8 @@
}
},
{
"bool": {
"should": [
{
"term": {
"_type": "cluster_stats"
}
},
{
"term": {
"type": "cluster_stats"
}
}
]
"term": {
"type": "cluster_stats"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,8 @@
}
},
{
"bool": {
"should": [
{
"term": {
"_type": "kibana_stats"
}
},
{
"term": {
"type": "kibana_stats"
}
}
]
"term": {
"type": "kibana_stats"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,8 @@
}
},
{
"bool": {
"should": [
{
"term": {
"_type": "logstash_stats"
}
},
{
"term": {
"type": "logstash_stats"
}
}
]
"term": {
"type": "logstash_stats"
}
}
]
Expand Down