-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
WIP towards gossiping proto only #1966
Conversation
@@ -131,7 +129,7 @@ func (g *group) compact() bool { | |||
} | |||
} | |||
|
|||
return len(g.Infos) < g.Limit | |||
return len(g.Infos) < int(g.Limit) |
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 do you need to type convert using int()?
@tamird do you think it would be better to gossip It seems like gossip is sent on behalf of other packages, so maybe encoding and decoding could happen caller side, e.g. before Anyways, I still have to make changes to crack protofying |
OTOH, it's probably better to centralize decoding and encoding in gossip. |
@thschroeter you can basically get the best of both worlds by using |
@tamird cool, will do that. |
Keeping you posted. Got tests passing in config and gossip with config.PrefixConfigMap and gossip.Info as proto. Still need to fix some tests in storage to reach a working solution. |
@thschroeter can you push your latest work? |
@tamird merging my WIP branches into one and will push my changes tomorrow for review. looking forward to your feedback. |
@tamird PTAL I will shortly push commits up to Once this works, it should be relatively easy to complete the PR and send gossip as proto. I'm happy to try a different approach otherwise. My changes make it cumbersome to gossip basic types, since I've chosen to write polymorphic fields of proto messages as unions, using gogoproto's |
@tamird, does it make sense to keep this PR open as it is, or maybe close it, or break it down into smaller tasks? I've seen configs will be redesigned in #2090. Maybe it would be helpful to focus on the gossip part? Anyways, I'd need some outline of the steps towards completing this. E.g.
I think, gossip groups (tracking minima and maxima of values in the cluster) could require OrderedMessage, that can be unmarshaled and sorted as they are received.
|
@thschroeter yeah, I think focusing on the Gossip bit is the right thing. The end goal is to protofy the return of
Does that help? I'd start with the first bullet. |
@tamird sounds good, thanks. |
gorename -from \"github.com/cockroachdb/cockroach/gossip\".info -to Info gorename -from \"github.com/cockroachdb/cockroach/gossip\".Info.peerID -to PeerID gorename -from \"github.com/cockroachdb/cockroach/gossip\".Info.seq -to Seq
gossip tests pass
PTAL It was easier (for me) to work from the leafs ( |
@thschroeter I'm going through this now; I may rewrite some of the commit history to reduce the back-and-forth on the review; hope you don't mind. |
@tamird, thanks for taking a look! Please go ahead with rewriting the history. |
I've rebased this (as one giant commit) in https://github.com/tamird/cockroach/tree/no-more-gob I'll continue teasing stuff out tomorrow. |
@thschroeter sure, let's keep the discussion in #629 then. Thanks for all your work on this! |
#629, @tamird, please take a look.
I will need some help with encoding and gossiping
PrefixConfigMap
as proto.So far I've added
proto.GossipInfoStore
and some helpers to copy data to and fromgossip.*
toproto.GossipInfoStore
. If you think this approach is valid, I continue today to define the proto structures for encoding ofPrefixConfigMap
, and then test gossiping using the new proto structures.Maye there is a simpler approach, that leads to fewer changes?
I think, it's possible to continue refactoring and use the new proto structures in
gossip.infoStore
to avoid having to copy data. I still need some time to