Skip to content

Commit a0e7e35

Browse files
dsabsayDaniel Sabsay
and
Daniel Sabsay
authored
sort ingesters when generating token lookup table fix #6513 (#6535)
* sort ingesters when generating token lookup table fix #6513 Signed-off-by: Daniel Sabsay <[email protected]> * improve readability Signed-off-by: Daniel Sabsay <[email protected]> --------- Signed-off-by: Daniel Sabsay <[email protected]> Co-authored-by: Daniel Sabsay <[email protected]>
1 parent 3289a24 commit a0e7e35

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: pkg/ring/model.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,14 @@ func (d *Desc) Clone() interface{} {
479479
func (d *Desc) getTokensInfo() map[uint32]instanceInfo {
480480
out := map[uint32]instanceInfo{}
481481

482-
for instanceID, instance := range d.Ingesters {
482+
instanceIDs := []string{}
483+
for key := range d.Ingesters {
484+
instanceIDs = append(instanceIDs, key)
485+
}
486+
sort.Strings(instanceIDs)
487+
488+
for _, instanceID := range instanceIDs {
489+
instance := d.Ingesters[instanceID]
483490
info := instanceInfo{
484491
InstanceID: instanceID,
485492
Zone: instance.Zone,

0 commit comments

Comments
 (0)