Skip to content

Ingester can now flush only specified users. #4073

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 7 commits into from
Apr 15, 2021

Conversation

pstibrany
Copy link
Contributor

@pstibrany pstibrany commented Apr 13, 2021

What this PR does: This PR adds tenant parameter to /flush handler. When used, only specific tenant is flushed and only this tenants' blocks are shipped. tenant parameter may be used multiple times to specify many tenants at once.

This PR also adds wait parameter to /flush method, which makes the method synchronous -- it only returns when compact + ship cycle have finished. Note that /flush still only returns 204, no matter the result of compaction or shipment.

These two enhancements are only available when using blocks storage.

Checklist

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

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.

Flawless job! 👏 I just have a comment about using the query string parameter vs the canonical X-Scope-OrgID but, a part from this, LGTM!

}()
}

const waitParam = "wait"
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] I would define it close to the tenant param (if we'll keep it), given they both apply to the same API endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest we keep it. Moving to tenantParam.

@pstibrany
Copy link
Contributor Author

Thank you for review, I've addressed your comments now.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
@pstibrany pstibrany force-pushed the ingester-flush-tenants branch from b1d4e81 to 5310d07 Compare April 14, 2021 13:03
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
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.

Good job, LGTM! I just left a comment about AllowedTenants: up to you if it's worth using it.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
@pstibrany pstibrany merged commit 03c092f into cortexproject:master Apr 15, 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.

2 participants