Commit Graph

10938 Commits

Author SHA1 Message Date
alesapin
42c1a65b0f Style 2021-03-04 15:30:26 +03:00
alesapin
c8423249db Less strict checks 2021-03-04 15:01:56 +03:00
alesapin
aa1312ac79 Merge with master 2021-03-04 14:43:12 +03:00
alesapin
ff67860770 Merge branch 'master' into persistent_nukeeper_snapshot_storage 2021-03-04 14:30:51 +03:00
alesapin
5565c37b4f tests and fixes for off by one error 2021-03-04 14:22:59 +03:00
Ivan
218542589a
Merge pull request #19673 from azat/distributed-bytes_to_throw_insert
Add ability to throttle INSERT into Distributed
2021-03-04 13:28:23 +03:00
alesapin
3a0b9102d8 Merge branch 'fix_nukeeper_default_path' into persistent_nukeeper_snapshot_storage 2021-03-04 11:30:54 +03:00
alesapin
d28463d70b Use path as default prefix for coordination logs 2021-03-04 11:29:24 +03:00
alesapin
7556a3d723 Enable snapshots 2021-03-04 11:00:26 +03:00
Azat Khuzhin
e858dae187 Fix SIGSEGV for distributed queries on failures
Since after pull(), cancel() will be called, and this will lead to
SIGSEGV, since there is no exception, but has_exception was not reseted
in pull()
2021-03-04 00:42:49 +03:00
Azat Khuzhin
79ed35876e DirectoryMonitor: Remove const qualifier and lots of mutable qualifiers 2021-03-03 23:30:24 +03:00
Azat Khuzhin
45ee650e26 Distributed: check for bytes_to_throw/delay_insert only before INSERT
Before it was checked for each block.
2021-03-03 23:30:24 +03:00
Azat Khuzhin
6965ac26c3 Distributed: Add ability to delay/throttle INSERT until pending data will be reduced
Add two new settings for the Distributed engine:
- bytes_to_delay_insert
- max_delay_to_insert

If at the beginning of INSERT there will be too much pending data, more
then bytes_to_delay_insert, then the INSERT will wait until it will be
shrinked, and not more then max_delay_to_insert seconds.

If after this there will be still too much pending, it will throw an
exception.

Also new profile events were added (by analogy to the MergeTree):
- DistributedDelayedInserts (although you can use system.errors instead
  of this, but still)
- DistributedRejectedInserts
- DistributedDelayedInsertsMilliseconds
2021-03-03 23:30:23 +03:00
Azat Khuzhin
15f7459cae Distributed/DirectoryMonitor: protect metric_pending_files with metrics_lock
Since there is local value, that is not atomic, anyway we already have
lock for metrics, so it is fine.
2021-03-03 23:30:03 +03:00
Azat Khuzhin
70049db143 CurrentMetrics/Increment: Introduce add() 2021-03-03 23:30:03 +03:00
Azat Khuzhin
017c054a35 Distributed/DirectoryMonitor: Use std::lock_guard over std::unique_lock
It is more natural, since we do not need lazy locking.
2021-03-03 23:30:03 +03:00
Azat Khuzhin
fcf49a4914 Distributed: Calculate counters for async INSERT at INSERT time
Previous patch fixes the inaccuracy, but it's done using iterating over
directory on each request (to system.distribution_queue or to check
bytes_to_throw_insert), and like previous patch alredy stated, it may
have pretty huge overhead (especially when you have lots of distributed
files pending).

This patch remove that recalculation (but it will still be done, and
if there is different, there will be a log message), and replace it with
proper account at INSERT time (and after file has been sent, or marked
as broken).
2021-03-03 23:30:03 +03:00
Azat Khuzhin
b43046ba06 Distributed: More accurate distribution_queue counters
So now system.distribution_queue will show accurate statistics, so tests
does not requires sleep anymore.

But note that with too much distributed pending this will iterate over
all directories.
2021-03-03 23:30:03 +03:00
Azat Khuzhin
b5a5778589 Distributed: Add ability to limit amount of pending bytes for async INSERT
Right now with distributed_directory_monitor_batch_inserts=1 and
insert_distributed_sync=0 INSERT into Distributed table will store
blocks that should be sent to remote (and in case of
prefer_localhost_replica=0 to the localhost too) on the local
filesystem, and sent it in background.

However there is no limit for this storage, and if the remote is
unavailable (or some other error), these pending blocks may take
significant space, and this is not always desired behaviour.

Add new Distributed setting - bytes_to_throw_insert, that will set the
limit for how much pending bytes is allowed, if the limit will be
reached an exception will be throw.

By default was set to 0, to avoid surprises.
2021-03-03 23:30:00 +03:00
Azat Khuzhin
ce09b7ff89 Distributed: Implement totalBytes() (system.tables.total_bytes) 2021-03-03 23:29:11 +03:00
Azat Khuzhin
456cbaf747 Distributed: Hide private part of the interface 2021-03-03 23:29:11 +03:00
Azat Khuzhin
8531431bbc getClusterName: Use std::string over String (since it includes only <string>) 2021-03-03 23:29:11 +03:00
alesapin
4e175bd988 Useful comments 2021-03-03 19:27:08 +03:00
alesapin
e6083c4dc4 Fix style 2021-03-03 19:25:47 +03:00
alesapin
eb5e416fd5 Merge branch 'master' into persistent_nukeeper_snapshot_storage 2021-03-03 19:19:02 +03:00
alesapin
7e28bfeb9e Fix log store start 2021-03-03 18:37:31 +03:00
Pavel Kruglov
dc9dd8ccdc Fix typo 2021-03-03 16:16:17 +03:00
alesapin
186b39f0d5 Followup fix 2021-03-03 15:31:21 +03:00
alesapin
0136d7d51a Get rid of unused field 2021-03-03 15:29:00 +03:00
alesapin
37fc5faa6f Fix nasty serialization bug 2021-03-03 15:21:21 +03:00
alesapin
1707e7f1c3 Rename file 2021-03-03 14:22:38 +03:00
alesapin
e615299ae6 Fix some bugs and add snapshots validation 2021-03-03 14:10:24 +03:00
Nikolai Kochetov
cb122160ae
Merge pull request #19291 from Avogar/hedged-requests
Implementation of HedgedRequests
2021-03-03 12:58:37 +03:00
alesapin
07e39ef47a Merge branch 'master' into persistent_nukeeper_snapshot_storage 2021-03-03 11:12:01 +03:00
alesapin
6b1005aea5
Merge pull request #21334 from ClickHouse/fix_alter_partition_key
Fix alter modify query for partition key and other metadata fields
2021-03-03 10:15:11 +03:00
alexey-milovidov
bd7b540b82
Merge pull request #21307 from amosbird/moduleopt
Specialize intDiv/module
2021-03-03 04:49:29 +03:00
Anton Popov
a4c00ab5dc
Merge pull request #21303 from ucasFL/forbid
Forbid to drop a column if it's referenced by materialized view
2021-03-03 02:55:06 +03:00
alexey-milovidov
33bb77f777
Merge pull request #21367 from amosbird/mysqlfix
mysql client compatibility
2021-03-03 02:13:58 +03:00
alexey-milovidov
6e5638cee8
Merge pull request #21366 from songenjie/shutdown_timeout_log
[ClickHouse][LOG]correct shutdown timeout log
2021-03-03 01:55:15 +03:00
alexey-milovidov
c78256ad65
Merge pull request #21327 from amosbird/hasequalvalue
IColunm::hasEqualValues()
2021-03-03 01:19:26 +03:00
Pavel Kruglov
82a6be44cf Disable changing replica when we have made progress 2021-03-03 01:03:03 +03:00
Kruglov Pavel
fbe0a14a2f
Merge pull request #21035 from anmolarora/system-parts-requested-columns-fill
Fill only requested columns when querying system.parts & system.parts…
2021-03-03 00:39:45 +03:00
Nikolai Kochetov
8e6fa404c4
Merge pull request #21246 from ucasFL/union-distinct-improve
Improve Normalization of ASTSelectWithUnionQuery
2021-03-02 21:37:07 +03:00
alesapin
c29d7c7f49 Shutup clang tidy 2021-03-02 19:13:36 +03:00
alesapin
ee185bc536 Start from committed plus 1 2021-03-02 18:58:02 +03:00
alesapin
346d2b1d27 Deepbugging 2021-03-02 18:19:05 +03:00
Amos Bird
9411d496d9
Fix build 2021-03-02 23:17:02 +08:00
alesapin
8e6252b25f Use snapshot object in serialization 2021-03-02 17:30:56 +03:00
Amos Bird
134216dc4a Specialize intDiv/module 2021-03-02 16:27:28 +03:00
alesapin
10e16e39ea Written synchronous snapshots 2021-03-02 16:18:04 +03:00