Skip to content

Commit

Permalink
sort ingesters when generating token lookup table fix cortexproject#6513
Browse files Browse the repository at this point in the history


Signed-off-by: Daniel Sabsay <[email protected]>
  • Loading branch information
Daniel Sabsay committed Jan 23, 2025
1 parent 7bb370a commit 09711f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/ring/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,14 @@ func (d *Desc) Clone() interface{} {
func (d *Desc) getTokensInfo() map[uint32]instanceInfo {
out := map[uint32]instanceInfo{}

for instanceID, instance := range d.Ingesters {
keys := []string{}
for key, _ := range d.Ingesters {
keys = append(keys, key)
}
sort.Strings(keys)

for _, instanceID := range keys {
instance := d.Ingesters[instanceID]
info := instanceInfo{
InstanceID: instanceID,
Zone: instance.Zone,
Expand Down

0 comments on commit 09711f7

Please sign in to comment.