Commit Graph

1040 Commits

Author SHA1 Message Date
Nikolai Kochetov
3585700506 Fix tests. 2020-06-30 19:41:43 +03:00
Vitaly Baranov
c39eb8f71b Fix partial revokes (complex cases). 2020-06-30 18:47:02 +03:00
Nicolae Vartolomei
8f1845185e Try fix pk in tuple performance
Possible approach for fixing #10574

The problem is that prepared sets are built correctly, it is a hash map of key -> set
where key is a hash of AST and list of data types (when we a list of
tuples of literals).

However, when the key is built from the index to try and find if there
exists a prepared set that would match it looks for data types of the
primary key (see how data_types is populated) because the primary key
has only one field (v in my example) it can not find the prepared set.

The patch looks for any prepared indexes where data types match for the
subset of fields found in primary key, we are not interested in other
fields anyway for the purpose of primary key pruning.
2020-06-30 16:33:38 +01:00
Nikolai Kochetov
66da0733ab Check type of filter for prewhere. 2020-06-30 17:20:27 +03:00
Vladimir Chebotarev
bb8da71eff Moves task shall be started if new storage policy needs them. 2020-06-30 15:36:44 +03:00
kssenii
f797efb04c Fix build 2020-06-30 01:48:11 +00:00
Anton Popov
53e955c6dd several fixes 2020-06-29 23:36:18 +03:00
Azat Khuzhin
9c94993f14 Fix "Sharding key is not deterministic" message 2020-06-29 23:00:14 +03:00
kssenii
fd9b416871 Fix and simplify code 2020-06-29 15:47:25 +00:00
Anton Popov
a43cb93be5 remove questionable functionality 2020-06-29 18:46:50 +03:00
alesapin
718262e7ce
Merge pull request #11973 from ClickHouse/alter-enum-partition-key
Allow to perform "metadata-only" ALTER of partition key.
2020-06-29 16:01:07 +03:00
kssenii
88ece429c9 Move writing to RabbitMQ into background task 2020-06-29 12:33:01 +00:00
kssenii
3d2cc9d4b2 Remove libevent library 2020-06-29 12:11:17 +00:00
kssenii
5fc0b93400 Use ConcurentBoundedQueue instead of vector 2020-06-29 09:50:33 +00:00
alesapin
e72bc39654
Merge pull request #11983 from ClickHouse/storage_mongodb
Merging #10931 (Storage MongoDB)
2020-06-29 11:49:18 +03:00
Alexey Milovidov
cc597bb30b Implement for ReplicatedMergeTree 2020-06-28 22:39:31 +03:00
Alexey Milovidov
6aa89d9073 Typos 2020-06-28 22:39:31 +03:00
Alexey Milovidov
e3410ca617 Write partition key changes to ZooKeeper 2020-06-28 22:39:31 +03:00
Alexey Milovidov
e5f4a4b4b0 Whitespace 2020-06-28 22:39:31 +03:00
Alexey Milovidov
1f9c27de34 Fix clang-tidy 2020-06-28 22:39:31 +03:00
Alexey Milovidov
b6e31f0a5e Only allow Enum extension within the same width 2020-06-28 22:39:31 +03:00
Alexey Milovidov
e4d8cc2b44 Slightly more safe 2020-06-28 22:39:31 +03:00
Alexey Milovidov
97ad23b905 Allow to ALTER partition key in some cases 2020-06-28 22:39:31 +03:00
Alexey Milovidov
678d127503 Whitespace 2020-06-28 22:39:31 +03:00
Alexey Milovidov
c4d5ca485e Remove the usage of obsolete setting 2020-06-28 22:39:31 +03:00
kssenii
649eb8e348 Move reading from RabbitMQ into background task 2020-06-28 18:20:18 +00:00
Alexey Milovidov
d1f4a0e473 Fix array size overflow in generateRandom 2020-06-28 17:33:02 +03:00
alexey-milovidov
935d2be826
Merge pull request #12003 from ClickHouse/fix-typos
Fix typos in code
2020-06-28 15:49:17 +03:00
alexey-milovidov
5a99cdb0d9
Merge pull request #11996 from BohuTANG/mysql_engine_enum
ISSUES-3985 Support MySQL engine reading Enums type
2020-06-27 22:18:25 +03:00
Alexey Milovidov
1462a66d1e Fix typos 2020-06-27 22:05:00 +03:00
Alexey Milovidov
46caa211d5 Better diagnostics of "Replica {} appears to be already active" message 2020-06-27 16:55:00 +03:00
BohuTANG
f609fd34f7 Support Enums type for MySQL engine #3985 2020-06-27 09:10:07 +08:00
alesapin
6b3092290d Trying to fix ya.make 2020-06-26 19:33:51 +03:00
alesapin
b5f79bc28c Remove strange header 2020-06-26 19:32:15 +03:00
alesapin
4969da85d9 Fixes 2020-06-26 17:28:00 +03:00
alesapin
11f88340a5 Merge branch 'mongo' of https://github.com/ageraab/ClickHouse into storage_mongodb 2020-06-26 16:03:06 +03:00
alesapin
9710a67704 Fix style check 2020-06-26 15:27:12 +03:00
alesapin
6caf2e7a3f Fix protocol check 2020-06-26 14:38:37 +03:00
alesapin
6f1824f0ea Correct merge with master 2020-06-26 14:30:23 +03:00
alesapin
e9c47dc89c Merge branch 'master' into CurtizJ-polymorphic-parts 2020-06-26 14:27:19 +03:00
alesapin
b3c31370c2
Merge pull request #11970 from ClickHouse/fix-estimation-of-the-number-of-marks
Fix estimation of the number of marks while reading from MergeTree
2020-06-26 11:28:36 +03:00
alexey-milovidov
2163716e45
Merge pull request #11955 from ClickHouse/revive-mmap-2
Allow to use direct_io and mmap_io for secondary indices.
2020-06-26 03:16:56 +03:00
alexey-milovidov
178a5217bc
Merge pull request #11953 from ClickHouse/revive-mmap
Revive mmap IO + add a test
2020-06-26 03:15:07 +03:00
alexey-milovidov
8f429f6027
Merge pull request #11935 from zlobober/allocated_bytes
Consider allocatedBytes() instead of bytes() in Storage{Buffer,Memory}.
2020-06-26 00:57:47 +03:00
Alexey Milovidov
8eed47857b Fix estimation of the number of marks for various thresholds 2020-06-25 23:20:22 +03:00
Alexey Milovidov
8872417d00 Respect direct_io/mmap settings while reading secondary indices 2020-06-25 22:31:54 +03:00
Alexey Milovidov
5608f15749 Revive mmap IO 2020-06-25 22:15:41 +03:00
alexey-milovidov
a34032cace
Merge pull request #11300 from blinkov/sentry
Opt-in support for sending crash reports
2020-06-25 17:20:50 +03:00
alesapin
36eb2c3028 Simplify code around locks 2020-06-25 13:25:22 +03:00
alesapin
d5847d29d6 Avoid memory leaks 2020-06-25 12:44:39 +03:00
Maxim Akhmedov
29d2928f93 Consider allocatedBytes() instead of bytes() in Storage{Buffer,Memory}. 2020-06-25 00:27:53 +03:00
alesapin
addee61bcb Trying to do everything on top of libuv, add heartbeats 2020-06-25 00:14:49 +03:00
alesapin
cb30dbfe28 Correct merge with master 2020-06-24 20:32:57 +03:00
alesapin
3fc65b3269 Merge branch 'master' into kssenii-rabbit-mq 2020-06-24 20:14:28 +03:00
alesapin
63f8f89ca0
bump CI 2020-06-24 19:06:01 +03:00
alesapin
08f5ed6da3 Fix unitialized memory 2020-06-24 17:12:44 +03:00
Nikolai Kochetov
f7f16fdbf7
Merge pull request #11895 from ClickHouse/fix-nullable-prewhere-type-3
Fix nullable prewhere type 3
2020-06-24 14:32:08 +03:00
alexey-milovidov
18eb141ea1
Merge pull request #11715 from azat/dist-optimize_skip_unused_shards-fixes
Control nesting level for shards skipping and disallow non-deterministic functions
2020-06-24 12:54:58 +03:00
tavplubix
2401bc9143
Merge pull request #11896 from ClickHouse/merging_drop_replica
Merging #10679
2020-06-24 11:42:39 +03:00
Anton Popov
8c3f496826 add test with alters and in-memory parts 2020-06-24 01:16:29 +03:00
Ivan Blinkov
45d1ca2567 merge master 2020-06-24 00:18:16 +03:00
alexey-milovidov
33dfbdcbe9
Update StorageSystemTables.cpp 2020-06-23 22:28:26 +03:00
Alexander Tokmakov
7b5de16da9 minor improvements 2020-06-23 22:15:01 +03:00
Nikolai Kochetov
658a2d0dc0 Fix anotehr one nullable prewhere column. 2020-06-23 21:52:32 +03:00
amudong
2a51286527 Optimize code 2020-06-23 16:22:53 +08:00
alesapin
4185fe9975 Merge branch 'master' into atomic_metadata5 2020-06-23 11:13:05 +03:00
alesapin
292016e045 Add missed lock 2020-06-23 11:04:43 +03:00
amudong
cca8df6b78 format comment 2020-06-23 12:24:05 +08:00
amudong
0101947403 rewrite static StorageReplicatedMergeTree::dropReplica 2020-06-23 12:12:30 +08:00
amudong
7723dc4935 add drop relica database and the whole replica
fix removeReplicaByZKPath

fix bug: add zkpath empty judge

fix: rewrite code

delete useless code.

fix:ast fromat

fix bug

add test_drop_replica

add drop_replica doc

add drop databse checkAccess

refactor dropReplica

update tests

add static method StorageReplicatedMergeTree::dropReplicaByZkPath

update doc and delete useless code

fix conflict

fix doc

fix doc

fix StorageReplicatedMergeTree::dropReplica

fix bug

delete useless code
2020-06-23 12:12:30 +08:00
amudong
2e6a3eff8e fix: can not drop local table and replace ALTER with SYSTEM
fix test_drop_replica

fix drop replica '/path/to/zk/' ending in '/' and update doc
2020-06-23 12:12:30 +08:00
sundy-li
15ad830290 only drop inactive replica
update doc

Increase timeout to release the zookeeper Ephemeral nodes

Fix code comment

use PartitionManager

make integrations test passed
2020-06-23 12:12:30 +08:00
sundy-li
34df59baf8 Add tests and docs
Fix integration-tests
2020-06-23 12:12:30 +08:00
sundy-li
d4aa3cea4b fix merge state
Fix style && build
2020-06-23 12:12:30 +08:00
sundy-li
906a43e4a8 Add drop replica alter support 2020-06-23 12:12:30 +08:00
alexey-milovidov
a7b224a578
Merge pull request #11869 from ClickHouse/fix-nullable-prewhere-type-2
Fix nullable prewhere type 2
2020-06-23 02:48:59 +03:00
Anton Popov
78d28be8cf check in-memory parts, comments and style-fixes 2020-06-22 21:57:50 +03:00
robot-clickhouse
4bd47b8adc Auto version update to [20.6.1.1] [54436] 2020-06-22 20:40:26 +03:00
alesapin
ef89a6f728
Merge pull request #11786 from ClickHouse/fix_alter_with_materialized
Fix alter key when materialized column passed
2020-06-22 19:06:25 +03:00
Nikolai Kochetov
ae21aca3a3 Fix header for nullable prewhere column. 2020-06-22 19:01:59 +03:00
alesapin
c76b4b3481 Clang-tidy fixes 2020-06-22 18:51:11 +03:00
alesapin
f262c4f652 Better comments 2020-06-22 12:49:21 +03:00
alesapin
b1e8976df4 Merge with master 2020-06-22 12:04:27 +03:00
alesapin
b9e74f4e82 Merge branch 'master' into atomic_metadata5 2020-06-22 12:03:53 +03:00
Ivan Blinkov
2c0ff29c48 Merge branch 'master' of github.com:ClickHouse/ClickHouse into sentry 2020-06-22 10:06:36 +03:00
alexey-milovidov
9bfefc99ab
Merge pull request #11599 from filimonov/better_kafka_states
Kafka work with formats based on PeekableReadBuffer and other improvements
2020-06-20 20:36:54 +03:00
alexey-milovidov
076fe8e8ba
Update KafkaBlockInputStream.cpp 2020-06-20 20:34:42 +03:00
Alexey Milovidov
ad672f7ce2 Whitespace 2020-06-20 10:26:33 +03:00
Alexey Milovidov
b8769e1ada Fix style 2020-06-20 10:24:51 +03:00
alesapin
4c0879ae30 Better logging in storages 2020-06-19 20:17:13 +03:00
alesapin
c9fa5d2ec3 Better naming 2020-06-19 18:39:41 +03:00
alesapin
a2e7e9f232 Remove unused constructor and rename method 2020-06-19 18:21:48 +03:00
alesapin
3c47faa9da Move partition key initialization into registerMergeTree 2020-06-19 18:14:08 +03:00
Alexey Milovidov
468eaa8d93 Remove unused method 2020-06-19 17:21:26 +03:00
Alexey Milovidov
5211a42c04 Remove leader election, step 3 2020-06-19 17:18:58 +03:00
alesapin
016ee6316f Add missed check 2020-06-19 15:05:29 +03:00
alesapin
ce0c5faf9e Merge branch 'fix_alter_with_materialized' into atomic_metadata5 2020-06-19 14:00:32 +03:00
alesapin
4b6db63fff Fix alter key when materialized column passed 2020-06-19 13:53:20 +03:00
Mikhail Filimonov
9609bd9dee Kafka better states, formats based on PeekableReadBuffer, and other minor fixes.
Add formats tests, fixes for JSONCompactEachRowWithNamesAndTypes, TSVWithNamesAndTypes. Some CR fixes
Add sanitizing for kafka_max_block_size and kafka_poll_max_batch_size
2020-06-19 10:49:05 +02:00
alesapin
009977c20c Fix locks 2020-06-18 22:45:37 +03:00
Azat Khuzhin
d34e6217bc Add logging of adjusting conditional settings for distributed queries 2020-06-18 21:49:29 +03:00
Azat Khuzhin
041533eae2 Disable optimize_skip_unused_shards if sharding_key has non-deterministic func
Example of such functions is rand()

And this patch disables only optimize_skip_unused_shards, i.e. INSERT
code path does not changed, so it will work as before.
2020-06-18 21:49:29 +03:00
alesapin
8b131e2079 Remove int contention 2020-06-18 20:19:11 +03:00
alesapin
c666763cc0 Remove unused method better 2020-06-18 20:09:06 +03:00
alesapin
e888dafdc2 Remove unused method 2020-06-18 20:03:42 +03:00
alesapin
b3ee8967dc Fix style 2020-06-18 19:28:20 +03:00
alesapin
54e5fe7dbc Less locks 2020-06-18 19:19:40 +03:00
alesapin
d79982f497 Better locks in Storages 2020-06-18 19:10:47 +03:00
alesapin
c8a58299ac Fix storage buffer metadata 2020-06-18 14:42:48 +03:00
alesapin
1a69c3234a Fix style 2020-06-18 14:09:55 +03:00
alesapin
d4c49816ab Really atomic metadata 2020-06-18 14:02:31 +03:00
alesapin
4de5331b0d Fix SystemTables 2020-06-18 13:39:33 +03:00
alesapin
aab4ce6394 Truncate with metadata 2020-06-18 13:29:13 +03:00
alesapin
35ce47951d Fix storage merge 2020-06-18 12:22:54 +03:00
alesapin
760e9a8488 Fix crash 2020-06-18 12:08:24 +03:00
alesapin
f4037b8f54 Fix build 2020-06-18 12:00:43 +03:00
alesapin
ebb36bec8a Merge branch 'master' into atomic_metadata5 2020-06-18 11:57:16 +03:00
alesapin
d0beeaf7c4
Merge pull request #11744 from ClickHouse/stop_fetches_before_metadata_alter
Cancel fetches before metadata alter
2020-06-18 11:32:16 +03:00
alesapin
870d891257 Cancel fetches before metadata alter 2020-06-17 23:25:43 +03:00
Azat Khuzhin
caa88777be Parse metadata stored in zookeeper before checking for equality
After #11325 trailing whitespaces has been removed for data skipping
indicies, and it may be different, if you have multiple skip indices,
and in this case new server will not load such tables, because metadata
will be different.

Fix this by re-parse metadata in zookeeper.
2020-06-17 21:03:22 +03:00
alesapin
dffdece350 getColumns in StorageInMemoryMetadta (only compilable) 2020-06-17 19:39:58 +03:00
alesapin
ef8781cce7 Better getVirtuals method 2020-06-17 17:37:21 +03:00
alesapin
33c27de54d Check methods in metadata 2020-06-17 17:32:25 +03:00
alesapin
31abbe5dbd Select query in metadata 2020-06-17 17:06:22 +03:00
alesapin
eaaef83742 Settings changes in StorageInMemoryMetadata 2020-06-17 16:46:01 +03:00
alesapin
ed8f3b2fc4 TTL in storage in memory metadata 2020-06-17 16:39:26 +03:00
Vitaly Baranov
7011401cd4
Merge pull request #11670 from vitlibar/rbac-improve-parser-multiple-entities
RBAC: improve syntax
2020-06-17 16:26:02 +03:00
alesapin
7064a366e2 Missed change for primary key 2020-06-17 15:40:27 +03:00
alesapin
1afdebeebd Primary key in storage metadata 2020-06-17 15:39:20 +03:00
alesapin
1da393b218 Sampling key in StorageInMemoryMetadata 2020-06-17 15:07:09 +03:00
alesapin
eca6e9087e Fix race condition 2020-06-17 14:52:19 +03:00
alesapin
ba04d02f1e Compilable sorting key in metadata 2020-06-17 14:05:11 +03:00
Nikita Mikhaylov
d2be6c036b
Merge pull request #11602 from ClickHouse/fix-buffer-sample
Fix buffer sample
2020-06-17 14:44:48 +04:00
Nikita Mikhaylov
ff0262626a
Merge pull request #11645 from azat/load-balancing-round-robin
Add round_robin load_balancing
2020-06-17 14:34:59 +04:00
alesapin
ab61abccc1 Partition key in StorageInMemoryMetadata 2020-06-17 13:34:23 +03:00
alesapin
62f2c17a66 Secondary indices in StorageInMemoryMetadata 2020-06-17 12:38:47 +03:00
alesapin
2fac3290f0 Merge branch 'master' into atomic_metadata5 2020-06-17 11:14:03 +03:00
alexey-milovidov
e07d02015c
Merge pull request #11661 from ClickHouse/return-not-nullable-from-count-distinct-2
Return non-Nullable results from COUNT(DISTINCT), more complete.
2020-06-17 09:25:45 +03:00
alexey-milovidov
598fd75caf
Merge pull request #11639 from ClickHouse/remove-leader-election-2
Remove leader election, step 2: allow multiple leaders
2020-06-17 09:25:23 +03:00
alexey-milovidov
6e61f708d7
Merge pull request #11690 from ClickHouse/odbc-bridge-timeouts
Pass proper timeouts when communicating with XDBC bridge.
2020-06-17 03:18:29 +03:00
Alexey Milovidov
a655765040 Merge branch 'master' into return-not-nullable-from-count-distinct-2 2020-06-17 01:15:57 +03:00
alexey-milovidov
f387752cf1
Merge pull request #11702 from ClickHouse/fix-mv-header
Fix mv header
2020-06-16 22:43:38 +03:00
Alexey Milovidov
0a6054eece Merge branch 'master' into return-not-nullable-from-count-distinct-2 2020-06-16 22:31:33 +03:00
Alexey Milovidov
b7ec5f94f2 Merge branch 'master' into odbc-bridge-timeouts 2020-06-16 22:14:43 +03:00
alesapin
fa60903620 Fix race condition 2020-06-16 21:41:11 +03:00
alesapin
d214a504d7
Merge pull request #11681 from ClickHouse/fix_mutations_premature_finish
Fix mutations premature "finish"
2020-06-16 21:26:14 +03:00
alesapin
ccc2bda666 getConstraints() in StorageInMemoryMetadata (suspicious commit, but pretend to work) 2020-06-16 19:55:04 +03:00
alesapin
1ddeb3d149 Buildable getSampleBlock in StorageInMemoryMetadata 2020-06-16 18:51:29 +03:00
alesapin
71f99a274d Compileable getSampleBlockWithColumns in StorageInMemoryMetadata 2020-06-16 17:25:08 +03:00
Ivan Blinkov
7e2bb1fd83 Merge branch 'master' of github.com:ClickHouse/ClickHouse into sentry 2020-06-16 16:02:55 +03:00