-
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
Introduce syntax for marking a partial response with chunking #7368
Conversation
@jsternberg, thanks for your PR! By analyzing the annotation information on this pull request, we identified @e-dard, @gunnaraasen and @joelegasse to be potential reviewers |
deb8dfe
to
79c5a3b
Compare
706b504
to
871bb3f
Compare
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.
LGTM. @joelegasse @corylanou Can you one of you take a look as well?
871bb3f
to
aa84c08
Compare
|
Ah crap. It's a flaky test from something I just merged. I'll fix it. |
aa84c08
to
9c7b4a5
Compare
I think I fixed the flaky test. |
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.
Only concern is on the changing of the result struct. Otherwise looks good.
@@ -19,13 +19,13 @@ func init() { | |||
&Query{ | |||
name: "create database should succeed", | |||
command: `CREATE DATABASE db0`, | |||
exp: `{"results":[{}]}`, | |||
exp: `{"results":[{"statement_id":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.
This feels like a pretty big breaking change. I imagine a lot of scripts are written to expect the empty result. I'm not sure how we would be affecting the user by adding this new field in the actual result itself.
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.
Since the statement_id
is a generated ID, and doesn't matter if there are no results, the field should probably have omitempty
added to the struct tag as well. That would preserve the existing "empty object" result, and still allow for tracking partial series results
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 statement_id
is pretty important. It tells the client which statement that empty response is for so it knows it ran. Otherwise, there's no way to know which statement that empty response references.
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.
Statement ID's would have to start at 1
, not 0
then, as 0
can be a valid statement ID it looks like. I would agree that I would like to see it omitted as it creates a lot of noise when there is no response to be had.
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 is statement ID important for an empty result? I don't understand the logic.
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.
It tells the client that the statement was executed. How would you know what the empty response was for without the statement id?
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.
If it didn't execute you get an error. That's how it works today 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.
Yes, you would. But the point of this PR is to also give you information about what is being run interactively for chunking.
A different question. What benefit is there for statement ID being omitted from these results? It seems like an unnecessary complication to omit the statement id specifically for those results. Clients are supposed to check for error, not a blank JSON response. It looks like influxdb-python
checks for the error
field.
@jsternberg I believe the Ruby gem can handle this without any modification. Can you verify that a Currently, the high level methods only care about Some user-facing methods however return the raw HTTP response object which could cause trouble if the user has code validating that the response only contains I have added some statement ids into the test stubs and the suite still passes (see Travis and diff). |
Thanks. Yes, if we merge this, |
👍 |
d9f42db
to
82e9192
Compare
The `partial` tag has been added to the JSON response of a series and the result so that a client knows when more of the series or result will be sent in a future JSON chunk. This helps interactive clients who don't want to wait for all of the data to know if it is done processing the current series or the current result. Previously, the client had to guess if the next chunk would refer to the same result or a new result and it had to match the name and tags of the two series to know if they were the same series. Now, the client just needs to check the `partial` field included with the response to know if it should expect more. Fixed `max-row-limit` so it counts rows instead of results and it truncates the response when the `max-row-limit` is reached.
82e9192
to
b4db76c
Compare
These seem to have been broken in #7368.
max-row-limit was set at 10000 since 1.0, but due to a bug it was effectively 0 (disabled). 1.2 fixed this bug via #7368, but this caused a breaking change w/ Grafana and any users upgrading from <1.2 who had not disabled the config manually.
The
partial
tag has been added to the JSON response of a series andthe result so that a client knows when more of the series or result will
be sent in a future JSON chunk.
This helps interactive clients who don't want to wait for all of the
data to know if it is done processing the current series or the current
result. Previously, the client had to guess if the next chunk would
refer to the same result or a new result and it had to match the name
and tags of the two series to know if they were the same series. Now,
the client just needs to check the
partial
field included with theresponse to know if it should expect more.