Skip to content

Partition ring proposal #6932

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielblando
Copy link
Contributor

@danielblando danielblando commented Jul 31, 2025

What this PR does:
Submitting a proposal for partition ring to improve write availability with replication factor

A POC done for reference:
PartitionRing: danielblando@3e78f32
MultiRing: danielblando@dbae52c

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@danielblando danielblando force-pushed the partitionRingProposal branch 2 times, most recently from ccbc6f4 to 7e4c73f Compare July 31, 2025 17:51
Signed-off-by: Daniel Deluiggi <[email protected]>
@danielblando danielblando force-pushed the partitionRingProposal branch from 7e4c73f to 0ec86eb Compare July 31, 2025 17:59
Copy link
Contributor

@anna-tran anna-tran left a comment

Choose a reason for hiding this comment

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

Nice proposal, I can really see this improving service availability when there are multiple bad hosts.

Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

Looks like a good idea.

It would be nice if you could provide references for the partition approach, if you have any.


### Partition Ring Architecture

A new Partition Ring is proposed where the ring is divided into partitions, with each partition containing a set of tokens and a group of ingesters. Ingesters are allocated to partitions based on their order in the zonal StatefulSet, ensuring that scaling operations align with StatefulSet's LIFO behavior. Each partition contains a number of ingesters equal to the replication factor, with exactly one ingester per availability zone.
Copy link
Member

Choose a reason for hiding this comment

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

Considering your well described current behavior

  1. Hashes the series labels to get a hash value
  2. Finds the primary ingester (smallest token > hash value)
  3. When replication is enabled, selects additional replicas by moving clockwise around the ring
  4. Ensures replicas are distributed across different availability zones

We will now find the next partition instead of the next ingester (2) using the same hash as before. Finding the 3 ingesters from the partition (3). Ingesters in partitions are already in different zones, so no need for 4.

Am I understanding it correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kind of. I am not sure if i understood your "find the next partition". We only need to find one partition with the new approach.
We will do

  1. Hashes the series labels to get a hash value
  2. Finds the partition owning smaller token based on hashed value
  3. Get all ingester which are part of that partition

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 2, 2025
@danielblando
Copy link
Contributor Author

@friedrichg thanks. I am not sure if i have any reference. I did add a POC i done to prove the concept before. But it is mostly code

@SungJin1212
Copy link
Member

Looks promising, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ring lgtm This PR has been approved by a maintainer size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants