Repository navigation
Read only necessary columns & respect ttl_only_drop_parts on materialize ttl - #65488
Conversation
|
This is an automated comment for commit 3e9eb8d with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
|
Fails:
|
|
@zvonand, waiting to fix all the flaky tests. |
This comment was marked as outdated.
This comment was marked as outdated.
If you mean I cannot poke the CI from the inside, and, as soon as the flakiness is not related to this PR, I do not see why it is a stopper here. Also, this test has been failing from time to time ever since it was introduced in 2021, and has never been fixed. |
|
Hmm, probably it will work. I'll check one more time more closely. |
@CurtizJ what is your opinion now, does it work? For me, it looks like it does :) |
|
@CurtizJ so, what do you think of this now? (Also, the CI for this PR is really green) It actually seems to work:
Difference in performance is dramatic (60 seconds in master vs 1 second in this PR) |
|
@zvonand, a test for LDAP has failed in the master branch: https://s3.amazonaws.com/clickhouse-test-reports/0/c945209427e759dccfaff5a6af11f2e18c100390/integration_tests__aarch64__[4_6].html |
|
Yes, I already seen it and thinking about it, even without 3 reminders in 3 unrelated PRs. |
|
@CurtizJ gentle ping |
|
@alexey-milovidov do you want me to look into it? I can, but, unfortunately, without promise of quick result. I also see that other PRs are being reviewed and merged during the last couple of weeks, even though https://aretestsgreenyet.com/ has never been green. Maybe I can also have some in PRs that have been pending for months? P.S. Btw, looks like the test's original author was @vitlibar, maybe he would know better |
|
@alexey-milovidov none of the tests failed, but looks this page is not supposed do be green at all, right? :) |
|
It requires at least one million test runs. If it is less than one million it indicates that something is wrong with the CI or everyone is on vacation. |
I already fixed #66835, now I am also investigating on #68355 in free time (but looks like the test itself is not the only issue here), and I have a couple of other tests I plan to take a look at later if they are not fixed by then. I will put this on the list. TBH I expected some reciprocity, i.e. someone would take a look at some of my not-so-huge PRs that have been waiting for review for months (e.g. this PR or #59138) when I contribute to better tests. |
CurtizJ
left a comment
There was a problem hiding this comment.
Well, I agree that it works. Please fix the requested changes and I'll merge PR. Now your code doesn't remove any parts but works only like materialize_ttl_recalculate_only. Parts are actually removed by assigned TTL merge.
SET mutations_sync = 2
CREATE TABLE test_ttl
(
`ts` DateTime CODEC(Delta, LZ4),
`huge_column1` String CODEC(NONE),
`huge_column2` String CODEC(NONE),
`huge_column3` String CODEC(NONE)
)
ENGINE = MergeTree
PARTITION BY toDate(ts)
ORDER BY tuple()
AS SELECT
toDateTime('2020-01-01 00:00:00') + toIntervalMillisecond(number * 5) AS ts,
randomPrintableASCII(100) AS huge_column1,
randomPrintableASCII(120) AS huge_column2,
randomPrintableASCII(130) AS huge_column3
FROM numbers(10000000);
ALTER TABLE test_ttl MODIFY SETTING ttl_only_drop_parts = 1;
ALTER TABLE test_ttl MODIFY TTL ts + toIntervalDay(1439);
SYSTEM FLUSH LOGS;
SELECT
name,
event_type,
merge_reason
FROM system.part_log
WHERE (`table` = 'test_ttl') AND (CAST(splitByChar('_', part_name)[4], 'Int64') > 0) AND (event_type IN ('MergeParts', 'MutatePart'))
ORDER BY event_time_microseconds ASC
Query id: ac76af54-75c4-4bce-95d3-920c5d6bcac9
┌─name───────────┬─event_type─┬─merge_reason─┐
1. │ 20200101_1_6_1 │ MergeParts │ RegularMerge │
└────────────────┴────────────┴──────────────┘
┌─name────────────┬─event_type─┬─merge_reason─┐
2. │ 20200101_7_12_1 │ MergeParts │ RegularMerge │
└─────────────────┴────────────┴──────────────┘
┌─name───────────────┬─event_type─┬─merge_reason───┐
3. │ 20200101_7_12_1_15 │ MutatePart │ NotAMerge │
4. │ 20200101_1_6_1_15 │ MutatePart │ NotAMerge │
5. │ 20200101_1_14_2_15 │ MergeParts │ TTLDeleteMerge │
└────────────────────┴────────────┴────────────────┘77c17b3 to
e76e6d5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Unfortunately a bug has been found. Run test It results in: I'll revert for now. |
Which test? |
|
@CurtizJ you did not specify the test name |
|
Sorry, test |
|
Ok, I will take a look and reintroduce it |
|
@CurtizJ could you please share the full log of the failed test run? I do not see this exact fail in ci db |
Revert "Merge pull request #65488 from zvonand/zvonand-ttl"
…and-ttl"" This reverts commit af67fbe.
Reintroduce respect `ttl_only_drop_parts` on `materialize ttl`, #65488

Finish #59189. A step in direction of implementing #20451.
Respect
ttl_only_drop_partsonmaterialize ttl. Only read the necessary columns to recalculate TTL and drop parts by replacing them with an empty one.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Respect
ttl_only_drop_partsonmaterialize ttl; only read necessary columns to recalculate TTL and drop parts by replacing them with an empty one.Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing):