Skip to content

Conversation

@mimir-github-bot
Copy link
Contributor

@mimir-github-bot mimir-github-bot bot commented Nov 18, 2025

Backport 282e14c from #13532


Note

Usage-tracker now rejects requests to partitions that aren’t in Running state, adding a common check used by TrackSeries and GetUsersCloseToLimit, with tests and changelog updated.

  • Usage-tracker:
    • Enforce requests only hit running partitions via new runningPartition().
      • Applied to TrackSeries and GetUsersCloseToLimit to return errors if handler is missing or not services.Running.
    • Tests: add cases ensuring errors when a partition handler is terminated; refactor GetUsersCloseToLimit tests.
  • Changelog: add BUGFIX entry describing the partition state check.

Written by Cursor Bugbot for commit 6b8e627. This will update automatically on new commits. Configure here.

…racking requests (#13532)

#### What this PR does

When new partition handler is created, it's immediately assigned to the
partitions map, but it's not ready to serve requests until it's Running.
In case some replica tries to send us a request, we should check that.

#### Which issue(s) this PR fixes or relates to

None

#### Checklist

- [x] Tests updated.
- [ ] Documentation added.
- [x] `CHANGELOG.md` updated - the order of entries should be
`[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry
is not needed, please add the `changelog-not-needed` label to the PR.
- [ ]
[`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md)
updated with experimental features.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Usage-tracker now rejects requests to partitions whose handlers aren’t
in Running state, with tests added/updated and changelog entry included.
>
> - **Usage-tracker**:
> - Add `runningPartition()` and use it in `TrackSeries()` and
`GetUsersCloseToLimit()` to require a `services.Running` partition;
return an error otherwise.
>   - Refactor and extend tests:
> - New cases ensuring errors when a partition handler is terminated.
> - Restructure `GetUsersCloseToLimit` tests and add non-running
partition case.
> - **Docs/Meta**:
> - Update `CHANGELOG.md` with a `[BUGFIX]` entry for guarding against
non-running partition handlers.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
42405da. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
(cherry picked from commit 282e14c)
@mimir-github-bot mimir-github-bot bot requested a review from a team as a code owner November 18, 2025 09:08
@mimir-github-bot mimir-github-bot bot requested review from colega and removed request for a team November 18, 2025 09:08
@colega colega enabled auto-merge (squash) November 18, 2025 09:09
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.

1 participant