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

Return the correct auxiliary values for top/bottom #9858

Merged
merged 1 commit into from
May 17, 2018

Conversation

jsternberg
Copy link
Contributor

When top() or bottom() were used and selected auxiliary values, they
would return the wrong values that would be equal to the last point
selected. This is because the aggregators saved the memory address of
the auxiliary fields instead of copying them over. Since the same
auxiliary fields memory location is used for every value returned by the
storage engine, this resulted in the values being incorrect because they
were overwritten with incorrect values.

This fixes that so the auxiliary fields are copied out when they are
saved rather than only the memory location.

Fixes #9197.

@ghost ghost assigned jsternberg May 16, 2018
@ghost ghost added the review label May 16, 2018
@hercules-influx
Copy link
Contributor

During a run of megacheck the following issues were discovered:

heap.Fix(r.h, 0)
fmt.Println(r.h.points)
Copy link
Contributor

Choose a reason for hiding this comment

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

Debug code?

var clone FloatPoint
p.CopyTo(&clone)
heap.Push(r.h, clone)
fmt.Println(r.h.points)
Copy link
Contributor

Choose a reason for hiding this comment

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

Debug code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@jsternberg jsternberg force-pushed the js-9197-top-return-correct-auxiliary-values branch from 30c0971 to 50614ec Compare May 17, 2018 15:15
@hercules-influx
Copy link
Contributor

During a run of megacheck the following issues were discovered:

@stuartcarnie
Copy link
Contributor

CI is failing:

[ERROR] run: Command 'go vet ./...' failed with error: query/iterator_test.go:1739: unreachable code

When `top()` or `bottom()` were used and selected auxiliary values, they
would return the wrong values that would be equal to the last point
selected. This is because the aggregators saved the memory address of
the auxiliary fields instead of copying them over. Since the same
auxiliary fields memory location is used for every value returned by the
storage engine, this resulted in the values being incorrect because they
were overwritten with incorrect values.

This fixes that so the auxiliary fields are copied out when they are
saved rather than only the memory location.
@jsternberg jsternberg force-pushed the js-9197-top-return-correct-auxiliary-values branch from 50614ec to 8a2bc63 Compare May 17, 2018 15:25
@jsternberg
Copy link
Contributor Author

Maybe that explains why megacheck has been failing. Fixed.

@hercules-influx
Copy link
Contributor

During a run of megacheck the following issues were discovered:

@jsternberg jsternberg merged commit d37dc75 into master May 17, 2018
@jsternberg jsternberg deleted the js-9197-top-return-correct-auxiliary-values branch May 17, 2018 17:35
@ghost ghost removed the review label May 17, 2018
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.

TOP() includes incorrect field values
3 participants