-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Add support for storing chunk deletion markers in object storage instead of local disk #19689
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
base: main
Are you sure you want to change the base?
Conversation
|
💻 Deploy preview available (feat: Add support for storing chunk deletion markers in object storage instead of local disk): |
pkg/compactor/config.go
Outdated
| HorizontalScalingModeDisabled, HorizontalScalingModeMain, HorizontalScalingModeWorker)) | ||
| cfg.WorkerConfig.RegisterFlagsWithPrefix("compactor.worker.", f) | ||
| cfg.JobsConfig.RegisterFlagsWithPrefix("compactor.jobs.", f) | ||
| f.StringVar(&cfg.DeletionMarkerObjectStorePrefix, "compactor.deletion-marker-object-store-prefix", "", "Object storage path prefix for storing deletion markers. Leave empty to store deletion markers on local disk.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add rule about trailing slash in this
docs/sources/shared/configuration.md
Outdated
| [max_retries: <int> | default = 3] | ||
| # Object storage path prefix for storing deletion markers. Leave empty to store | ||
| # deletion markers on local disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question re: "local disk" does this require a persistent volume to be configured? Or does this mean storage will be on file system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compactor should have a persistent volume attached to it. It already uses the local disk for storing deletion markers. This feature enables operators to use object storage for storing the deletion markers.
However, it does not allow us to run the compactor without a disk because the disk is also needed for other operations.
What this PR does / why we need it:
When retention support was initially introduced to Loki, we stored chunk deletion markers on local disk without any support for storing them on object storage instead. Chunk deletion markers are created for chunks which are supposed to be deleted due to running out of retention or a deletion request. At a large scale, if a large number of chunks are selected in a short span due to a significant change in retention period or a delete request touching too much data, there would be a significant surge in the disk space usage by deletion marker files, which can cause the compactor to run out of disk space.
With this PR, I am adding support for configuring the compactor to store chunk deletion markers in the object storage under a prefix. If the prefix is empty (default), the compactor will, as usual, continue to store the deletion markers on the local disk.
When the compactor is configured to store chunk deletion markers in object storage, the chunk markers are stored in a period-specific object store according to the schema configuration.
Checklist