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

Fixes iota unexpected behaviour with bytes for chunk encoding. #2945

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

cyriltovena
Copy link
Contributor

This was introducing incompatibilities since iota with bytes starts at 2.
Seems like a weird conversion between iota int and byte.

This can currently corrupt chunks, and previous chunks are not decodable. New chunk are decodable because we encode/decode with the wrong value, this is also why tests are passing.

Signed-off-by: Cyril Tovena [email protected]

This was introducing incompatibilities since iota with bytes starts at 2.
Seems like a weird conversion between iota int and byte.

This can currenlty corrupt chunks, and previous chunks are not decodable.

Signed-off-by: Cyril Tovena <[email protected]>
Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

I think either I am missing something or there is a bug in Go.
See the difference in behaviour between this and this.

Hardcoded values are better for now so approving it.

@cyriltovena
Copy link
Contributor Author

this

Well you just helped me figured out what was going on, basically the iota needs to be in his own const() or at the top.

@cyriltovena
Copy link
Contributor Author

@sandeepsukhani check this out now.

@cyriltovena cyriltovena merged commit fa7ea9c into grafana:master Nov 18, 2020
@cyriltovena cyriltovena mentioned this pull request Nov 18, 2020
slim-bean pushed a commit that referenced this pull request Dec 10, 2020
* Fixes iota unexpected behaviour with bytes for chunk encoding.

This was introducing incompatibilities since iota with bytes starts at 2.
Seems like a weird conversion between iota int and byte.

This can currenlty corrupt chunks, and previous chunks are not decodable.

Signed-off-by: Cyril Tovena <[email protected]>

* With iota correclty this time.

Signed-off-by: Cyril Tovena <[email protected]>
(cherry picked from commit fa7ea9c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants