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

[ML] Addressing bug streaming DatafeedConfig aggs from (<= 6.5.4) -> 6.7.0 #40610

Merged

Conversation

benwtrent
Copy link
Member

@benwtrent benwtrent commented Mar 28, 2019

There is a bug when serializing DatafeedConfgs with aggregations from earlier versions of <= 6.5.4 to 6.7.0.

When 6.5.4 or earlier version writes to the out stream, it writes aggs in the following way
Stream:
-> stuff before
-> boolean:True
-> parsedAggs Object
-> stuff after

When 6.7.0 reads from the 6.5.4 or earlier version stream, it reads in the following way
-> stuff before
-> boolean:True
-> boolean: <--- Starts corrupting stream
-> read ParsedAggs < --- fails due to reading the "second boolean"

There is a similar situation when 6.7.0 writes out aggregations, it writes two true boolean values to the stream before writing the parsed aggs.

I have tested upgrades from 6.6.0 -> 6.7.0 and the issue does not occur.

@benwtrent benwtrent added >bug :ml Machine learning v6.7.1 labels Mar 28, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@benwtrent
Copy link
Member Author

run elasticsearch-ci/2

@dimitris-athanasiou
Copy link
Contributor

Since 6.7.0 now writes the extra boolean, don't we need version checking to handle it differently?

@droberts195
Copy link
Contributor

Since 6.7.0 now writes the extra boolean, don't we need version checking to handle it differently?

6.7.0 only writes the extra boolean when talking to 6.5.x or earlier. This is wrong but there's nothing we can do about it because 6.7.0 and 6.5.x are already released so cannot be changed.

The way 6.7.x talks to 6.7.y has not been changed by this PR, so it will still be possible to have a mixed version cluster of 6.7.0 and 6.7.1.

@@ -29,7 +30,34 @@
"job_id":"old-cluster-datafeed-job",
"indices":["airline-data"],
"types":["response"],
"scroll_size": 2000
"scroll_size": 2000,
"aggregations": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the wire transport is quite different for null and non-null aggregations I think it would be good to have a second datafeed that doesn't use aggregations. I will push another test to this PR soon.

@davidkyle
Copy link
Member

I pushed a commit adding aggregations to the datafeeds in the full cluster restart tests. This bug would not have appeared in a full cluster restart scenario but it is worth updating the tests.

@droberts195 droberts195 changed the title [ML] Addressing bug streaming DatafeedConfig aggs from (<= 6.5.0) -> 6.7.0 [ML] Addressing bug streaming DatafeedConfig aggs from (<= 6.5.4) -> 6.7.0 Mar 29, 2019
The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@droberts195
Copy link
Contributor

I think Jenkins lost the elasticsearch-ci/packaging-sample request because the one related to the second commit was still queuing when I pushed the third commit - trying again.

Jenkins run elasticsearch-ci/packaging-sample

@benwtrent
Copy link
Member Author

run elasticsearch-ci/packaging-sample

1 similar comment
@Conky5
Copy link

Conky5 commented Mar 29, 2019

run elasticsearch-ci/packaging-sample

@Conky5
Copy link

Conky5 commented Mar 29, 2019

@elasticmachine run elasticsearch-ci/packaging-sample

@benwtrent benwtrent merged commit 25aa01e into elastic:6.7 Mar 29, 2019
@benwtrent benwtrent deleted the bugfix/ml-agg-bwc-datafeed-serialization-67 branch March 29, 2019 20:30
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Mar 29, 2019
…6.7.0 (elastic#40610)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Mar 29, 2019
…6.7.0 (elastic#40610)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Mar 29, 2019
…6.7.0 (elastic#40610)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
benwtrent added a commit that referenced this pull request Apr 1, 2019
…6.7.0 (#40610) (#40660)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
original-brownbear pushed a commit to original-brownbear/elasticsearch that referenced this pull request Apr 1, 2019
…6.7.0 (elastic#40610) (elastic#40660)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
benwtrent added a commit that referenced this pull request Apr 1, 2019
…6.7.0 (#40656)

* [ML] Addressing bug streaming DatafeedConfig aggs from (<= 6.5.4) -> 6.7.0 (#40610)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.

* fixing bwc test, removal of _xpack url path

* Fixing BWC test for datafeed
benwtrent added a commit that referenced this pull request Apr 2, 2019
…6.7.0 (#40659)

* [ML] Addressing bug streaming DatafeedConfig aggs from (<= 6.5.4) -> 6.7.0 (#40610)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.

* Fixing bwc test, removing types

* Fixing BWC test for datafeed

* Update 40_ml_datafeed_crud.yml

* Update build.gradle
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
…6.7.0 (elastic#40610) (elastic#40660)

* Addressing stream failure and adding tests to catch such in the future

* Add aggs to full cluster restart tests

* Test BWC for datafeeds with and without aggs

The wire serialisation is different for null/non-null
aggs, so it's worth testing both cases.
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.

None yet

6 participants