Commit Graph

69122 Commits

Author SHA1 Message Date
Maksim Kita
e961de3ea0 Fixed build 2021-07-23 11:15:29 +03:00
Maksim Kita
7e08748c5b Updated tests 2021-07-23 11:13:51 +03:00
vdimir
dccc379d39
Fix use after free in AsyncDrain connection from S3Cluster 2021-07-23 10:40:03 +03:00
Vitaly Baranov
19d5a6ab2f
Merge pull request #26714 from vitlibar/new-function-current-profiles
New functions currentProfiles(), enabledProfiles(), defaultProfiles().
2021-07-23 09:10:29 +03:00
Maksim Kita
42201d3e30 Fixed code review issues 2021-07-23 01:03:44 +03:00
Azat Khuzhin
00e2083421 Fix event_time_microseconds for REMOVE_PART in system.part_log 2021-07-23 00:59:08 +03:00
Maksim Kita
1fea19846b Compile aggregate functions profile events fix 2021-07-23 00:43:31 +03:00
Maksim Kita
b5980f312a
Merge pull request #26718 from kitaisreal/setting-min-count-to-compile-aggregate-expression-fix
Setting min_count_to_compile_aggregate_expression fix
2021-07-23 00:22:49 +03:00
Maksim Kita
46fd046f11 Setting min_count_to_compile_aggregate_expression fix 2021-07-23 00:22:04 +03:00
Maksim Kita
222915c275 Fixed code review issues 2021-07-23 00:07:22 +03:00
Alexander Kuzmenkov
9465e5d191
Merge pull request #26701 from ClickHouse/aku/window-debug
more debug checks for window functions
2021-07-22 23:09:29 +03:00
Alexey
4a57267c5b Sections about Globs moved at the very end, after examples 2021-07-22 19:30:53 +00:00
Vitaly Baranov
7afcc65060 Add new functions currentProfiles(), enabledProfiles(), defaultProfiles(). 2021-07-22 22:20:53 +03:00
lehasm
8e8ef98fa4
Update docs/ru/operations/settings/merge-tree-settings.md
Co-authored-by: Anna <42538400+adevyatova@users.noreply.github.com>
2021-07-22 21:32:46 +03:00
Nikolai Kochetov
3c17a62686
Merge pull request #26590 from ClickHouse/remove-some-more-streams
Remove some streams.
2021-07-22 21:28:50 +03:00
romanzhukov
492af9332c DOCSUP-11551: Add ru contrib info. 2021-07-22 20:53:30 +03:00
Nicolae Vartolomei
f35e6eee19 Avoid deleting old parts from FS on shutdown for replicated engine
This was introduced in https://github.com/ClickHouse/ClickHouse/pull/8602.
The idea was to avoid data re-appearing in ClickHouse after DROP/DETACH
PARTITION. This problem was only present in MergeTree engine and I don't
understand why we need to do the same in ReplicatedMergeTree.

For ReplicatedMergeTree the state of truth is stored in ZK, deleting
things from filesystem just introduces inconsistencies and this is the
main source for errors like "No active replica has part X or covering
part".

The resulting problem is fixed by
https://github.com/ClickHouse/ClickHouse/pull/25820, but in my opinion
we would better avoid introducing the ZK/FS inconsistency in the first
place.

When does this inconsistency appear? Often the sequence is like this:

0. Write 2 parts to ZK [all_0_0_0, all_1_1_0]
1. A merge gets scheduled
2. New part replaces old parts [new: all_0_1_1, old: all_0_0_0, all_1_1_0]
3. Replica gets shutdown and old parts are removed from filesystem
4. Replica comes back online, metadata about all parts is still stored in ZK for this new replica.
5. Other replica after cleanup thread runs will have only [all_0_1_1] in
   ZK
5. User triggers a DROP_RANGE after a while (drop range is for all_0_1_9999*)
6. Each replica deletes from ZK only [all_0_1_1]. The replica that got
   restarted uses its in-memory state to choose nodes to delete from ZK.
7. Restart the replica again. It will now think that there are 2 parts
   that it lost and needs to fetch them [all_0_0_0, all_1_1_0].

`clearOldPartsAndRemoveFromZK` which is triggered from cleanup thread
runs cleanup sequence correctly, it first removes things from ZK and
then from filesystem. I don't see much benefit of triggering it on
shutdown and would rather have it called only from a single place.

---

This is a very, very edge case situation but it proves that the current
"fix" (https://github.com/ClickHouse/ClickHouse/pull/25820) isn't
complete.

```
create table test(
    v UInt64
)
engine=ReplicatedMergeTree('/clickhouse/test', 'one')
order by v
settings old_parts_lifetime = 30;

create table test2(
    v UInt64
)
engine=ReplicatedMergeTree('/clickhouse/test', 'two')
order by v
settings old_parts_lifetime = 30;

create table test3(
    v UInt64
)
engine=ReplicatedMergeTree('/clickhouse/test', 'three')
order by v
settings old_parts_lifetime = 30;

insert into table test values (1), (2), (3);
insert into table test values (4);

optimize table test final;

detach table test;
detach table test2;

alter table test3 drop partition tuple();

attach table test;
attach table test2;
```

```
(CONNECTED [localhost:9181]) /> ls /clickhouse/test/replicas/one/parts
all_0_0_0
all_1_1_0
(CONNECTED [localhost:9181]) /> ls /clickhouse/test/replicas/two/parts
all_0_0_0
all_1_1_0
(CONNECTED [localhost:9181]) /> ls /clickhouse/test/replicas/three/parts
```

```
detach table test;
attach table test;
```

`test` will now figure out that parts exist only in ZK and will issue `GET_PART`
after first removing parts from ZK.

`test2` will receive fetch for unknown parts and will trigger part checks itself.
Because `test` doesn't have the parts anymore in ZK `test2` will mark them as LostForever.
It will also not insert empty parts, because the partition is empty.

`test` is left with `GET_PART` in the queue and stuck.

```
SELECT
    table,
    type,
    replica_name,
    new_part_name,
    last_exception
FROM system.replication_queue

Query id: 74c5aa00-048d-4bc1-a2ea-6f69501c11a0

Row 1:
──────
table:          test
type:           GET_PART
replica_name:   one
new_part_name:  all_0_0_0
last_exception: Code: 234. DB::Exception: No active replica has part all_0_0_0 or covering part. (NO_REPLICA_HAS_PART) (version 21.9.1.1)

Row 2:
──────
table:          test
type:           GET_PART
replica_name:   one
new_part_name:  all_1_1_0
last_exception: Code: 234. DB::Exception: No active replica has part all_1_1_0 or covering part. (NO_REPLICA_HAS_PART) (version 21.9.1.1)
```
2021-07-22 17:48:16 +01:00
zxc111
f2a6f5013d typo 2021-07-23 00:44:33 +08:00
Alexander Kuzmenkov
86b7701834
Merge pull request #26706 from ClickHouse/aku/server-exit-code
record server exit code in fuzzer
2021-07-22 19:42:12 +03:00
ryzuo
4d36d54c81 Update the implementaion of nth_value
Make nth_value for nullable values for out of frame rows, as the same
fashion as lagInFrame just does.
2021-07-23 00:34:08 +08:00
Raúl Marín
cb50fd9521 01946_test_wrong_host_name_access: Clear DNS in the end
Leaves a better env and avoids future errors in the logs
2021-07-22 18:21:17 +02:00
Nikolai Kochetov
f56a45155f Merge branch 'master' into remove-more-and--more-streams 2021-07-22 19:10:39 +03:00
Nikolai Kochetov
fd754430eb Remove more streams. 2021-07-22 19:05:52 +03:00
Vitaly Baranov
9117e12a9b Substitute profiles in reversive order. 2021-07-22 18:50:22 +03:00
Maksim Kita
0f78a14630
Merge pull request #26708 from seandhaynes/master
Update server configuration docs to reference correct Requiretls1_2 setting
2021-07-22 18:44:57 +03:00
Alexander Kuzmenkov
cfb317a9a9
Update compare.sh 2021-07-22 18:37:20 +03:00
alexey-milovidov
3f5016a617
Merge pull request #26410 from mathalex/master
Add queryID and initialQueryID functions
2021-07-22 18:28:38 +03:00
Sean Haynes
368a9cf268 Update server configuration docs to reflect Requiretls1_2 setting
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
2021-07-22 16:05:34 +01:00
Vitaly Baranov
d0412994a2 Fix SET ROLE. 2021-07-22 17:41:52 +03:00
Alexander Kuzmenkov
dbf0ed31e8 record server exit code in fuzzer 2021-07-22 17:05:47 +03:00
Maksim Kita
d72cc7c7a8
Merge pull request #26680 from den-crane/patch-21
Update clickhouse-keeper.md
2021-07-22 15:54:42 +03:00
Maksim Kita
e08fc94137
Merge pull request #26678 from CurtizJ/minor-bugfix
Minor bugfix
2021-07-22 15:54:24 +03:00
Vladimir
ecebd5c132
Merge pull request #26691 from vdimir/fix-ci-runner-listing-error 2021-07-22 15:43:06 +03:00
alexey-milovidov
e83ca20ac3
Merge pull request #26684 from ClickHouse/fix-flaky-test-24
Fix flaky test `mutation_stuck_after_replace_partition`
2021-07-22 15:37:38 +03:00
alexey-milovidov
c3206f6c85
Merge pull request #26470 from ClickHouse/fix-flaky-test-20
Fix flaky test `distributed_ddl_output_mode`
2021-07-22 15:32:22 +03:00
Alexander Kuzmenkov
19ee914e90 more debug checks for window functions 2021-07-22 15:17:49 +03:00
romanzhukov
7feafffe5a Merge branch 'master' into romanzhukov-DOCSUP-11551-adding_new_third-party 2021-07-22 14:44:13 +03:00
vdimir
45233666b6
Relax filter for information_schema.processlist in mysql_kill_sync_thread_restore_test 2021-07-22 14:05:23 +03:00
Alexander Kuzmenkov
60ca9990e5
Merge pull request #26668 from ClickHouse/aku/window-materialize
materialize all columns in window transform
2021-07-22 13:42:36 +03:00
Nikolai Kochetov
3ed3f7a9f7 Fix integration tests. 2021-07-22 13:38:22 +03:00
vdimir
f61ecee989
Remove tests/integration/test_foo 2021-07-22 13:33:43 +03:00
vdimir
d1b6274deb
Strip lines in runner output in _get_all_tests 2021-07-22 13:33:05 +03:00
romanzhukov
65d1f18962 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into romanzhukov-DOCSUP-11551-adding_new_third-party 2021-07-22 13:18:12 +03:00
romanzhukov
d723ac560d DOCSUP-11551: Add ru contrib info. 2021-07-22 13:14:25 +03:00
Alexey Boykov
fcbe3f7a32
Merge pull request #26527 from ka1bi4/romanzhukov-DOCSUP-11658-merge_selecting_sleep_ms
DOCSUP-11658: Edit and translate to Russian (merge_selecting_sleep_ms)
2021-07-22 13:08:43 +03:00
Alexey Boykov
eead9f51cc
Merge pull request #26479 from ka1bi4/romanzhukov-DOCSUP-11554-dictGet-dictsource
DOCSUP-11554: Edit and translate to Russian
2021-07-22 13:06:49 +03:00
vdimir
a8f986350c
Log errors on integration test listing error in ci-runner 2021-07-22 12:31:15 +03:00
feihengye
6230ad0160
#26640 change kafka engine max consumers from 16 to physical cpu cores (#26642)
Co-authored-by: jhonye <jhonye@tencent.com>
2021-07-22 11:54:08 +03:00
Nikolai Kochetov
5ffd99dfd4
Merge pull request #25674 from amosbird/distributedreturnconnection
Drain connection asynchronously
2021-07-22 11:04:49 +03:00
Azat Khuzhin
dac13793e7 Disable 01955_clickhouse_benchmark_connection_hang under UBsan
UBsan does not works reliable when the RLIMIT_NOFILE exceeded.
2021-07-22 10:09:37 +03:00