Commit Graph

43 Commits

Author SHA1 Message Date
Azat Khuzhin
a871036361
Fix parallel_reading_from_replicas with clickhouse-bechmark (#34751)
* Use INITIAL_QUERY for clickhouse-benchmark

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

* Fix parallel_reading_from_replicas with clickhouse-bechmark

Before it produces the following error:

    $ clickhouse-benchmark --stacktrace -i1 --query "select * from remote('127.1', default.data_mt) limit 10" --allow_experimental_parallel_reading_from_replicas=1 --max_parallel_replicas=3
    Loaded 1 queries.
    Logical error: 'Coordinator for parallel reading from replicas is not initialized'.
    Aborted (core dumped)

Since it uses the same code, i.e RemoteQueryExecutor ->
MultiplexedConnections, which enables coordinator if it was requested
from settings, but it should be done only for non-initial queries, i.e.
when server send connection to another server.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

* Fix 02226_parallel_reading_from_replicas_benchmark for older shellcheck

By shellcheck 0.8 does not complains, while on CI shellcheck 0.7.0 and
it does complains [1]:

    In 02226_parallel_reading_from_replicas_benchmark.sh line 17:
        --allow_experimental_parallel_reading_from_replicas=1
        ^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.

    Did you mean:
        "--allow_experimental_parallel_reading_from_replicas=1"

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/34751/d883af711822faf294c876b017cbf745b1cda1b3/style_check__actions_/shellcheck_output.txt

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-08 16:42:29 +01:00
Alexey Milovidov
7067fafd76 Reimplement #33054 2021-12-29 22:09:07 +03:00
Nikolai Kochetov
fd14faeae2 Remove DataStreams folder. 2021-10-15 23:18:20 +03:00
Nikolai Kochetov
340b53ef85 Remove some more streams. 2021-10-08 17:03:54 +03:00
alexey-milovidov
ec949e4c66
Merge pull request #26607 from azat/bench-round-robin
Add round-robin support for clickhouse-benchmark
2021-07-24 20:17:35 +03:00
alexey-milovidov
a2ccfed2e2
Update Benchmark.cpp 2021-07-24 19:14:57 +03:00
alexey-milovidov
ea48b2a810
Update Benchmark.cpp 2021-07-24 19:10:37 +03:00
alexey-milovidov
adb92c1b70
Merge pull request #26656 from azat/bench-hang-on-EMFILE-fix
Avoid hanging clickhouse-benchmark if connection fails (i.e. on EMFILE)
2021-07-24 19:02:46 +03:00
vdimir
e4f3b9e7f4
Log exception message in void thread in clickhouse-benchmark 2021-07-23 17:41:32 +03:00
vdimir
d1106b325e
Lock mutex before access to std::cerr in clickhouse-benchmark 2021-07-23 17:35:22 +03:00
Azat Khuzhin
3f0dd40c69 Avoid hanging clickhouse-benchmark if connection fails (i.e. on EMFILE) 2021-07-22 10:08:49 +03:00
Azat Khuzhin
1860808969 Add round-robin support for clickhouse-benchmark 2021-07-20 23:00:04 +03:00
Alexey Milovidov
7a993404b4 Whitespace 2021-07-02 02:30:18 +03:00
Azat Khuzhin
18e8f0eb5e Add ability to push down LIMIT for distributed queries
This way the remote nodes will not need to send all the rows, so this
will decrease network io and also this will make queries w/
optimize_aggregation_in_order=1/LIMIT X and w/o ORDER BY faster since it
initiator will not need to read all the rows, only first X (but note
that for this you need to your data to be sharded correctly or you may
get inaccurate results).

Note, that having lots of processing stages will increase the complexity
of interpreter (it is already not that clean and simple right now).

Although using separate QueryProcessingStage looks pretty natural.

Another option is to make WithMergeableStateAfterAggregation always, but
in this case you will not be able to disable only this optimization,
i.e. if there will be some issue with it.

v2: fix OFFSET
v3: convert 01814_distributed_push_down_limit test to .sh and add retries
v4: add test with OFFSET
v5: add new query stage into the bash completion
v6/tests: use LIMIT O,L syntax over LIMIT L OFFSET O since it is broken in ANTLR parser
          https://clickhouse-test-reports.s3.yandex.net/23027/a18a06399b7aeacba7c50b5d1e981ada5df19745/functional_stateless_tests_(antlr_debug).html#fail1
v7/tests: set use_hedged_requests to 0, to avoid excessive log entries on retries
          https://clickhouse-test-reports.s3.yandex.net/23027/a18a06399b7aeacba7c50b5d1e981ada5df19745/functional_stateless_tests_flaky_check_(address).html#fail1
2021-06-09 02:29:50 +03:00
tavplubix
e9ff0b6d70
Merge pull request #23657 from kssenii/poco-file-to-std-fs
Poco::File to std::filesystem
2021-05-31 23:17:02 +03:00
Nikolai Kochetov
afc1fe7f3d Make ContextPtr const by default. 2021-05-31 17:49:02 +03:00
kssenii
2124113aa2 Update programs/* 2021-05-17 01:06:09 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Alexey Milovidov
b74b76f681 clickhouse-benchmark: add --reconnect option 2021-01-31 12:36:55 +03:00
Azat Khuzhin
5b3ab48861 More forward declaration for generic headers
The following headers are pretty generic, so use forward declaration as
much as possible:
- Context.h
- Settings.h
- ConnectionTimeouts.h
(Also this shows that some missing some includes -- this has been fixed)

And split ConnectionTimeouts.h into ConnectionTimeoutsContext.h (since
module part cannot be added for it, due to recursive build dependencies
that will be introduced)

Also remove Settings from the RemoteBlockInputStream/RemoteQueryExecutor
and just pass the context, since settings was passed only in speicifc
places, that can allow making a copy of Context (i.e. Copier).

Approx results (How much units will be recompiled after changing file X?):

- ConnectionTimeouts.h
  - mainline: 100

- Context.h:
  - mainline: ~800
  - patched:  415

- Settings.h:
  - mainline: 900-1K
  - patched:  440 (most of them because of the Context.h)
2020-12-12 17:43:10 +03:00
Maksim Kita
ee33323d1e Added tests 2020-12-07 11:35:44 +03:00
Maksim Kita
97cfaea182 Clickhouse-benchmark added query parameter 2020-12-06 11:53:02 +03:00
Azat Khuzhin
ab8f13b885 Add --stage option for clickhouse-client
It is sometimes useful to process queries not up to the Complete stage
but intermediate some (i.e. for Distributed queries debugging and
similar).
2020-11-11 00:54:51 +03:00
Azat Khuzhin
0159c74f21 Secure inter-cluster query execution (with initial_user as current query user) [v3]
Add inter-server cluster secret, it is used for Distributed queries
inside cluster, you can configure in the configuration file:

  <remote_servers>
      <logs>
          <shard>
              <secret>foobar</secret> <!-- empty -- works as before -->
              ...
          </shard>
      </logs>
  </remote_servers>

And this will allow clickhouse to make sure that the query was not
faked, and was issued from the node that knows the secret. And since
trust appeared it can use initial_user for query execution, this will
apply correct *_for_user (since with inter-server secret enabled, the
query will be executed from the same user on the shards as on initator,
unlike "default" user w/o it).

v2: Change user to the initial_user for Distributed queries if secret match
v3: Add Protocol::Cluster package
v4: Drop Protocol::Cluster and use plain Protocol::Hello + user marker
v5: Do not use user from Hello for cluster-secure (superfluous)
2020-09-15 01:36:28 +03:00
Azat Khuzhin
4043be3121 Add new query processing stage WithMergeableStateAfterAggregation
Process query until the stage where the aggregate functions were
calculated and finalized.

It will be used for optimize_distributed_group_by_sharding_key.

v2: fix aliases
v3: Fix protocol ABI breakage due to WithMergeableStateAfterAggregation
    Conditions >= for QueryProcessingStage::Enum has been verified, and they
    are ok (in InterpreterSelectQuery).
2020-09-03 00:51:08 +03:00
Alexey Milovidov
1a83546baf Fix build 2020-07-22 08:59:38 +03:00
Alexey Milovidov
e8a3f0abb3 Correct default secure port for clickhouse-benchmark #11044 2020-07-12 21:54:13 +03:00
Alexander Kuzmenkov
ed935cd66b fixup 2020-06-20 02:04:42 +03:00
Alexander Kuzmenkov
96368b7d0c fixup 2020-06-20 02:03:13 +03:00
Alexander Kuzmenkov
fbecf42dfc report the number of errors 2020-06-20 01:41:15 +03:00
Alexander Kuzmenkov
857582245e fixup 2020-06-15 19:39:00 +03:00
Alexander Kuzmenkov
4dc6254357 Merge remote-tracking branch 'origin/master' into HEAD 2020-06-15 17:26:15 +03:00
Alexander Kuzmenkov
c33b472f9a fixup 2020-06-15 17:25:42 +03:00
Alexey Milovidov
07ba7ffea5 Clear password from command line #11624 2020-06-14 22:23:05 +03:00
Alexander Kuzmenkov
56869228a2 add flag to continue on errors 2020-06-12 21:28:07 +03:00
Alexey Milovidov
11c79e1371 Fix JSON in clickhouse-benchmark; add test 2020-06-11 20:53:33 +03:00
Ivan
47ad338cb2
Refactor CMake build files (#11390)
* Get rid of lib_name.cmake
* Refactor Boost and HyperScan libraries
* Refactor lz4
* Fix build with xxHash
2020-06-09 13:54:49 +03:00
Alexey Milovidov
f13ccfc8e8 Progress on task 2020-05-23 22:43:13 +03:00
Alexey Milovidov
f54435e7fd Fix clang-tidy 2020-05-18 11:08:55 +03:00
Nikolai Kochetov
84faa9af26 Merge branch 'master' into shared-context-lifetime 2020-04-17 19:13:13 +03:00
Nikolai Kochetov
d51a9c551b Remove shared_ptr to SharedContext from Context. 2020-04-17 12:47:40 +03:00
Ivan Lezhankin
910ab8a265 Move contrib/libpcg-random → base/pcg-random 2020-04-13 18:42:58 +03:00
Ivan
97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00