-
Notifications
You must be signed in to change notification settings - Fork 209
partialmessages: add per peer bounds on peer initiated groups #650
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
Conversation
c7e1d41 to
4bca56e
Compare
partialmessages/partialmsgs.go
Outdated
| // PeerInitiatedGroupLimitPerTopic limits the number of Group states all | ||
| // peers can initialize per topic. A group state is initialized by a peer if | ||
| // the peer's message marks the first time we've seen a group id. | ||
| PeerInitiatedGroupLimitPerTopic int | ||
|
|
||
| // PeerInitiatedGroupLimitPerTopicPerPeer limits the number of Group states | ||
| // a single peer can initialize per topic. A group state is initialized by a | ||
| // peer if the peer's message marks the first time we've seen a group id. | ||
| PeerInitiatedGroupLimitPerTopicPerPeer int |
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'd recommend rephrasing the comments to talk of messages with group IDs as opposed to group state. The state is private to the package so the comment might be confusing. The clarifying statement helps, but if it's directly related to the number of new messages that'd be clearer.
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 phrasing this in terms of messages is clearer. The thing this is limiting is the number of group ID related state for a group ID we don't know about.
Messages sounds like we are persisting application data, which we aren't.
Do you have a another suggestion?
4bca56e to
230b041
Compare
a306e04 to
a9c155a
Compare
230b041 to
62d3416
Compare
a9c155a to
eedfab5
Compare
62d3416 to
cc78ea4
Compare
A peer initiated group state is a state that is initiatlized due to receiving a partial message RPC for which we have not (yet) published to. It's useful to have this state so we can remember what parts a peer has if we do publish to that group. Previously we limited the total number of peer initiated group states in a topic. This was agnostic to how many groups a single peer initiated, which meant that a single peer could exhaust the whole limit. This change tracks how many group states each peer has initialized and limits each peer to a configurable number of these states. The default total and per peer limits of 255 8 are likely good enough for most use cases, but the options exist for users to change this if they need to.
changes partialMessageStatePerTopicGroup to partialMessageStatePerGroupPerTopic to better reflect its usage.
eedfab5 to
2c63415
Compare
cc78ea4 to
d704f03
Compare
A peer initiated group state is a state that is initiatlized due to receiving a partial message RPC for which we have not (yet) published to.
It's useful to have this state so we can remember what parts a peer has if we do publish to that group.
Previously we limited the total number of peer initiated group states in a topic. This was agnostic to how many groups a single peer initiated, which meant that a single peer could exhaust the whole limit.
This change tracks how many group states each peer has initialized and limits each peer to a configurable number of these states. The default total and per peer limits of 255 8 are likely good enough for most use cases, but the options exist for users to change this if they need to.
cc @kasey who suggested the idea.