Skip to content

Conversation

@MarcoPolo
Copy link
Contributor

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.

@MarcoPolo MarcoPolo requested a review from sukunrt October 24, 2025 23:13
Comment on lines +120 to +128
// 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
Copy link
Member

@sukunrt sukunrt Oct 31, 2025

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.

Copy link
Contributor Author

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?

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.
Base automatically changed from supports-partial to marco/partial-messages-2 November 14, 2025 00:19
@MarcoPolo MarcoPolo merged commit d704f03 into marco/partial-messages-2 Nov 14, 2025
9 of 10 checks passed
@MarcoPolo MarcoPolo deleted the per-peer-bounds-pm branch November 14, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants