Skip to content

Commit 957e19c

Browse files
committed
Merge 'master' into ncb/fix-client-replxx-crash
2 parents 5a61e8e + 9cad25b commit 957e19c

File tree

18 files changed

+244
-86
lines changed

18 files changed

+244
-86
lines changed

CHANGELOG.md

Lines changed: 54 additions & 58 deletions
Large diffs are not rendered by default.

contrib/curl

Submodule curl updated 1311 files

contrib/curl-cmake/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ set (SRCS
8181
"${LIBRARY_DIR}/lib/idn.c"
8282
"${LIBRARY_DIR}/lib/if2ip.c"
8383
"${LIBRARY_DIR}/lib/imap.c"
84-
"${LIBRARY_DIR}/lib/inet_ntop.c"
8584
"${LIBRARY_DIR}/lib/krb5.c"
8685
"${LIBRARY_DIR}/lib/ldap.c"
8786
"${LIBRARY_DIR}/lib/llist.c"
@@ -148,13 +147,12 @@ set (SRCS
148147
"${LIBRARY_DIR}/lib/vauth/oauth2.c"
149148
"${LIBRARY_DIR}/lib/vauth/spnego_gssapi.c"
150149
"${LIBRARY_DIR}/lib/vauth/spnego_sspi.c"
151-
"${LIBRARY_DIR}/lib/vauth/vauth.c"
150+
"${LIBRARY_DIR}/lib/vauth/vauth.c"
152151
"${LIBRARY_DIR}/lib/vquic/vquic.c"
153152
"${LIBRARY_DIR}/lib/vssh/curl_path.c"
154153
"${LIBRARY_DIR}/lib/vssh/libssh.c"
155154
"${LIBRARY_DIR}/lib/vssh/libssh2.c"
156155

157-
"${LIBRARY_DIR}/lib/vtls/bearssl.c"
158156
"${LIBRARY_DIR}/lib/vtls/cipher_suite.c"
159157
"${LIBRARY_DIR}/lib/vtls/gtls.c"
160158
"${LIBRARY_DIR}/lib/vtls/hostcheck.c"
@@ -165,14 +163,14 @@ set (SRCS
165163
"${LIBRARY_DIR}/lib/vtls/rustls.c"
166164
"${LIBRARY_DIR}/lib/vtls/schannel.c"
167165
"${LIBRARY_DIR}/lib/vtls/schannel_verify.c"
168-
"${LIBRARY_DIR}/lib/vtls/sectransp.c"
169166
"${LIBRARY_DIR}/lib/vtls/vtls.c"
170167
"${LIBRARY_DIR}/lib/vtls/vtls_scache.c"
171168
"${LIBRARY_DIR}/lib/vtls/vtls_spack.c"
172169
"${LIBRARY_DIR}/lib/vtls/wolfssl.c"
173170
"${LIBRARY_DIR}/lib/vtls/x509asn1.c"
174171
"${LIBRARY_DIR}/lib/curlx/base64.c"
175172
"${LIBRARY_DIR}/lib/curlx/dynbuf.c"
173+
"${LIBRARY_DIR}/lib/curlx/inet_ntop.c"
176174
"${LIBRARY_DIR}/lib/curlx/inet_pton.c"
177175
"${LIBRARY_DIR}/lib/curlx/multibyte.c"
178176
"${LIBRARY_DIR}/lib/curlx/nonblock.c"
@@ -181,6 +179,7 @@ set (SRCS
181179
"${LIBRARY_DIR}/lib/curlx/timeval.c"
182180
"${LIBRARY_DIR}/lib/curlx/version_win32.c"
183181
"${LIBRARY_DIR}/lib/curlx/warnless.c"
182+
"${LIBRARY_DIR}/lib/curlx/wait.c"
184183
"${LIBRARY_DIR}/lib/curlx/winapi.c"
185184
)
186185

contrib/curl-cmake/curl_config.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define HAVE_GETADDRINFO
1717
#define HAVE_LONGLONG
1818
#define HAVE_POLL_FINE
19+
#define HAVE_SELECT
1920
#define HAVE_SIGACTION
2021
#define HAVE_SIGNAL
2122
#define HAVE_SIGSETJMP
@@ -44,8 +45,9 @@
4445
#define HAVE_FCNTL_H
4546
#define HAVE_NETDB_H
4647
#define HAVE_NETINET_IN_H
48+
#define HAVE_SELECT_H
49+
#define HAVE_SETJMP_H
4750
#define HAVE_SETJMP_H
48-
#define HAVE_SYS_STAT_H
4951
#define HAVE_UNISTD_H
5052
#define HAVE_POLL_H
5153
#define HAVE_PTHREAD_H

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
contrib-aws-c-event-stream = { url = "github:awslabs/aws-c-event-stream/08f24e384e5be20bcffa42b49213d24dad7881ae"; flake = false; };
143143
contrib-aws-c-common = { url = "github:awslabs/aws-c-common/80f21b3cac5ac51c6b8a62c7d2a5ef58a75195ee"; flake = false; };
144144
contrib-aws-checksums = { url = "github:awslabs/aws-checksums/321b805559c8e911be5bddba13fcbd222a3e2d3a"; flake = false; };
145-
contrib-curl = { url = "github:curl/curl/4dacb79fcdd9364c1083e06f6a011d797a344f47"; flake = false; };
145+
contrib-curl = { url = "github:curl/curl/cfbfb65047e85e6b08af65fe9cdbcf68e9ad496a"; flake = false; };
146146
contrib-icudata = { url = "github:ClickHouse/icudata/cfc05b4c3140ff2be84291b80de8c62b1e42d0da"; flake = false; };
147147
contrib-icu = { url = "github:ClickHouse/icu/4216173eeeb39c1d4caaa54a68860e800412d273"; flake = false; };
148148
contrib-flatbuffers = { url = "github:ClickHouse/flatbuffers/0100f6a5779831fa7a651e4b67ef389a8752bd9b"; flake = false; };

programs/server/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>ClickHouse Dashboard</title>
6-
<link rel="icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDkgOCI+PHN0eWxlPi5ve2ZpbGw6I2ZjMH0ucntmaWxsOnJlZH08L3N0eWxlPjxwYXRoIGQ9Ik0wLDcgaDEgdjEgaC0xIHoiIGNsYXNzPSJyIi8+PHBhdGggZD0iTTAsMCBoMSB2NyBoLTEgeiIgY2xhc3M9Im8iLz48cGF0aCBkPSJNMiwwIGgxIHY4IGgtMSB6IiBjbGFzcz0ibyIvPjxwYXRoIGQ9Ik00LDAgaDEgdjggaC0xIHoiIGNsYXNzPSJvIi8+PHBhdGggZD0iTTYsMCBoMSB2OCBoLTEgeiIgY2xhc3M9Im8iLz48cGF0aCBkPSJNOCwzLjI1IGgxIHYxLjUgaC0xIHoiIGNsYXNzPSJvIi8+PC9zdmc+">
6+
<link rel="icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDExIDEwIj48c3R5bGU+LmJne2ZpbGw6IzAwMH0ub3tmaWxsOiNmZjB9PC9zdHlsZT48cmVjdCBjbGFzcz0iYmciIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiLz48cGF0aCBkPSJNMSwxIGgxIHY4IGgtMSB6IiBjbGFzcz0ibyIvPjxwYXRoIGQ9Ik0zLDEgaDEgdjggaC0xIHoiIGNsYXNzPSJvIi8+PHBhdGggZD0iTTUsMSBoMSB2OCBoLTEgeiIgY2xhc3M9Im8iLz48cGF0aCBkPSJNNywxIGgxIHY4IGgtMSB6IiBjbGFzcz0ibyIvPjxwYXRoIGQ9Ik05LDQuMjUgaDEgdjEuNSBoLTEgeiIgY2xhc3M9Im8iLz48L3N2Zz4">
77
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/uPlot.iife.min.js"></script>
88
<script src="https://cdn.jsdelivr.net/npm/[email protected]/libs/lz-string.min.js"></script>
99
<style>

programs/server/play.html

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,15 @@
707707
color: var(--misc-text-color);
708708
}
709709

710+
/* Prevents a different color when Chromium auto-fills inputs from the list. */
711+
input:-webkit-autofill,
712+
input:-webkit-autofill:hover,
713+
input:-webkit-autofill:focus,
714+
input:-webkit-autofill:active
715+
{
716+
transition: background-color 600000s 0s, color 600000s 0s;
717+
}
718+
710719
/* This is for charts (uPlot), Copyright (c) 2022 Leon Sorokin, MIT License, https://github.com/leeoniya/uPlot/ */
711720
.u-wrap {position: relative;user-select: none;}
712721
.u-over, .u-under, .u-axis {position: absolute;}
@@ -749,21 +758,21 @@
749758
</div>
750759
</div>
751760
<div id="main">
752-
<div id="controls">
761+
<form id="controls">
753762
<div id="inputs">
754-
<input spellcheck="false" class="monospace shadow" id="url" type="text" value="http://localhost:8123/" placeholder="url" /><span id="url_status"><span id="server_info"></span></span><input spellcheck="false" class="monospace shadow" id="user" type="text" value="default" placeholder="user" /><input class="monospace shadow" id="password" type="password" placeholder="password" />
763+
<input name="url" spellcheck="false" class="monospace shadow" id="url" type="url" value="" placeholder="url" /><span id="url_status"><span id="server_info"></span></span><input name="user" spellcheck="false" class="monospace shadow" id="user" type="text" value="default" placeholder="user" /><input name="password" class="monospace shadow" id="password" type="password" placeholder="password" />
755764
</div>
756765
<div id="query_div"><textarea autofocus spellcheck="false" autocorrect="false" autocomplete="false" data-gramm="false" class="monospace shadow" id="query"></textarea></div>
757766
<div id="run_div">
758-
<button class="shadow" id="run">Run</button>
767+
<button type="submit" class="shadow" id="run">Run</button>
759768
<div id="hint">&nbsp;(Ctrl/Cmd+Enter)</div>
760769
<div id="hourglass"></div>
761770
<div id="check-mark"></div>
762771
<div id="progress"></div>
763772
<div id="stats"></div>
764773
<div id="theme"><span id="toggle-dark">🌘</span><span id="toggle-light">☀️</span></div>
765774
</div>
766-
</div>
775+
</form>
767776
<div id="data_div">
768777
<table class="monospace shadow" id="data-table"></table>
769778
<pre class="monospace shadow" id="data-unparsed"></pre>
@@ -804,12 +813,16 @@
804813
let user_elem = document.getElementById('user');
805814
let password_elem = document.getElementById('password');
806815

807-
const server_address = current_url.searchParams.get('url');
808-
if (server_address) {
809-
url_elem.value = server_address;
810-
} else if (!opened_locally) {
811-
/// Substitute the address of the server where the page is served.
812-
url_elem.value = location.origin;
816+
if (url_elem.value == '') {
817+
const server_address = current_url.searchParams.get('url');
818+
if (server_address) {
819+
url_elem.value = server_address;
820+
} else if (!opened_locally) {
821+
/// Substitute the address of the server where the page is served.
822+
url_elem.value = location.origin;
823+
} else {
824+
url_elem.value = 'http://localhost:8123/';
825+
}
813826
}
814827

815828
/// Substitute username if it's specified in the query string
@@ -1364,19 +1377,27 @@
13641377
document.getElementById('run').innerText = 'Run';
13651378
}
13661379

1367-
document.getElementById('run').onclick = function(e)
1380+
document.getElementById('controls').addEventListener('submit', e =>
13681381
{
1382+
e.preventDefault();
13691383
if (in_flight) {
13701384
cancel();
13711385
} else {
13721386
post();
1387+
1388+
const cred = new PasswordCredential({
1389+
id: user_elem.value,
1390+
password: password_elem.value,
1391+
name: url_elem.value,
1392+
});
1393+
navigator.credentials.store(cred);
13731394
}
1374-
}
1395+
});
13751396

13761397
document.addEventListener('keydown', event => {
13771398
/// Firefox has code 13 for Enter and Chromium has code 10.
13781399
if ((event.metaKey || event.ctrlKey) && (event.keyCode == 13 || event.keyCode == 10)) {
1379-
post();
1400+
document.getElementById('controls').requestSubmit();
13801401
}
13811402
});
13821403

src/Interpreters/HashJoin/ScatteredBlock.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,14 @@ struct ScatteredBlock : private boost::noncopyable
269269
chassert(rows() == filter.size());
270270
IndexesPtr new_selector = Indexes::create();
271271
new_selector->reserve(selector.size());
272-
std::copy_if(
273-
selector.begin(), selector.end(), std::back_inserter(new_selector->getData()), [&](size_t idx) { return filter[idx]; });
272+
auto & new_selector_data = new_selector->getData();
273+
size_t i = 0;
274+
for (auto it = selector.begin(); it != selector.end(); ++it, ++i)
275+
{
276+
chassert(i < filter.size());
277+
if (filter[i])
278+
new_selector_data.push_back(*it);
279+
}
274280
selector = Selector(std::move(new_selector));
275281
}
276282

src/Storages/ObjectStorageQueue/ObjectStorageQueueSettings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ namespace ErrorCodes
3939
DECLARE(UInt32, cleanup_interval_max_ms, 60000, "For unordered mode. Polling backoff max for cleanup", 0) \
4040
DECLARE(UInt64, buckets, 0, "Number of buckets for Ordered mode parallel processing", 0) \
4141
DECLARE(UInt64, list_objects_batch_size, 1000, "Size of a list batch in object storage", 0) \
42+
DECLARE(UInt64, min_insert_block_size_rows_for_materialized_views, 0, "Override for profile setting min_insert_block_size_rows_for_materialized_views", 0) \
43+
DECLARE(UInt64, min_insert_block_size_bytes_for_materialized_views, 0, "Override for profile setting min_insert_block_size_bytes_for_materialized_views", 0) \
4244
DECLARE(Bool, enable_hash_ring_filtering, 0, "Enable filtering files among replicas according to hash ring for Unordered mode", 0) \
4345
DECLARE(UInt64, max_processed_files_before_commit, 100, "Number of files which can be processed before being committed to keeper (in case of parallel_inserts=true, works on a per-thread basis)", 0) \
4446
DECLARE(UInt64, max_processed_rows_before_commit, 0, "Number of rows which can be processed before being committed to keeper (in case of parallel_inserts=true, works on a per-thread basis)", 0) \

src/Storages/ObjectStorageQueue/StorageObjectStorageQueue.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ namespace ObjectStorageQueueSetting
9696
extern const ObjectStorageQueueSettingsObjectStorageQueueAction after_processing;
9797
extern const ObjectStorageQueueSettingsUInt64 list_objects_batch_size;
9898
extern const ObjectStorageQueueSettingsBool enable_hash_ring_filtering;
99+
extern const ObjectStorageQueueSettingsUInt64 min_insert_block_size_rows_for_materialized_views;
100+
extern const ObjectStorageQueueSettingsUInt64 min_insert_block_size_bytes_for_materialized_views;
99101
}
100102

101103
namespace ErrorCodes
@@ -189,6 +191,8 @@ StorageObjectStorageQueue::StorageObjectStorageQueue(
189191
.max_processed_bytes_before_commit = (*queue_settings_)[ObjectStorageQueueSetting::max_processed_bytes_before_commit],
190192
.max_processing_time_sec_before_commit = (*queue_settings_)[ObjectStorageQueueSetting::max_processing_time_sec_before_commit],
191193
})
194+
, min_insert_block_size_rows_for_materialized_views((*queue_settings_)[ObjectStorageQueueSetting::min_insert_block_size_rows_for_materialized_views])
195+
, min_insert_block_size_bytes_for_materialized_views((*queue_settings_)[ObjectStorageQueueSetting::min_insert_block_size_bytes_for_materialized_views])
192196
, configuration{configuration_}
193197
, format_settings(format_settings_)
194198
, reschedule_processing_interval_ms((*queue_settings_)[ObjectStorageQueueSetting::polling_min_timeout_ms])
@@ -603,6 +607,18 @@ bool StorageObjectStorageQueue::streamToViews(size_t streaming_tasks_index)
603607
auto queue_context = Context::createCopy(getContext());
604608
queue_context->makeQueryContext();
605609

610+
size_t min_insert_block_size_rows;
611+
size_t min_insert_block_size_bytes;
612+
{
613+
std::lock_guard lock(mutex);
614+
min_insert_block_size_rows = min_insert_block_size_rows_for_materialized_views;
615+
min_insert_block_size_bytes = min_insert_block_size_bytes_for_materialized_views;
616+
}
617+
if (min_insert_block_size_rows)
618+
queue_context->setSetting("min_insert_block_size_rows_for_materialized_views", min_insert_block_size_rows);
619+
if (min_insert_block_size_bytes)
620+
queue_context->setSetting("min_insert_block_size_bytes_for_materialized_views", min_insert_block_size_bytes);
621+
606622
std::shared_ptr<StorageObjectStorageQueue::FileIterator> file_iterator;
607623
{
608624
std::lock_guard streaming_lock(streaming_mutex);
@@ -803,6 +819,8 @@ static const std::unordered_set<std::string_view> changeable_settings_unordered_
803819
"max_processing_time_sec_before_commit",
804820
"enable_hash_ring_filtering",
805821
"list_objects_batch_size",
822+
"min_insert_block_size_rows_for_materialized_views",
823+
"min_insert_block_size_bytes_for_materialized_views",
806824
};
807825

808826
static const std::unordered_set<std::string_view> changeable_settings_ordered_mode
@@ -818,6 +836,8 @@ static const std::unordered_set<std::string_view> changeable_settings_ordered_mo
818836
"max_processing_time_sec_before_commit",
819837
"buckets",
820838
"list_objects_batch_size",
839+
"min_insert_block_size_rows_for_materialized_views",
840+
"min_insert_block_size_bytes_for_materialized_views",
821841
};
822842

823843
static std::string normalizeSetting(const std::string & name)
@@ -1077,6 +1097,11 @@ void StorageObjectStorageQueue::alter(
10771097
if (change.name == "max_processing_time_sec_before_commit")
10781098
commit_settings.max_processing_time_sec_before_commit = change.value.safeGet<UInt64>();
10791099

1100+
if (change.name == "min_insert_block_size_rows_for_materialized_views")
1101+
min_insert_block_size_rows_for_materialized_views = change.value.safeGet<UInt64>();
1102+
if (change.name == "min_insert_block_size_bytes_for_materialized_views")
1103+
min_insert_block_size_bytes_for_materialized_views = change.value.safeGet<UInt64>();
1104+
10801105
if (change.name == "list_objects_batch_size")
10811106
list_objects_batch_size = change.value.safeGet<UInt64>();
10821107
if (change.name == "enable_hash_ring_filtering")
@@ -1166,6 +1191,8 @@ ObjectStorageQueueSettings StorageObjectStorageQueue::getSettings() const
11661191
settings[ObjectStorageQueueSetting::max_processing_time_sec_before_commit] = commit_settings.max_processing_time_sec_before_commit;
11671192
settings[ObjectStorageQueueSetting::enable_hash_ring_filtering] = enable_hash_ring_filtering;
11681193
settings[ObjectStorageQueueSetting::list_objects_batch_size] = list_objects_batch_size;
1194+
settings[ObjectStorageQueueSetting::min_insert_block_size_rows_for_materialized_views] = min_insert_block_size_rows_for_materialized_views;
1195+
settings[ObjectStorageQueueSetting::min_insert_block_size_bytes_for_materialized_views] = min_insert_block_size_bytes_for_materialized_views;
11691196
}
11701197

11711198
return settings;

0 commit comments

Comments
 (0)