-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Description
Before the introduction of normalized tokens, Desc.AddIngester
used to append tokens to the existing ones. But currently, it works as append
when it's not normalized tokens and replace
when it's normalized tokens.
Lines 38 to 63 in 08ddf88
// AddIngester adds the given ingester to the ring. | |
func (d *Desc) AddIngester(id, addr string, tokens []uint32, state IngesterState, normaliseTokens bool) { | |
if d.Ingesters == nil { | |
d.Ingesters = map[string]IngesterDesc{} | |
} | |
ingester := IngesterDesc{ | |
Addr: addr, | |
Timestamp: time.Now().Unix(), | |
State: state, | |
} | |
if normaliseTokens { | |
ingester.Tokens = tokens | |
} else { | |
for _, token := range tokens { | |
d.Tokens = append(d.Tokens, TokenDesc{ | |
Token: token, | |
Ingester: id, | |
}) | |
} | |
sort.Sort(ByToken(d.Tokens)) | |
} | |
d.Ingesters[id] = ingester | |
} |
Looking at places where Desc.AddIngester
is used, append
seems to be the desired behaviour. Discovered in #1750 and @pstibrany plans to fix it in #1809
Metadata
Metadata
Assignees
Labels
No labels