mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
4288d09a85
Usually second merge do not perform TTL, since everything is up to date, however in this case TTLTransform is not used, and hence expired_columns will not be filled for new part, and so those columns will be written with default values. Avoid this, by manually filling expired_columns. Here is a simpler reproducer: Simple reproducer: ```sql create table ttl_02262 (date Date, key Int, value String TTL date + interval 1 month) engine=MergeTree order by key settings min_bytes_for_wide_part=0, min_rows_for_wide_part=0; insert into ttl_02262 values ('2010-01-01', 2010, 'foo'); ``` ```sh # ls -l .server/data/default/ttl_02262/all_* .server/data/default/ttl_02262/all_1_1_0: total 48 -rw-r----- 1 root root 335 May 26 14:19 checksums.txt -rw-r----- 1 root root 76 May 26 14:19 columns.txt -rw-r----- 1 root root 1 May 26 14:19 count.txt -rw-r----- 1 root root 28 May 26 14:19 date.bin -rw-r----- 1 root root 48 May 26 14:19 date.mrk2 -rw-r----- 1 root root 10 May 26 14:19 default_compression_codec.txt -rw-r----- 1 root root 30 May 26 14:19 key.bin -rw-r----- 1 root root 48 May 26 14:19 key.mrk2 -rw-r----- 1 root root 8 May 26 14:19 primary.idx -rw-r----- 1 root root 99 May 26 14:19 ttl.txt -rw-r----- 1 root root 30 May 26 14:19 value.bin -rw-r----- 1 root root 48 May 26 14:19 value.mrk2 ``` ```sql optimize table ttl_02262 final; ``` ```sh .server/data/default/ttl_02262/all_1_1_1: total 40 -rw-r----- 1 root root 279 May 26 14:19 checksums.txt -rw-r----- 1 root root 61 May 26 14:19 columns.txt -rw-r----- 1 root root 1 May 26 14:19 count.txt -rw-r----- 1 root root 28 May 26 14:19 date.bin -rw-r----- 1 root root 48 May 26 14:19 date.mrk2 -rw-r----- 1 root root 10 May 26 14:19 default_compression_codec.txt -rw-r----- 1 root root 30 May 26 14:19 key.bin -rw-r----- 1 root root 48 May 26 14:19 key.mrk2 -rw-r----- 1 root root 8 May 26 14:19 primary.idx -rw-r----- 1 root root 81 May 26 14:19 ttl.txt ``` ```sql optimize table ttl_02262 final; ``` ```sh .server/data/default/ttl_02262/all_1_1_2: total 48 -rw-r----- 1 root root 349 May 26 14:20 checksums.txt -rw-r----- 1 root root 76 May 26 14:20 columns.txt -rw-r----- 1 root root 1 May 26 14:20 count.txt -rw-r----- 1 root root 28 May 26 14:20 date.bin -rw-r----- 1 root root 48 May 26 14:20 date.mrk2 -rw-r----- 1 root root 10 May 26 14:20 default_compression_codec.txt -rw-r----- 1 root root 30 May 26 14:20 key.bin -rw-r----- 1 root root 48 May 26 14:20 key.mrk2 -rw-r----- 1 root root 8 May 26 14:20 primary.idx -rw-r----- 1 root root 81 May 26 14:20 ttl.txt -rw-r----- 1 root root 27 May 26 14:20 value.bin -rw-r----- 1 root root 48 May 26 14:20 value.mrk2 ``` And now we have `value.*` for all_1_1_2, this should not happen. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com> |
||
---|---|---|
.. | ||
ci | ||
config | ||
fuzz | ||
instructions | ||
integration | ||
jepsen.clickhouse-keeper | ||
perf_drafts | ||
performance | ||
queries | ||
.gitignore | ||
clickhouse-test | ||
CMakeLists.txt | ||
msan_suppressions.txt | ||
stress | ||
tsan_suppressions.txt | ||
ubsan_suppressions.txt |