Skip to content
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

Expose KeepInstanceInTheRingOnShutdown config for store gateway #5421

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

justinjung04
Copy link
Contributor

@justinjung04 justinjung04 commented Jun 22, 2023

What this PR does:

Add -store-gateway.sharding-ring.keep-instance-in-the-ring-on-shutdown.

The new config sets KeepInstanceInTheRingOnShutdown configuration in basic_lifecycler, which skips unregistering instance if set to true.

if l.cfg.KeepInstanceInTheRingOnShutdown {
level.Info(l.logger).Log("msg", "keeping instance the ring", "ring", l.ringName)
} else {
// Remove the instance from the ring.
if err := l.unregisterInstance(context.Background()); err != nil {
return errors.Wrapf(err, "failed to unregister instance from the ring (ring: %s)", l.ringName)
}
level.Info(l.logger).Log("msg", "instance removed from the ring", "ring", l.ringName)
}

Similar to -ingester.unregister-on-shutdown, this new config is helpful when you want to eliminate ring-sync during rollout deployment.

Which issue(s) this PR fixes:
n/a

Checklist

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

@justinjung04 justinjung04 changed the title Expose KeepInstanceInTheRingOnShutdown in store gateway Expose KeepInstanceInTheRingOnShutdown for store gateway Jun 22, 2023
@justinjung04 justinjung04 force-pushed the expose-sg-config branch 3 times, most recently from 852284e to d461478 Compare June 22, 2023 23:43
@justinjung04 justinjung04 changed the title Expose KeepInstanceInTheRingOnShutdown for store gateway Expose KeepInstanceInTheRingOnShutdown configuration for store gateway Jun 22, 2023
@justinjung04 justinjung04 changed the title Expose KeepInstanceInTheRingOnShutdown configuration for store gateway Expose KeepInstanceInTheRingOnShutdown config for store gateway Jun 22, 2023
Signed-off-by: Justin Jung <jungjust@amazon.com>
@justinjung04 justinjung04 marked this pull request as ready for review June 23, 2023 04:54
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks!

@yeya24 yeya24 merged commit ca0ce93 into cortexproject:master Jun 26, 2023
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.

3 participants