Commit Graph

1917 Commits

Author SHA1 Message Date
Kseniia Sumarokova
bd5610b732
Merge branch 'master' into update-azure-lib 2022-08-03 23:00:57 +02:00
Alexey Milovidov
316528817b
Merge pull request #39179 from azat/fsync-profile-events
Add profile events for fsync
2022-08-02 05:44:35 +03:00
Azat Khuzhin
3e627e2861 Add profile events for fsync
The following new provile events had been added:

- FileSync - Number of times the F_FULLFSYNC/fsync/fdatasync function was called for files.
- DirectorySync - Number of times the F_FULLFSYNC/fsync/fdatasync function was called for directories.
- FileSyncElapsedMicroseconds - Total time spent waiting for F_FULLFSYNC/fsync/fdatasync syscall for files.
- DirectorySyncElapsedMicroseconds - Total time spent waiting for F_FULLFSYNC/fsync/fdatasync syscall for directories.

v2: rewrite test to sh with retries
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-31 23:19:30 +03:00
kssenii
687f0fabfc Move some dependencies 2022-07-31 20:17:22 +03:00
Robert Schulze
a7734672b9
Use std::popcount, ::countl_zero, ::countr_zero functions
- Introduced with the C++20 <bit> header

- The problem with __builtin_c(l|t)z() is that 0 as input has an
  undefined result (*) and the code did not always check. The std::
  versions do not have this issue.

- In some cases, we continue to use buildin_c(l|t)z(), (e.g. in
  src/Common/BitHelpers.h) because the std:: versions only accept
  unsigned inputs (and they also check that) and the casting would be
  ugly.

(*) https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
2022-07-31 15:16:51 +00:00
Alexey Milovidov
22bc89690d
Merge pull request #39222 from azat/fix-http-session
Do not report "Failed communicating with" on and on for parts exchange
2022-07-31 02:24:05 +03:00
Vitaly Baranov
2f3b27d1ac Fix seeking while reading from encrypted disk. 2022-07-29 12:45:29 +02:00
Vitaly Baranov
3b6bacbf0b Add tests. 2022-07-28 22:38:50 +02:00
Vladimir C
ee515b8862
Merge pull request #39656 from HarryLeeIBM/hlee-s390x-bit-helpers
Fix Endian issue in BitHelpers for s390x
2022-07-28 13:31:14 +02:00
Vladimir C
a8be51f4df
Merge pull request #39567 from Algunenano/progress_result_rows_and_bytes
Add result_rows and result_bytes to progress reports
2022-07-27 16:43:55 +02:00
HarryLeeIBM
3639ecfc56 Fix Endian issue in BitHelpers 2022-07-27 06:56:04 -07:00
alesapin
2dfb547847
Merge pull request #39054 from SmitaRKulkarni/add-option-for-outfile-to-print-stdout
Add an option to INTO OUTFILE to also print details to standard output.
2022-07-27 13:51:38 +02:00
Kseniia Sumarokova
7d448fc177
Merge pull request #39244 from kssenii/http-buffer-small-fixes
Some small fixes for http read buffer, allow to retry partial content in case of 200ok
2022-07-26 14:47:11 +03:00
Raúl Marín
6e3a4b0a3d Add result_rows and result_bytes to progress reports and summary 2022-07-26 10:40:16 +02:00
Kseniia Sumarokova
9abbb35cda
Fix integration test 2022-07-25 23:40:23 +03:00
Alexey Milovidov
388d06fda1
Merge pull request #39535 from ClickHouse/stringref
Less usage of StringRef
2022-07-25 04:06:11 +03:00
Robert Schulze
4333750985
Less usage of StringRef
... replaced by std::string_view, see #39262
2022-07-24 18:33:52 +00:00
Alexey Milovidov
a897c263f0
Merge branch 'master' into http-buffer-small-fixes 2022-07-24 01:46:10 +03:00
mergify[bot]
0933dd7904
Merge branch 'master' into add-option-for-outfile-to-print-stdout 2022-07-23 19:50:10 +00:00
Kseniia Sumarokova
77ddb8eda0
Merge pull request #39506 from CurtizJ/fix-direct-io
Fix reading from async read buffer with direct io
2022-07-23 06:08:48 +02:00
Anton Popov
c1a5514e46 fix reading from async read buffer with direct io 2022-07-22 16:58:30 +00:00
Alexander Tokmakov
bed2206ae9
Merge pull request #39460 from ClickHouse/remove_some_dead_and_commented_code
Remove some dead and commented code
2022-07-22 13:24:34 +03:00
Robert Schulze
ea0a3bf600
Merge branch 'master' into stringref-to-string_view 2022-07-21 18:33:06 +02:00
Alexander Tokmakov
a8da5d96fc remove some dead and commented code 2022-07-21 15:05:48 +02:00
Nikolai Kochetov
91043351aa Fixing build. 2022-07-20 20:30:16 +00:00
Smita Kulkarni
605fc5f121 Addressed review comments
- Added finalizeImpl() override in ForkWriteBuffer to call finalize() of all the buffers.
- Removed clearing buffer in ForkWriteBuffer destructor.
2022-07-20 21:02:54 +02:00
Robert Schulze
df53a556eb
Fix test failures 2022-07-20 07:59:02 +00:00
Robert Schulze
81ef1099cc
Even less usage of StringRef
--> see #39300
2022-07-19 07:01:06 +00:00
Smita Kulkarni
8b523bec16 Addressed review comments
- Updated destructor of ForkWriteBuffer to clear buffer
2022-07-18 22:12:26 +02:00
Smita Kulkarni
228b9e7ec4 Addressed review comments
- Updated exception message in ForkWriteBuffer
- Added test case to tests/queries/0_stateless/02346_into_outfile_and_stdout.sh for calling nextImpl more than once
2022-07-17 20:09:18 +02:00
Robert Schulze
13482af4ee
First try at reducing the use of StringRef
- to be replaced by std::string_view
- suggested in #39262
2022-07-17 17:26:02 +00:00
Smita Kulkarni
6318927fba addressed review comment: ForkWriteBuffer for loop 2022-07-15 18:37:50 +02:00
Smita Kulkarni
d7fc7a4290 Addressed review comments
- Removed first_buffer, finalizeImpl and logic to different buffer size from ForkWriteBuffer
2022-07-15 16:08:53 +02:00
kssenii
a06fe4e21b Fix 2022-07-15 13:53:20 +02:00
Robert Schulze
deda29b46b
Pass const StringRef by value, not by reference
See #39224
2022-07-15 11:34:56 +00:00
Kruglov Pavel
a944a92d4c
Merge pull request #39224 from Avogar/string-view-by-value
Pass const std::string_view by value, not by reference
2022-07-15 13:05:56 +02:00
Smita Kulkarni
5a8d6ba0fc clang tidy feedback addressed: updated src/IO/ForkWriteBuffer.cpp to use const reference 2022-07-15 09:06:25 +02:00
Smita Kulkarni
1dc2187f9c Addressed review comments
Implementation:
- Added a new buffer ForkWriteBuffer takes a vector of WriteBuffer and writes data to all of them. It uses the buffer of the first element as its buffer and copies data from first buffer to all the other buffers
Testing:
- Updated tests/queries/0_stateless/02346_into_outfile_and_stdout.sh
Documentation:
- Updated the english documentation for SELECT.. INTO OUTFILE with AND STDOUT.
2022-07-14 22:47:38 +02:00
kssenii
03897589b9 Fix 2022-07-14 21:31:17 +02:00
avogar
9291d33080 Pass const std::string_view & by value, not by reference 2022-07-14 16:11:57 +00:00
Sergei Trifonov
b2317ff710 renaming to be consistent 2022-07-14 17:33:22 +02:00
Azat Khuzhin
a068c397df Do not report "Failed communicating with" on and on for parts exchange
For parts exchange right now an error message in stored in the
HTTPSession, via HTTPSession::attachSessionData(), and for each request
this HTTPSession::sessionData() is checked and if not empty printed into
the log.

However it should be reported only once, otherwise you will get this
message on and on, even for different tables. Here is an example of such
messages:

    2022.07.13 07:56:09.342997 [ 683 ] {} <Error> test_juq8qk.rmt2 (ede90518-4710-48bb-ab43-caf0b1b157f4): auto DB::StorageReplicatedMergeTree::processQueueEntry(ReplicatedMergeTreeQueue::SelectedEntryPtr)::(anonymous class)::operator()(DB::StorageReplicatedMergeTree::LogEntryPtr &) const: Code: 86. DB::Exception: Received error from remote server /?endpoint=DataPartsExchange%3A%2Ftest%2F01165%2Ftest_juq8qk%2Frmt%2Freplicas%2F1&part=206--1406300905-20220713-1657673769_0_0_0&client_protocol_version=7&compress=false&remote_fs_metadata=s3. HTTP status code: 500 Internal Server Error, body: Code: 236. DB::Exception: Transferring part to replica was cancelled. (ABORTED) (version 22.7.1.1781 (official build)). (RECEIVED_ERROR_FROM_REMOTE_IO_SERVER), Stack trace (when copying this message, always include the lines below):
    # this is the time when this message is written ^
    2022.07.13 07:56:10.528554 [ 814 ] {} <Information> DatabaseCatalog: Removing metadata /var/lib/clickhouse/metadata_dropped/test_juq8qk.rmt2.ede90518-4710-48bb-ab43-caf0b1b157f4.sql of dropped table test_juq8qk.rmt2 (ede90518-4710-48bb-ab43-caf0b1b157f4)
    # now this table had been removed ^
    2022.07.13 07:56:27.442003 [ 683 ] {} <Debug> test_1orbeb.mutations_and_quorum2 (bc811afd-1f57-4f9c-a04d-9e1e1b60e891): Fetching part 201901_0_0_0 from /clickhouse/tables/test_1orbeb/test_01090/mutations_and_quorum/replicas/1
    # here fetch part is scheduled for another table ^
    2022.07.13 07:56:27.442213 [ 683 ] {} <Trace> HTTPCommon: Failed communicating with 250c6af4615d with error 'Received error from remote server /?endpoint=DataPartsExchange%3A%2Ftest%2F01165%2Ftest_juq8qk%2Frmt%2Freplicas%2F1&part=255--1372061156-20220713-1657673769_0_0_0&client_protocol_version=7&compress=false&remote_fs_metadata=s3. HTTP status code: 500 Internal Server Error, body: Code: 236. DB::Exception: Transferring part to replica was cancelled. (ABORTED) (version 22.7.1.1781 (official build))' will try to reconnect session
    # however it still reports an error for the already removed table test_juq8qk.rmt
    2022.07.13 07:56:27.442246 [ 683 ] {} <Trace> ReadWriteBufferFromHTTP: Sending request to http://250c6af4615d:9009/?endpoint=DataPartsExchange%3A%2Fclickhouse%2Ftables%2Ftest_1orbeb%
    # but this is just a noisy message and it still doing the job correctly ^

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-14 15:17:15 +03:00
Sergei Trifonov
af4a5a5f3a fix conflicts 2022-07-13 19:44:29 +02:00
Sergei Trifonov
f854507729 merge master and resolve conflicts 2022-07-13 19:07:28 +02:00
Sergei Trifonov
60c6a5b23c fix s3 read/write throttling instant 2022-07-13 18:36:08 +02:00
kssenii
6f29eada80 Merge master 2022-07-12 19:28:18 +02:00
Robert Schulze
1a7727a254
Prefix overridden add_executable() command with "clickhouse_"
A simple HelloWorld program with zero includes except iostream triggers
a build of ca. 2000 source files. The reason is that ClickHouse's
top-level CMakeLists.txt overrides "add_executable()" to link all
binaries against "clickhouse_new_delete". This links against
"clickhouse_common_io", which in turn has lots of 3rd party library
dependencies ... Without linking "clickhouse_new_delete", the number of
compiled files for "HelloWorld" goes down to ca. 70.

As an example, the self-extracting-executable needs none of its current
dependencies but other programs may also benefit.

In order to restore access to the original "add_executable()", the
overriding version is now prefixed. There is precedence for a
"clickhouse_" prefix (as opposed to "ch_"), for example
"clickhouse_split_debug_symbols". In general prefixing makes sense also
because overriding CMake commands relies on undocumented behavior and is
considered not-so-great practice (*).

(*) https://crascit.com/2018/09/14/do-not-redefine-cmake-commands/
2022-07-11 19:36:18 +02:00
Sergei Trifonov
6ed777d2a8 add azure support 2022-07-11 19:19:57 +02:00
Sergei Trifonov
43779ec280 add max_remote_{read,write}_network_bandwidth_for_server settings 2022-07-11 14:59:39 +02:00
kssenii
bf1c99daab Refactoring of object storages, add LocalObjectStorage 2022-07-09 12:39:31 +02:00