-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Compactor is unable to delete data older than retention period #5058
Comments
Are you using the new compactor progress metrics now? The configured retention is 60d. Are you sure that your blocks are older than 60d and need to be deleted? For catching up the compaction, you can try to shard your compactor to do more work. |
I have the same issue too. Just want to open new issue but I think put it here better. my compactor config: version: v0.22.0
How I'm suppose to delete the old data? |
@zakiharis Please see my comment above. |
unfortunately I tried your suggestion but still it didn't delete the old blocks
also, I tried bucket mark and cleanup command still same result
after run the cleanup command, the block still there
|
You should set the retention period to delete and then run the cleanup command to delete the old blocks. If you want to use the cleanup command, you need to also configure the delete delay flag. The delete delay duration is your period that your blocks will only be deleted after that period. You can set it to 0 to delete blocks directly. |
@yeya24 thanks for the info on set delete delay to 0
please add this ya. thank you so much! |
https://thanos.io/tip/operating/compactor-backlog.md/ Please take a look at this guide about how to troubleshoot this kind of issue. Will close for now and feel free to reopen it if this doesn't work for you |
Hi @yeya24 . I thought of opening a new issue but I am facing the exact issue described here and I followed your instructions mentioned here https://thanos.io/tip/operating/compactor-backlog.md/ to mark and clean up old blocks from the data bucket (S3 in my case). I stopped the compact pod (scaled down the sts replica to 0) and ran the following commands from the thanos-store pod. output of retention command: / $ thanos tools bucket retention --objstore.config-file /tmp/obj_store.yaml
After this I was expecting blocks which are older than retention to be marked for deletion. I was expecting those blocks would have "deletion-mark.json" would be uploaded on blocks which are older than retention. However I do not see the deletion marker in those blocks. When I ran the bucket cleanup command with delete-delay 0, I could see only blocks which were marked for deletion recently, only got deleted. The configured retentions are as follows:
I am pretty new to thanos and would highly appreciate a response and any insight that you might have on this. Thanks in advance for all your help. |
Hey sorry for the late reply @adit-cmd,
Umm that's bizarre. The command should delete all blocks which are marked for deletion. If you don't have the deletion marker for a block then it won't be deleted.
I saw you tried |
Hi @yeya24 .. Apologies for the late response. Let me summarize the steps I took to resolve the issue. We have been using thanos since 2020. However due to some issue ( mostly on the thanos end - Im still not sure of the root cause), the index files went missing from the ULID blocks for the year 2021,2022. Since index file was missing, compactor was unable to delete those older ULID blocks. Whenever the compactor was encountering such a block, it was failing with the following error: If you observe the screenshot, we can see the error where ->> ULID_BLOCK/index was not found. [ reason="error executing compaction..." The specified key does not exist" The manual solution that is provided in official thanos documentation which I tried above only worked for the recently created ULID blocks but it did not work for the ULID blocks created back on 2021/2022. So in order to get the compactor work as expected, I created a S3 policy which would delete all the historic ULID blocks from S3 keeping only the one's created one year back. Once the 2021/2022 blocks were deleted, compactor started working as expected. |
I have been running Thanos compactor for weeks. However, I do not see the overall size of the GCS bucket reducing after the retention is turned on. Upon looking further, I see that the blocks which are beyond retention period do not have delete-mark.json added, which could be the reason why blocks are not being cleaned up.
Version: v0.24.0
Here is the config:
The number of pending blocks to be compacted, blocks to be downsized are also going up.
The text was updated successfully, but these errors were encountered: