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

Any plans to migrate off of gogo protobuf? #4781

Open
GiedriusS opened this issue Jul 11, 2022 · 8 comments
Open

Any plans to migrate off of gogo protobuf? #4781

GiedriusS opened this issue Jul 11, 2022 · 8 comments
Labels
keepalive Skipped by stale bot type/chore Something that needs to be done; not a bug or a feature

Comments

@GiedriusS
Copy link
Contributor

Hello from the Thanos project 👋

We've been working on trying to migrate to protobuf v2 API from the unmaintained gogoprotobuf. See this issue for details. Since Thanos calls Cortex code, it means that we need to be synchronized on this. Currently, my work is blocked due to this:

panic: protobuf tag not enough fields in ThanosLabelsResponse.state: 

goroutine 432 [running]:
github.com/gogo/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0xc000159d60)
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:341 +0x138a
github.com/gogo/protobuf/proto.(*unmarshalInfo).unmarshal(0xc000159d60, {0x1163c40}, {0xc0004699b0, 0x18, 0x18})
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:138 +0x67
github.com/gogo/protobuf/proto.(*InternalMessageInfo).Unmarshal(0xc0000f9840, {0x14814c8, 0xc0007675f0}, {0xc0004699b0, 0x18, 0x18})
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:63 +0xd0
github.com/gogo/protobuf/proto.(*Buffer).Unmarshal(0xc00002b018, {0x14814c8, 0xc0007675f0})
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/proto/decode.go:424 +0x153
github.com/gogo/protobuf/proto.Unmarshal({0xc0004699b0, 0x18, 0x18}, {0x14814c8, 0xc0007675f0})
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/proto/decode.go:342 +0xef
github.com/gogo/protobuf/types.UnmarshalAny(0xc0001e5680, {0x14814c8, 0xc0007675f0})
	/home/circleci/go/pkg/mod/github.com/gogo/[email protected]/types/any.go:127 +0x1d8
github.com/cortexproject/cortex/pkg/querier/queryrange.(*Extent).toResponse(0xc00002b1e0)
...

This is because of the problem described here. I think it's impossible workaround this from Thanos side without actually migrating Cortex to v2 protobuf API because Cortex at the moment of writing uses anypb, and that calls the code which looks for those fields that don't exist in the newly generated code. Perhaps it would be possible to fix this problem from Thanos side somehow but there is one critical problem - the newer state struct member is not recognized by the gogo code which means that it will always panic.

I hope this ticket contains enough data. Has the Cortex team ever thought about this? It's tempting to update our fork of Cortex and to do (attempt to do) the migration there.

@alvinlin123
Copy link
Contributor

I think migrating to an actively maintained lib is always a good idea. I am not sure about the migration effort though since I haven't been working with Go ecosystem for long. @GiedriusS would this be something one can do in few hours? few days, or few weeks?

@alvinlin123 alvinlin123 added the type/chore Something that needs to be done; not a bug or a feature label Jul 11, 2022
@GiedriusS
Copy link
Contributor Author

Not sure about how much effort is needed for Cortex but I have done this recently for the Thanos codebase so it shouldn't take too long. Glad to hear that you would be open to such changes. I'll try migrating and see 👍

@alvinlin123
Copy link
Contributor

@GiedriusS based on thanos-io/thanos#5504 it looks like Thanos moved away from depending on Cortex; in this case, this issue is not blocking your work on thanos-io/thanos#5421 anymore right?

@stale
Copy link

stale bot commented Oct 22, 2022

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 22, 2022
@GiedriusS
Copy link
Contributor Author

Not stale

@stale stale bot removed the stale label Oct 23, 2022
@alanprot
Copy link
Member

Hi @GiedriusS :D

How is the thanos migration off gogo? I think both projects should try to move out of it before its even harder.. WDYT?

I just worried if we will have some perf penalty.

@stale
Copy link

stale bot commented Mar 20, 2023

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@alanprot
Copy link
Member

/remove stale

@alvinlin123 alvinlin123 added the keepalive Skipped by stale bot label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keepalive Skipped by stale bot type/chore Something that needs to be done; not a bug or a feature
Projects
None yet
Development

No branches or pull requests

3 participants