-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update cortex to bring v11 schema #1201
Conversation
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
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
@@ -37,7 +38,7 @@ func (d *Distributor) PushHandler(w http.ResponseWriter, r *http.Request) { | |||
} | |||
|
|||
default: | |||
if _, err := util.ParseProtoReader(r.Context(), r.Body, &req, util.RawSnappy); err != nil { | |||
if _, err := util.ParseProtoReader(r.Context(), r.Body, int(r.ContentLength), math.MaxInt32, &req, util.RawSnappy); err != nil { |
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.
ParseProtoReader uses max size to create a LimitedReader. It feels strange to pass math.MaxInt32
in here, but reviewing the code it seems like it would be fine:
https://github.com/golang/go/blob/master/src/io/io.go#L444
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.
Nothing more to add here, but I'd echo @joe-elliott's comments.
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 sure what to use for this value, but it seems that the limit reader is used only for another CompressionType (not RawSnappy
).
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.
RawSnappy doesn't use a LimitedReader
.
For now we still keep v10 as default. This will enable us to test the new schema.