Skip to content

Commit

Permalink
Add a couple TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
pr00se committed Jul 16, 2024
1 parent 55142fa commit be16d49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ring/lifecycler.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ func (i *Lifecycler) loop(ctx context.Context) error {
// if observeChan is nil, this case is ignored. We keep updating observeChan while observing the ring.
// When observing is done, observeChan is set to nil.

// TODO -- there are no tests for this

observeChan = nil
if s := i.GetState(); s != JOINING {
level.Error(i.logger).Log("msg", "unexpected state while observing tokens", "state", s, "ring", i.RingName)
Expand Down Expand Up @@ -711,6 +713,8 @@ func (i *Lifecycler) initRing(ctx context.Context) error {
instanceDesc.Tokens = tokens
}

// TODO -- if the instance in the ring is ACTIVE but joinedState is READONLY (or vice versa), we should change the ring state to match joinedState

// Set the local state based on the updated instance.
i.setState(instanceDesc.State)
i.setTokens(tokens)
Expand Down

0 comments on commit be16d49

Please sign in to comment.