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

Add a DeletionMode config variable #5481

Merged

Conversation

MichelHollands
Copy link
Contributor

@MichelHollands MichelHollands commented Feb 25, 2022

What this PR does / why we need it:

A new config variable called DeletionMode with a delete mode has been added as well. It's separate from the existing retention setting. It has a default value which uses the existing delete functionality This config variable will be used later on when the v2 deletion functionality is added.

Rename internal fields for future expansion of the delete requests.

Validate the delete requests.

Special notes for your reviewer:

Checklist

  • Documentation updated
  • Tests updated
  • Add an entry in the CHANGELOG.md about the changes.

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Thanks for making a start on this. I think it goes into the right direction, but I think for the time being we would still need to have delete functionality for the case when someone using Loki relies on it.

So my suggestion would be: Let use the new API endpoint name (and ideally the new promql field), but still allow deletion of "selector-only" logql requests. Wdyt?

pkg/loki/modules.go Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor.go Outdated Show resolved Hide resolved
@MichelHollands MichelHollands changed the title Add delete api to compactor Update the delete api so it looks more like the other API endpoints Mar 2, 2022
@MichelHollands MichelHollands marked this pull request as ready for review March 2, 2022 14:48
@dannykopping
Copy link
Contributor

I think it goes into the right direction, but I think for the time being we would still need to have delete functionality for the case when someone using Loki relies on it.

Agreed. To expand a bit:
We should also be careful about changing API interfaces - can we maintain both the new and the old endpoints? We can mark the old ones as deprecated and remove them with the next major release.

@MichelHollands
Copy link
Contributor Author

Agreed. To expand a bit: We should also be careful about changing API interfaces - can we maintain both the new and the old endpoints? We can mark the old ones as deprecated and remove them with the next major release.

We can, but this is an API marked as experimental so I would argue it's fine to change them. We're also changing the parameters for the PUT/POST.

Copy link
Contributor

@MasslessParticle MasslessParticle left a comment

Choose a reason for hiding this comment

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

I think this looks awesome

@MichelHollands MichelHollands force-pushed the add_delete_v2_api_to_compactor branch 2 times, most recently from 0fcd262 to 578cf50 Compare March 15, 2022 14:39
@MichelHollands MichelHollands changed the title Update the delete api so it looks more like the other API endpoints Add a DeletionMode config variable Mar 15, 2022
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

That's coming together really well. LGTM

A couple of nits in the comments.

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Thanks for incorporating the review. LGTM

I would like you to think about the v1 name again for the default/legacy, I think we should be more descritive v1 doesn't really mean anything.

pkg/storage/stores/shipper/compactor/deletion/mode.go Outdated Show resolved Hide resolved
Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

Added some comments but other than that it looks good to me.

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM.

I think we should also update both the HTTP API page and the more specific docs. But this can also happen outside of this PR.

MichelHollands and others added 25 commits April 6, 2022 09:52
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Co-authored-by: Christian Simon <simon@swine.de>
…manager_test.go

Co-authored-by: Christian Simon <simon@swine.de>
…store.go

Co-authored-by: Christian Simon <simon@swine.de>
…store.go

Co-authored-by: Christian Simon <simon@swine.de>
Co-authored-by: Christian Simon <simon@swine.de>
…store.go

Co-authored-by: Christian Simon <simon@swine.de>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

Just some minor nits. Thanks for taking care of all the feedback and nice work!

pkg/storage/stores/shipper/compactor/compactor.go Outdated Show resolved Hide resolved
MichelHollands and others added 2 commits April 6, 2022 10:31
Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
@sandeepsukhani sandeepsukhani merged commit b865b81 into grafana:main Apr 6, 2022
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.

5 participants