why thanos compactor do compacting before apply retention policy #4530
Replies: 3 comments
-
I think this is done on pupose in case retention times are different across resolution. If the compaction is running late, and the |
Beta Was this translation helpful? Give feedback.
-
This makes sense as old blocks might be still able for compaction ( < level 4). The retention check is based on block max time. So once an old block is compacted with other new blocks and a new block is generated, the new block might still be within the retention period and the data from the old block is kept. For some cases, even if olds blocks are compacted, the time range is still beyond the retention time, this is something we can optimize, maybe in the planner side specifically. Ideally, this is not hard to do. But as @ahurtaud mentioned, downsampling will affect it as well because level 4 blocks might be able for downsampling so we cannot simply delete the blocks. For most of cases, if there are not too much data in object storage, the current logic is fine as the retention will be applied after the compacting and downsampling phase is done. If you have too much data in obj store, try scaling your compactor more or use |
Beta Was this translation helpful? Give feedback.
-
Move this issue to discussion. |
Beta Was this translation helpful? Give feedback.
-
I found that thanos compactor do compacting and meta syncing (many times) before applying retention policy. This may cause old blocks never be removed if something wrong during compacting ,and then, old blocks become more and more, and lead to compacting or meta syncing error again.
I think old blocks will never be used for compacting and can be removed before compacting. 🤔
Beta Was this translation helpful? Give feedback.
All reactions