Commit Graph

2761 Commits

Author SHA1 Message Date
Robert Schulze
e0d5020a92
Add simple versioning to the *-bridge-to-server protocol
- In general, it is expected that clickhouse-*-bridges and
  clickhouse-server were build from the same source version (e.g. are
  upgraded "atomically"). If that is not the case, we should at least
  be able to detect the mismatch and abort.

- This commit adds a URL parameter "version", defined in a header shared
  by the server and bridges. The bridge returns an error in case of
  mismatch.

- The version is *not* send and checked for "ping" requests (used for
  handshake), only for regular requests send after handshake. This is
  because the internally thrown server-side exception due to HTTP
  failure does not propagate the exact HTTP error (it only stores the
  error as text), and as a result, the server-side handshake code
  simply retries in case of error with exponential backoff and finally
  fails with a "timeout error". This is reasonable as pings typically
  fail due to time out. However, without a rework of HTTP exceptions,
  version mismatch during ping would also appear as "timeout" which is
  too misleading. The behavior may be changed later if needed.

- Note that introducing a version parameter does not represent a
  protocol upgrade itself. Bridges older than the server will simply
  ignore the field. Only servers older than the bridges receive an error
  but such a situation should never occur in practice.
2022-08-08 19:40:37 +00:00
Robert Schulze
9952ab1099
Prefix class names "LibraryBridge*Handler" with "ExternalDictionary"
- necessary to disambiguate the names from "CatBoost"-"LibraryBridgeHandler"
  which will be added in a next step
2022-08-08 17:16:46 +00:00
Robert Schulze
ad0d060dc1
Merge pull request #39904 from ClickHouse/library-bridge-refactoring
Prepare library-bridge for catboost integration
2022-08-08 12:15:01 +02:00
Alexey Milovidov
64a1b0f2b8 Play UI: row numbers; cell selection; hysteresis 2022-08-08 04:25:03 +02:00
Alexey Milovidov
653b86d1e6 Play UI: row numbers; cell selection; hysteresis 2022-08-08 04:16:50 +02:00
Alexey Milovidov
2d83635643 Play UI: row numbers; cell selection; hysteresis 2022-08-08 03:57:02 +02:00
Alexey Milovidov
d914ddc766 Fix Play UI 2022-08-08 02:36:50 +02:00
Yakov Olkhovskiy
29622746ea
Merge pull request #39936 from ClickHouse/cmake-fix-self-extracting-split
Don't create self-extracting clickhouse for split build
2022-08-07 07:23:24 -04:00
Yakov Olkhovskiy
b1f45fa787 Don't create self-extracting clickhouse for split build 2022-08-05 21:48:40 -04:00
Alexey Milovidov
ac93f0a2ca
Merge pull request #39910 from santrancisco/enhance-playui-authentication
Move username and password from URL parameters to Basic Authentication
2022-08-06 01:58:09 +03:00
santrancisco
c7f0598a6f Fall back to url parameters if file is opened locally 2022-08-05 13:10:45 +10:00
santrancisco
a25b858097 Move username and password from URL parameter to Basic Authentication header 2022-08-05 09:51:12 +10:00
Robert Schulze
20bb8a248e
Prepare server-side BridgeHelper for catboost integration
Wall of text, sorry, but I also had to document some stuff for myself:

There are three ways to communicate data using HTTP:
- the HTTP verb: for our purposes, PUT and GET,
- the HTTP path: '/ping', '/request' etc.,
- the HTTP URL parameter(s), e.g. 'method=libNew&dictionary_id=1234'

The bridge will use different handlers for communication with the
external dictionary library and for communication with the catboost
library. Handlers are created based on a combination of the HTTP verb
and the HTTP method. More specifically, there will be combinations
- GET + '/extdict_ping'
- PUT + '/extdict_request'
- GET + '/catboost_ping'
- PUT + '/catboost_request'.
For each combination, the bridge expects a certain set of URL
parameters, e.g. for the first combination parameter "dictionary_id" is
expected.

Starting with this commit, the library-bridge creates handlers based on
the first two combinations (the latter two combinations will be added
later). This makes the handler creation mechanism consistent with it's
counterpart in xdbc-bridge.

For that, it was necessary to make both IBridgeHelper methods
"getMainURI()" and "getPingURI()" pure virtual so that derived classes
(LibraryBridgeHelper and XDBCBridgeHelper) must provide custom URLs with
custom paths.

Side note 1: Previously, LibraryBridgeHelper sent HTTP URL parameter
"method=ping" during handshake (PING) but the library-bridge ignored
that parameter. We now omit this parameter, i.e.
LibraryBridgeHelper::PING was removed. Again, this makes things
consistent with xdbc-bridge.

Side note 2: xdbc-bridge is unchanged in this commit. Therefore,
XDBCBridgeHelper now uses the HTTP paths previously in the base class.
For funny reason, XDBCBridgeHelper did not use
IBridgeHelper::getMainURI() - it generates the URLs by itself. I kept it
that way for now but provided an implementation of getMainURI() anyways.
2022-08-04 19:29:51 +00:00
Robert Schulze
ea73b98fb9
Prepare library-bridge for catboost integration
- Rename generic file and identifier names in library-bridge to
  something more dictionary-specific. This is needed because later on,
  catboost will be integrated into library-bridge.

- Also: Some smaller fixes like typos and un-inlining non-performance
  critical code.

- The logic remains unchanged in this commit.
2022-08-04 19:26:51 +00:00
Alexey Milovidov
834cbbedce
Merge branch 'master' into escape_diag_creds 2022-08-04 01:59:50 +03:00
Alexey Milovidov
5f62863ab9
Merge branch 'master' into escape_diag_creds 2022-08-02 05:50:01 +03:00
Heena Bansal
d8db482b2e
Merge branch 'master' into Issue_39395 2022-08-01 12:22:16 -04:00
Robert Schulze
bf574b9154
Merge pull request #39760 from ClickHouse/bit-fiddling
Use std::popcount, ::countl_zero, ::countr_zero functions
2022-08-01 17:04:51 +02:00
HeenaBansal2009
50c98789b8 Updated as per comments 2022-08-01 07:05:50 -07:00
HeenaBansal2009
800ed546be Updated as per comments 2022-08-01 07:03:36 -07:00
Ilya Yatsishin
c882bdc88e
Merge pull request #35968 from ClickHouse/interserver_listen_port 2022-08-01 13:57:17 +02:00
Alexander Tokmakov
80f9ba9186
Merge pull request #39690 from ClickHouse/show-addresses-in-stack-traces
Configuration parameter to hide addresses in stack traces
2022-08-01 14:20:37 +03:00
Alexey Milovidov
6a2f7d0c8f
Merge branch 'master' into interserver_listen_port 2022-07-31 22:51:38 +03:00
Alexey Milovidov
ebc4974188
Merge branch 'master' into escape_diag_creds 2022-07-31 22:46:10 +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
Robert Schulze
dcc8751685
Disable harmful env var check to workaround failure to start the server 2022-07-31 08:55:07 +00:00
Robert Schulze
7c23e48b5b
Revert exclusion of libharmful (did not work anyways) 2022-07-31 08:05:12 +00:00
Robert Schulze
7fe106a0fb
Try to fix libharmful fail 2022-07-31 07:44:25 +00:00
Alexey Milovidov
fa9c3dcc48
Update programs/local/LocalServer.cpp
Co-authored-by: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com>
2022-07-31 03:02:27 +03:00
Alexey Milovidov
a30dbed6b8
Update programs/local/LocalServer.cpp
Co-authored-by: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com>
2022-07-31 03:02:20 +03:00
Alexey Milovidov
f80a4c184e
Merge branch 'master' into interserver_listen_port 2022-07-31 01:22:32 +03:00
Alexey Milovidov
9adfd259d0 Support in clickhouse-local 2022-07-30 01:50:45 +02:00
Alexey Milovidov
c0d7b6efc3 Suggestions from @tavplubix 2022-07-30 01:45:06 +02:00
Alexey Milovidov
4aa96767d5 Merge branch 'master' of github.com:ClickHouse/ClickHouse into show-addresses-in-stack-traces 2022-07-30 01:44:04 +02:00
Robert Schulze
3d1797f75f
Merge remote-tracking branch 'origin/master' into no-split-binary 2022-07-29 12:17:43 +00:00
Dale Mcdiarmid
d9c585ecf1 Escape credentials for diagnostics tool 2022-07-29 12:25:03 +01:00
Azat Khuzhin
b90152b6ec Fix clickhouse-su building in splitted build
- Add status log message
- Add it to clickhouse-bundle in shared build
- Move clickhouse-su.cpp into su.cpp, since executable does not have
  include directories of linked libraries (dbms here), only
  clickhouse-lib-su does, hence it cannot find includes

CI: https://github.com/ClickHouse/ClickHouse/runs/7566319416?check_suite_focus=true
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-29 11:36:51 +03:00
Alexey Milovidov
552b517e59 Allow to hide addresses in stack traces 2022-07-29 00:13:02 +02:00
Robert Schulze
199e254777
Merge remote-tracking branch 'origin/master' into no-split-binary 2022-07-28 15:54:22 +00:00
Sergei Trifonov
4588e146a6
Merge pull request #37285 from arenadata/ADQM-445
Add concurrent_threads_soft_limit parameter
2022-07-28 11:46:43 +02:00
Roman Vasin
f35349eb08 Rename total_max_threads to concurrent_threads_soft_limit 2022-07-28 07:46:20 +00:00
Roman Vasin
37845389c8 Merge branch 'concurrency-control' of github.com:ClickHouse/ClickHouse into ADQM-445 2022-07-27 13:31:22 +00:00
Antonio Andelic
e62526720f Address PR comments 2022-07-27 07:51:30 +00:00
Antonio Andelic
35b61cc94e Merge branch 'master' into keeper-version-check 2022-07-26 07:47:57 +00:00
Alexey Milovidov
75d0232265
Merge pull request #39541 from ClickHouse/obfuscator-save-load
Add save/load capabilities to Obfuscator
2022-07-25 21:18:28 +03:00
Yakov Olkhovskiy
d0f5dcad25
Merge pull request #38936 from ClickHouse/cmake-self-extracting-executable
Build self-extracting-executable utils
2022-07-25 08:13:25 -04:00
Alexey Milovidov
1f4e7ea34c Add a test 2022-07-25 05:37:07 +02:00
Alexey Milovidov
dde89c9606 Fix errors 2022-07-25 03:56:32 +02:00
Alexey Milovidov
68f5a397d7 Fix errors 2022-07-25 03:49:09 +02:00
Alexey Milovidov
52ad48d1ba Better documentation 2022-07-25 03:32:01 +02:00