Skip to content

Check ingester has tokens before reporting ready #1260

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

Merged
merged 3 commits into from
Mar 11, 2019

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Mar 6, 2019

Fixes #1112

Also state the reason why an ingester is not reporting ready - the reason will be visible if you curl the /ready endpoint. This is to remove some head-scratching when debugging.

bboreham added 2 commits March 6, 2019 11:39
The reason will be visible if you curl the `/ready` endpoint.
This is to remove some head-scratching when debugging.

Signed-off-by: Bryan Boreham <[email protected]>
This shouldn't happen in normal operation, and reporting un-ready will
halt a Kubernetes rolling update which what we want if something has
gone wrong.

Signed-off-by: Bryan Boreham <[email protected]>
}

// Ingester always take at least minReadyDuration to become ready to work
// around race conditions with ingesters exiting and updating the ring
if time.Now().Sub(i.startTime) < i.cfg.MinReadyDuration {
return false
return fmt.Errorf("Not ready: waiting for %v after startup", i.cfg.MinReadyDuration)
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally considered that errors should be lowercase (https://github.com/golang/go/wiki/Errors). The argument is that they'll be prefixed by the caller, so you might want to put the "Not ready: %v" bit in the HTTP handler?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Bryan Boreham <[email protected]>
Copy link
Contributor

@khaines khaines left a comment

Choose a reason for hiding this comment

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

Having the not ready reason in the logs will be a huge help, thank you

@bboreham bboreham merged commit 6bb3487 into master Mar 11, 2019
@bboreham bboreham deleted the report-unready-reason branch March 11, 2019 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants