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

Correct marshalling of remotely-mapped data #4191

Merged
merged 4 commits into from
Sep 22, 2015
Merged

Correct marshalling of remotely-mapped data #4191

merged 4 commits into from
Sep 22, 2015

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Sep 22, 2015

The fundamental problem was over-use of interface{} which was preventing proper unmarshalling. This change instead makes use of []byte and [][]byte where necessary, so proper unmarshalling takes place on the local side. This is how the code operated before the DQ-refactor, but this bug was not caught since only some aggregate functions were affected by the bug. count and sum worked fine in DQ mode, but mean (for example) did not.

The other key change is making the correct unmarshalling functions available to the remote mapper code. Without this change, a fix was impossible since the remote mapper wouldn't know the correct types, e.g. meanMapOutput for the unmarshalling of aggregate data.

This solution is not ideal, but more changes are due in this area very soon, so this patch aims to work with the existing framework.

I tested this by setting a single-node into forced-remote mapping mode and ran mean queries. Before this fix, the system panicked with the trace in #4170. With the fix in place, everything works fine.

Fixes #4170

@otoolep otoolep changed the title Simple tests work Correct marshalling of remotely-mapped data Sep 22, 2015
@otoolep otoolep force-pushed the full_marshal branch 2 times, most recently from 9ed59fb to 720d368 Compare September 22, 2015 05:46
@otoolep otoolep force-pushed the full_marshal branch 2 times, most recently from 644ae43 to f85b162 Compare September 22, 2015 07:20
@otoolep
Copy link
Contributor Author

otoolep commented Sep 22, 2015

func (lm *SelectMapper) Open() error {
// If in aggregate mode, initialize the map-and-reduce functions. Both local and
// remote mappers need this.
if !lm.rawMode {
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 was moved up here because it now needs to be done before the remote mapper is opened.

@dgnorton
Copy link
Contributor

+1

@otoolep
Copy link
Contributor Author

otoolep commented Sep 22, 2015

Comment corrected @corylanou

Merging now.

otoolep added a commit that referenced this pull request Sep 22, 2015
Correct marshalling of remotely-mapped data
@otoolep otoolep merged commit d1402f7 into master Sep 22, 2015
@otoolep otoolep deleted the full_marshal branch September 22, 2015 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.9.4.1] panic: interface conversion: interface {} is map[string]interface {}, not *influxql.meanMapOutput
3 participants