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

Limit group by to MaxGroupByPoints (currently 100,000) #2004

Merged
merged 18 commits into from
Mar 19, 2015
Merged

Conversation

corylanou
Copy link
Contributor

Fixes #1992

Also fixes a bug in results.Error(). It wasn't looking into the slice of series to see if those also had an error. I needed to fix that to make my tests work otherwise I couldn't see the error.

@pauldix
Copy link
Member

pauldix commented Mar 18, 2015

One possible enhancement we could make to this is to either use the limit or the end time of the query.


// Write series with one point to the database.
s.MustWriteSeries("foo", "raw", []influxdb.Point{{Name: "cpu", Tags: map[string]string{"region": "us-east"}, Timestamp: mustParseTime("2000-01-01T00:00:00Z"), Fields: map[string]interface{}{"value": float64(10)}}})
s.MustWriteSeries("foo", "raw", []influxdb.Point{{Name: "cpu", Tags: map[string]string{"region": "us-east"}, Timestamp: mustParseTime("2000-01-01T00:00:10Z"), Fields: map[string]interface{}{"value": 20}}})
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this case only require 1 write? If so, the code could be shorter.

@@ -1506,6 +1506,37 @@ func TestServer_LimitAndOffset(t *testing.T) {
}
}

// Ensure the server can execute a group by with a fill(0) and very large limit
// that results in a grouping of over 100,000 points returns an error
func TestServer_ExecuteGroupByFillLimit(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

I think server_integration_test.go would be a better place for this. Easier to just add this to the table tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was headed that direction and realized that those tests aren't set up to check for error conditions. I do agree it should be there. I'll have to do some refactoring of that test suite to make this one possible.

}

// If we start getting out of our max time range, then truncate values and return
if t > m.TMax && !isRaw {
Copy link
Member

Choose a reason for hiding this comment

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

Would this ever happen? Shouldn't the size of resultTimes be fixed to the exact number of buckets we want?

@@ -952,25 +961,23 @@ func runTestsData(t *testing.T, testName string, nodes Cluster, database, retent
},
}

// See if we should run a subset of this test
testPrefix := os.Getenv("TEST_PREFIX")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give me an example of TEST_PREFIX?

Copy link
Contributor

Choose a reason for hiding this comment

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

limit and for example?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this idea. What if we made it a regex, kinda like the -run flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm all for it. I likely won't do it on this PR due to needing to get it shipped. But if I don't get to it, feel free to add it as well. Makes a lot of sense to work just like the run flag.

@otoolep
Copy link
Contributor

otoolep commented Mar 19, 2015

Made the test @corylanou requested, but now the tests are failing. Looking into it.

@otoolep
Copy link
Contributor

otoolep commented Mar 19, 2015

I see the original implementation of Aggregated did a walk, so IsRawQuery is not an exact copy.

@pauldix
Copy link
Member

pauldix commented Mar 19, 2015

@otoolep yeah, IsRawQuery should actually be doing the same thing Aggregated() is doing, but inverse :)

@otoolep
Copy link
Contributor

otoolep commented Mar 19, 2015

D'oh @pauldix of course, reverse it.

@pauldix
Copy link
Member

pauldix commented Mar 19, 2015

LGTM 🚢

otoolep added a commit that referenced this pull request Mar 19, 2015
Limit group by to MaxGroupByPoints (currently 100,000)
@otoolep otoolep merged commit 62dc60d into master Mar 19, 2015
@otoolep otoolep deleted the limit-group-by branch March 19, 2015 23:45
@corylanou
Copy link
Contributor Author

@otoolep Super big awesome thank you for picking this up!

mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
* Update icon font

* Make nav bar icon font size a whole number

* Change icons in navbar
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.

Setting a LIMIT to 2147483647 causes server to crash
5 participants