Skip to content

Fix for alertmanagers not configuring users before becoming ACTIVE. #4110

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
Apr 23, 2021

Conversation

stevesg
Copy link
Contributor

@stevesg stevesg commented Apr 23, 2021

What this PR does:

(Only applies to sharding operation)

Currently when the alertmanager joins the sharding ring, it tries to
load user configurations, and checks the ring to see what users it
should be servicing. Once finished, the alertmanager changes it's state
to ACTIVE.

However, when performing this initial sync of user configurations, the
alertmanager is in the JOINING state, but checking if a user is owned
requires an instance to be in the ACTIVE state. Therefore, the initial
sync will never configure any users, but the instance will be
considered ACTIVE.

This change fixes the initial sync by considering a user to be owned by
the instance if it is in either the ACTIVE or JOINING state.

Note this fix should address the sporadic integration test failures:
The distributor forwards requests to an instance which it believes is
configured, but the request then fails, because it is not ready yet.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

(Only applies to sharding operation)

Currently when the alertmanager joins the sharding ring, it tries to
load user configurations, and checks the ring to see what users it
should be servicing. Once finished, the alertmanager changes it's state
to ACTIVE.

However, when performing this initial sync of user configurations, the
alertmanager is in the JOINING state, but checking if a user is owned
requires an instance to be in the ACTIVE state. Therefore, the initial
sync will _never_ configure any users, but the instance will be
considered ACTIVE.

This change fixes the initial sync by considering a user to be owned by
the instance if it is in either the ACTIVE or JOINING state.

Note this fix should address the sporadic integration test failures:
The distributor forwards requests to an instance which it believes is
configured, but the request then fails, because it is not ready yet.

Signed-off-by: Steve Simpson <[email protected]>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Thanks!

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Makes sense! We do it in the store-gateway too. I left a question.

Signed-off-by: Steve Simpson <[email protected]>
@stevesg stevesg marked this pull request as ready for review April 23, 2021 14:13
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM!

@pstibrany pstibrany merged commit 63703f5 into cortexproject:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants