Skip to content

[rhythm] Add endpoint for partition downscaling#4913

Merged
mapno merged 17 commits intografana:mainfrom
mapno:partition-downscale
Jun 11, 2025
Merged

[rhythm] Add endpoint for partition downscaling#4913
mapno merged 17 commits intografana:mainfrom
mapno:partition-downscale

Conversation

@mapno
Copy link
Copy Markdown
Contributor

@mapno mapno commented Mar 27, 2025

What this PR does:

Introduce /ingester/prepare-partition-downscale endpoint to manage ingester partition states. This enables transitions between ACTIVE and INACTIVE states, supporting partition downscaling.

Which issue(s) this PR fixes:
Fixes #

Checklist

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

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had any activity in the past 60 days.
The next time this stale check runs, the stale label will be removed if there is new activity. This pull request will be closed in 15 days if there is no new activity.
Please apply keepalive label to exempt this Pull Request.

@github-actions github-actions Bot added the stale Used for stale issues / PRs label May 27, 2025
mapno added 3 commits June 2, 2025 11:23
Introduce `/ingester/prepare-partition-downscale` endpoint to manage ingester partition states. This enables transitions between ACTIVE and INACTIVE states, supporting partition downscaling.

Signed-off-by: Mario <mariorvinas@gmail.com>
@mapno mapno force-pushed the partition-downscale branch from 7e2c936 to ebb6efd Compare June 2, 2025 13:04
@mapno mapno requested a review from knylander-grafana as a code owner June 2, 2025 13:17
@github-actions github-actions Bot removed the stale Used for stale issues / PRs label Jun 3, 2025
Copy link
Copy Markdown
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

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

LGTM just some minor suggestions

import (
"net/http"

kitlog "github.com/go-kit/log"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we use the standard slog instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't a strong opinion on loggers, but slog is not widely used in the codebase. IMO for consistency the go-kit logger makes more sense.

Comment thread modules/ingester/downscale.go Outdated
Copy link
Copy Markdown
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

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

LGTM

}

// If partition is inactive, make it active. We ignore other states Active and especially Pending.
if state == ring.PartitionInactive {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment says other states are ignored - but it's not clear what happens in the else condition - are they noops? It might be more clear to do an early return instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a noop, yes. It still returns with a response with the state of the partition.

Comment thread modules/ingester/downscale.go
@mapno mapno enabled auto-merge (squash) June 11, 2025 12:00
@mapno mapno merged commit 6b3e4a5 into grafana:main Jun 11, 2025
21 checks passed
@mapno mapno deleted the partition-downscale branch June 11, 2025 12:14
ie-pham pushed a commit that referenced this pull request Apr 8, 2026
* Add endpoint for partition downscaling

Introduce `/ingester/prepare-partition-downscale` endpoint to manage ingester partition states. This enables transitions between ACTIVE and INACTIVE states, supporting partition downscaling.

Signed-off-by: Mario <mariorvinas@gmail.com>

* chlog

* Add partition downscale integration tests

* fmt

* Remove unused code

* More stable?

* Unnecessary cleanup

* Fix harder

* Implement missing method

* pls

* Return partition state

* fix

* switch

* comment

---------

Signed-off-by: Mario <mariorvinas@gmail.com>
ie-pham added a commit that referenced this pull request Apr 9, 2026
* chore(deps): update grpc to v1.79.3, otel to v1.40.0, dskit, and gomemcache

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(deps): update module go.opentelemetry.io/otel/sdk to v1.40.0 [security] (main) (#6518)

* fix(deps): update module go.opentelemetry.io/otel/sdk to v1.40.0 [security]

| datasource | package                      | from    | to      |
| ---------- | ---------------------------- | ------- | ------- |
| go         | go.opentelemetry.io/otel/sdk | v1.38.0 | v1.40.0 |
| go         | go.opentelemetry.io/otel/sdk | v1.39.0 | v1.40.0 |

Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>

* include missing implementation

---------

Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: javiermolinar <javimolina@fastmail.com>

* Update dskit and adjust memcached interface signature (#5604)

* Update dskit and adjust memcached interface signature

* Generate config manifest

* [rhythm] Add endpoint for partition downscaling (#4913)

* Add endpoint for partition downscaling

Introduce `/ingester/prepare-partition-downscale` endpoint to manage ingester partition states. This enables transitions between ACTIVE and INACTIVE states, supporting partition downscaling.

Signed-off-by: Mario <mariorvinas@gmail.com>

* chlog

* Add partition downscale integration tests

* fmt

* Remove unused code

* More stable?

* Unnecessary cleanup

* Fix harder

* Implement missing method

* pls

* Return partition state

* fix

* switch

* comment

---------

Signed-off-by: Mario <mariorvinas@gmail.com>

* manifest.md

* chore: fix vendor after cherry-pick of 6b3e4a5

Remove e2e vendor files added by the cherry-pick that are inconsistent
with the pinned go.mod version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* revert: undo cherry-pick of 6b3e4a5 (partition downscaling feature)

Cherry-pick brought in too much unrelated feature code for a release branch:
new integration tests, production code, and an e2e dependency upgrade.
Will apply the minimal fix (GetSubringForOperationStates on mockRing) manually instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: add GetSubringForOperationStates to mockRing to satisfy ring.ReadRing interface

Required by dskit upgrade; method added to ring.ReadRing interface.
Minimal manual fix — no suitable targeted cherry-pick available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* manifest.md

---------

Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Signed-off-by: Mario <mariorvinas@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: javiermolinar <javimolina@fastmail.com>
Co-authored-by: Zach Leslie <zach.leslie@grafana.com>
Co-authored-by: Mario <mariorvinas@gmail.com>
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.

4 participants