Repository navigation
Allow 2h block conversion if it has no compact mark - #6865
SungJin1212 wants to merge 4 commits into
Conversation
b3c1f38 to
528d1af
Compare
ce12528 to
369dbf3
Compare
54d9d99 to
7bb8c24
Compare
|
@alanprot |
|
Do we need this new config |
|
@yeya24 |
| // since these will never be compacted to 12h block. | ||
| // We check if the `no-compact-mark.json` file exists only for blocks | ||
| // after the noCompactMarkCheckAfter to reduce object storage calls. | ||
| if mint >= noCompactMarkCheckAfter { |
There was a problem hiding this comment.
mint is a block timestamp in epoch milliseconds, while noCompactMarkCheckAfter is a duration (13h by default, so 46800000). This condition is therefore true for every real block, and the marker is checked for every unconverted 2h block on every conversion cycle, however recent the block is. I tried a 2h block that ended an hour ago: checkFunc is called and the block is converted. The tests only pass because they use timestamps near the epoch.
If the idea is to skip blocks younger than the threshold, it needs to compare against the current time, e.g. now - maxt >= noCompactMarkCheckAfter with now passed in so it stays testable. The blocks cleaner also calls this for every non-parquet block, so it adds to the Exists calls the bucket-cache suggestion above was about.
There was a problem hiding this comment.
Thanks, I fixed it to the latest commit. Also, I changed it to use now - maxt >= timeRanges[1].
7bb8c24 to
74f83c6
Compare
74f83c6 to
51b3154
Compare
|
@yeya24 @danielblando |
9fb7122 to
2fef52a
Compare
sandy2008
left a comment
There was a problem hiding this comment.
Thanks, re-checked at 2fef52a. The age check now compares now - maxt with the second block range, all in milliseconds, in both the converter and the cleaner. The marker is only fetched once a block is old enough, so the cleaner's extra Exists calls are limited to old 2h blocks. TestShouldConvertBlockToParquet_NoCompactMarkCheckAge fails with the old timestamp-vs-duration check, with > instead of >=, with now - mint, and with the marker read before the age check. A few small things inline, mainly that the converter test doesn't reach the new path yet.
| mint := time.Hour * 13 | ||
| maxt := time.Hour * 15 |
There was a problem hiding this comment.
These blocks cross a 2h boundary (13h to 15h), so getBlockTimeRange puts them in the 12h range and they get converted with or without the marker. The test still passes with hasNoCompactMark in convertUser stubbed to false, or with ShouldConvertBlockToParquet back to master's range-only check. With aligned blocks they go through the marker check, and both of those then fail (0 converted instead of 2):
| mint := time.Hour * 13 | |
| maxt := time.Hour * 15 | |
| mint := time.Hour * 12 | |
| maxt := time.Hour * 14 |
| } | ||
|
|
||
| mockNoCompactMarkCheckFunc := func(blockID ulid.ULID) bool { | ||
| return false |
There was a problem hiding this comment.
Nit: this always returns false and none of the blocks above is a 2h block, so this test never reaches the new age check. User-5's blocks in TestBlocksCleaner are only a few ms after the epoch, so they always count as old, and both tests still pass with time.Now().UnixNano() in updateBucketMetrics. Adding a recent 2h-aligned block without a parquet mark (from now.Truncate(2 * time.Hour) minus 2h to now.Truncate(2 * time.Hour)) and returning true here would catch it. The count stays 2 at this head and becomes 3 with UnixNano().
| * [ENHANCEMENT] Upgrade promql-engine and Thanos to latest. #7889 | ||
| * [ENHANCEMENT] Ruler: Retry a notification the Alertmanager failed to accept with a transport error or a 5xx response, instead of dropping it and leaving its alert undelivered until the next evaluation of the rule group. Enable the retries with `-ruler.notification.backoff-retries` (`0`, no retry, by default), and tune the delay between them with `-ruler.notification.backoff-min-period` and `-ruler.notification.backoff-max-period`. The retries are bounded by `-ruler.notification-timeout` and counted by the new `cortex_ruler_notification_retries_total` metric. #7909 | ||
| * [ENHANCEMENT] Update Go version to 1.27.3, which includes security fixes to the `crypto/x509` package (CVE-2026-111943). #7906 #7923 | ||
| * [ENHANCEMENT] Parquet Converter: Allow 2h blocks conversion if the block has a no-compact-mark.json file. #6865 |
There was a problem hiding this comment.
Nit: maybe say when the marker is checked:
| * [ENHANCEMENT] Parquet Converter: Allow 2h blocks conversion if the block has a no-compact-mark.json file. #6865 | |
| * [ENHANCEMENT] Parquet Converter: Convert 2h blocks that have a `no-compact-mark.json` file, since they are never compacted. The marker is checked once the block is older than the second `-compactor.block-ranges` entry (12h by default). #6865 |
25b1a74 to
aa2a03e
Compare
|
@sandy2008 |
Signed-off-by: Sungjin1212 <tjdwls1201@gmail.com>
…ELOG - Use 2h-aligned blocks (12h-14h) in the converter test so they go through the no-compact mark check instead of being classified as 12h blocks. - Add a recent 2h-aligned block to TestBlocksCleaner_ParquetMetrics so the age check is exercised. - Describe when the no-compact marker is checked in the CHANGELOG entry. Signed-off-by: Sungjin1212 <tjdwls1201@gmail.com>
aa2a03e to
e127a9f
Compare
The bucket index updater already returns the blocks marked for no compaction, so the cleaner can look them up there when counting the unconverted parquet blocks instead of sending an Exists request per block. Extend TestBlocksCleaner_ParquetMetrics with old 2h blocks with and without a no-compact mark. Signed-off-by: Sungjin1212 <tjdwls1201@gmail.com>
|
@sandy2008 |
|
@danielblando |
Allow the parquet converter to convert 2h blocks if the block has a
no-compact.mark.jsonfile.Which issue(s) this PR fixes:
Fixes #6831
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]