Commit Graph

59191 Commits

Author SHA1 Message Date
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
Anton Ivashkin
bec9de7161 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into s3_zero_copy_replication 2021-03-04 13:29:45 +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
Anton Ivashkin
e69124a0a6 Merge master 2021-03-04 13:26:40 +03:00
Nikolai Kochetov
a195e783d2 Try fix perftests. 2021-03-04 13:25:49 +03:00
DIAOZHAFENG
35aaac84b8
Update in.md 2021-03-04 16:58:09 +08:00
DIAOZHAFENG
587014217c
Update in.md
update untranslated line
2021-03-04 16:47:59 +08:00
Nikolai Kochetov
b985e33294
Merge pull request #21434 from azat/dist-query-SIGSEGV-on-exception-fix
Fix SIGSEGV for distributed queries on failures
2021-03-04 11:32:17 +03:00
alesapin
3a0b9102d8 Merge branch 'fix_nukeeper_default_path' into persistent_nukeeper_snapshot_storage 2021-03-04 11:30:54 +03:00
alesapin
429cc03668 Merge branch 'master' into persistent_nukeeper_snapshot_storage 2021-03-04 11:30:46 +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
olgarev
134eaa55e5
DOCSUP-6258: FAQ edit and translate (#21109)
Co-authored-by: ana-uvarova <ana-uvarova@yandex-team.ru>
Co-authored-by: AnaUvarova <64017504+AnaUvarova@users.noreply.github.com>
Co-authored-by: vdimir <vdimir@yandex-team.ru>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anna <42538400+adevyatova@users.noreply.github.com>
2021-03-04 10:50:14 +03:00
Haavard Kvaalen
f96892d45c Speed up network partition test
REJECT rather than DROP packets in network partition test.  This test
was already very slow and could get slower with the newly added
reconnection logic.
2021-03-04 08:49:06 +01:00
Haavard Kvaalen
641b1b249e Attempt to reconnect to MySQL
For MaterializeMySQL databases, attempt to reconnect if the connection
to MySQL is lost.  The existing setting
`max_wait_time_when_mysql_unavailable` is used to control how often we
attempt to reconnect.  This setting can now be set to a negative value
to disable reconnects.
2021-03-04 08:49:06 +01:00
Haavard Kvaalen
11c9c8cb10 Reset sequence number on disconnect
Reestablishing the connection for an existing MySQLClient object would
never work because the sequence number would be wrong on the new
connection.
2021-03-04 08:49:06 +01:00
Haavard Kvaalen
8e95d6e174 Add method to metadata class to start replication
Previously this was done by the constructor.  This makes it
possible to restart replication with an existing metadata object.
2021-03-04 08:49:06 +01:00
Haavard Kvaalen
e6711675a1 Make handling of unavailable MySQL consistent
If MySQL was unavailable when loading an existing database on startup,
we would previously load the database, fail to start synchronization,
but allow queries to the database.  Change this to only allow queries
if the `allows_queries_when_mysql_lost` setting is on, so that the
behavior is consistent with what happens if the connection to MySQL is
lost while ClickHouse is running.

Also retry connection to MySQL if MySQL is unavailable when ClickHouse
is started (we would previously reconnect only if the connection was
lost during the initial dump of existing data).
2021-03-04 08:49:06 +01:00
Azat Khuzhin
45ca803973 Fix logging for optimize_aggregation_in_order=1 (with small max_block_size) 2021-03-04 10:34:41 +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
e7948819f9 Fix ParsingException::displayText()
Before it was silently try-catched for messages with additional {}, and
it is very easy to trigger, i.e.:

    SELECT toDateTime(format('{}-{}-01 00:00:00', '2021', '1'))

Will print:

    Code: 41. DB::Exception: Received from localhost:9000. DB::Exception: Cannot parse datetime 2021-1-01 00:00:00{}: Cannot parse DateTime from String: while executing 'FUNCTION toDateTime(format('{}-{}-01 00:00:00', '2021', '1') :: 3) -> toDateTime(format('{}-{}-01 00:00:00', '2021', '1')) DateTime : 2'.
2021-03-03 23:44:51 +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
a57c646467 Fix 01293_system_distribution_queue flakiness 2021-03-03 23:30:24 +03:00
Azat Khuzhin
9a4f469a38 Fix 00753_distributed_system_columns_and_system_tables flakiness 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
cabe4ca1bb tests: split 00753_system_columns_and_system_tables (to disable Distributed part for arcadia) 2021-03-03 23:30:03 +03:00
Azat Khuzhin
3102835d56 tests: Use total_bytes>0 for Distributed engine in 00753_system_columns_and_system_tables 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
76e10a4fb1 Missed files for tests 2021-03-03 23:05:33 +03:00
Alexey Milovidov
680b0d1531 Merge branch 'master' into jart-memcpy 2021-03-03 20:11:38 +03:00
alesapin
0f733828c2 Missed config 2021-03-03 19:44:06 +03:00
alesapin
15a29dd3e6 Stop yelling 2021-03-03 19:28:46 +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
e6f4ce1741 Better initial batch callback 2021-03-03 19:16:55 +03:00
alesapin
e77f7e57e2 Better initial batch callback 2021-03-03 19:13:29 +03:00
alesapin
7e28bfeb9e Fix log store start 2021-03-03 18:37:31 +03:00