Skip to content

fix(operator): Ensure ingesters store tokens#21770

Open
saswatamcode wants to merge 1 commit intografana:mainfrom
rhobs:tokenfile
Open

fix(operator): Ensure ingesters store tokens#21770
saswatamcode wants to merge 1 commit intografana:mainfrom
rhobs:tokenfile

Conversation

@saswatamcode
Copy link
Copy Markdown

@saswatamcode saswatamcode commented May 6, 2026

What this PR does / why we need it:

This commit adds ingester args for the operator, so the ingester store tokens on disk, and can restart without resharding data.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Note

Medium Risk
Changes the ingester StatefulSet runtime args to persist ring tokens, which can affect ingester startup/resharding behavior on restarts. Low code churn, but it impacts a core component’s runtime configuration.

Overview
Ensures operator-managed ingesters persist their ring tokens by adding the -ingester.tokens-file-path argument to the ingester container (pointing at a new ingesterTokensFilePath under the data volume).

Adds a focused unit test (TestNewIngesterStatefulSet_HasTokensFileArg) to prevent regressions in the generated StatefulSet args.

Reviewed by Cursor Bugbot for commit d8a91f2. Bugbot is set up for automated code reviews on this repo. Configure here.

This commit adds ingester args for the operator, so the ingester store
tokens on disk, and can restart without resharding data.

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 6, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit d8a91f2. Configure here.

fmt.Sprintf("-config.file=%s", path.Join(config.LokiConfigMountDir, config.LokiConfigFileName)),
fmt.Sprintf("-runtime-config.file=%s", path.Join(config.LokiConfigMountDir, config.LokiRuntimeConfigFileName)),
"-config.expand-env=true",
fmt.Sprintf("-ingester.tokens-file-path=%s", ingesterTokensFilePath),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Restarts still reshard ingesters

Medium Severity

Adding -ingester.tokens-file-path leaves ingester.unregister-on-shutdown at its default true. Clean pod restarts still remove the ingester from the ring, so rollouts reshard data even though the next process reloads the same tokens.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d8a91f2. Configure here.

Copy link
Copy Markdown
Author

@saswatamcode saswatamcode May 6, 2026

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants