-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix aggregate output across the cluster #4815
Conversation
Thanks @li-ang -- we'll take a look. |
Have you signed the CLA @li-ang ? |
@otoolep Yes! |
OK, I see that -- thanks. CLA confirmed signed. |
Tags: mvj[0].Tags, | ||
}} | ||
|
||
if mvj[0].Time != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure why it this would make a difference. Either way you end up with a Time
field equal to 0, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the mvj[0].Time
maybe not equal to 0 when your aggregate query sentence has where time > xxx
subsentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still don't follow you. :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @otoolep, have you checked #4801 already? let's say if you execute select mean(value) from mem_used group by time(1m)
, Time
won't be zero because every interval has its own timestamp. however if you execute select mean(value) from mem_used
without groupby
, then Time
will be ignored, and the value of Time
is 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh! I see it now, the old code was not setting the time field -- I never looked there. You are right. Thanks @li-ang
However, wouldn't this change work just as well:
mo.Values = []*tsdb.MapperValue{&tsdb.MapperValue{
+ Time: mvj[0].Time,
Value: aggValues,
Tags: mvj[0].Tags,
}}
In otherwords, just set the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right. just need add Time
. @otoolep
and there will be another fix very soon following this PR.
Done! @otoolep |
Value: aggValues, | ||
Tags: mvj[0].Tags, | ||
}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why blank line?
Not sure if it's easily done, but it would be nice to see a test that shows why this fixes the problem. |
Yeah, I agree @corylanou -- it's somewhat difficult in the remote mapping scenario, but I think it's possible. |
Setting the "force remote mapping" flag might do it -- that's what it's there for. |
The InfluxDB commit is Results of setting the
Results of setting the
|
@dgnorton -- ping. |
+1 |
Fix aggregate output across the cluster
Thanks again @li-ang |
fix #4801
Ignoring time for aggregate output would lead to get wrong result when influxdb is working in cluster.
So, when the time of aggregate output isn't equal to zore, we shouldn't ignore time and return it in result.