Skip to content

Commit 354f848

Browse files
authored
Merge branch 'master' into fix_log_and_concat_ws
2 parents 84e61db + 8289b0a commit 354f848

File tree

4,807 files changed

+1307581
-34144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,807 files changed

+1307581
-34144
lines changed

.asf.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ github:
8282
- Cloud UT (Doris Cloud UT)
8383
- COMPILE (DORIS_COMPILE)
8484
- P0 Regression (Doris Regression)
85+
- NonConcurrent Regression (Doris Regression)
8586
- External Regression (Doris External Regression)
8687
- cloud_p0 (Doris Cloud Regression)
8788
- vault_p0 (Doris Cloud Regression)
@@ -104,6 +105,7 @@ github:
104105
- Cloud UT (Doris Cloud UT)
105106
- COMPILE (DORIS_COMPILE)
106107
- P0 Regression (Doris Regression)
108+
- NonConcurrent Regression (Doris Regression)
107109
- External Regression (Doris External Regression)
108110
- cloud_p0 (Doris Cloud Regression)
109111
- vault_p0 (Doris Cloud Regression)

.github/workflows/build-thirdparty.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
sudo DEBIAN_FRONTEND=noninteractive apt install --yes "${packages[@]}"
121121
122122
mkdir -p "${DEFAULT_DIR}"
123-
wget https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.18/ldb_toolchain_gen.sh \
123+
wget https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.25/ldb_toolchain_gen.sh \
124124
-q -O /tmp/ldb_toolchain_gen.sh
125125
bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
126126
@@ -173,7 +173,7 @@ jobs:
173173
'openjdk@11'
174174
'maven'
175175
'node'
176-
'llvm@16'
176+
'llvm@20'
177177
)
178178
179179
# Install packages except cmake
@@ -231,7 +231,7 @@ jobs:
231231
'openjdk@11'
232232
'maven'
233233
'node'
234-
'llvm@16'
234+
'llvm@20'
235235
)
236236
237237
# Install packages except cmake

.gitmodules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
[submodule ".github/actions/ccache-action"]
1414
path = .github/actions/ccache-action
1515
url = https://github.com/hendrikmuhs/ccache-action
16-
[submodule "be/src/apache-orc"]
17-
path = be/src/apache-orc
18-
url = https://github.com/apache/doris-thirdparty.git
19-
branch = orc
20-
[submodule "be/src/clucene"]
21-
path = be/src/clucene
16+
[submodule "contrib/clucene"]
17+
path = contrib/clucene
2218
url = https://github.com/apache/doris-thirdparty.git
2319
branch = clucene
20+
[submodule "contrib/apache-orc"]
21+
path = contrib/apache-orc
22+
url = https://github.com/apache/doris-thirdparty.git
23+
branch = orc

be/CMakeLists.txt

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ message(STATUS "make benchmark: ${BUILD_BENCHMARK}")
140140
option(BUILD_FS_BENCHMARK "ON for building fs benchmark tool or OFF for not" OFF)
141141
message(STATUS "build fs benchmark tool: ${BUILD_FS_BENCHMARK}")
142142

143+
option(BUILD_TASK_EXECUTOR_SIMULATOR "ON for building task executor simulator or OFF for not" OFF)
144+
message(STATUS "build task executor simulator: ${BUILD_TASK_EXECUTOR_SIMULATOR}")
145+
143146
set(CMAKE_SKIP_RPATH TRUE)
144147
set(Boost_USE_STATIC_LIBS ON)
145148
set(Boost_USE_STATIC_RUNTIME ON)
@@ -194,25 +197,30 @@ SET(SNAPPY_HOME "$ENV{DORIS_THIRDPARTY}/installed")
194197
SET(LZ4_HOME "$ENV{DORIS_THIRDPARTY}/installed")
195198
SET(LZ4_INCLUDE_DIR "$ENV{DORIS_THIRDPARTY}/installed/include/lz4")
196199
SET(ZLIB_HOME "$ENV{DORIS_THIRDPARTY}/installed")
200+
SET(ZLIB_USE_STATIC_LIBS ON)
201+
SET(ZLIB_ROOT "$ENV{DORIS_THIRDPARTY}/installed")
202+
find_package(ZLIB)
197203
SET(ZSTD_HOME "$ENV{DORIS_THIRDPARTY}/installed")
198204
SET(ZSTD_INCLUDE_DIR "$ENV{DORIS_THIRDPARTY}/installed/include/zstd")
205+
SET(CONTRIB_PATH "${PROJECT_SOURCE_DIR}/../contrib")
199206

200-
add_subdirectory(${SRC_DIR}/apache-orc EXCLUDE_FROM_ALL)
207+
# Out of source build need to set the binary dir
208+
add_subdirectory(${CONTRIB_PATH}/apache-orc ${PROJECT_BINARY_DIR}/apache-orc EXCLUDE_FROM_ALL)
201209
target_compile_options(orc PRIVATE -Wno-implicit-fallthrough -w)
202210

203211
option(BUILD_STATIC_LIBRARIES "Build static libraries" ON)
204212
option(BUILD_SHARED_LIBRARIES "Build shared libraries" OFF)
205213
option(BUILD_CONTRIBS_LIB "Build contribs lib" ON)
206214

207215
set(BOOST_ROOT "$ENV{DORIS_THIRDPARTY}/installed")
208-
set(ZLIB_ROOT "$ENV{DORIS_THIRDPARTY}/installed")
209216
set(Roaring_ROOT "$ENV{DORIS_THIRDPARTY}/installed")
210217
set(USE_STAT64 0)
211218

212219
# disable clucene bthread supported.
213220
set(USE_BTHREAD OFF)
214221

215-
add_subdirectory(${SRC_DIR}/clucene EXCLUDE_FROM_ALL)
222+
# Out of source build need to set the binary dir
223+
add_subdirectory(${CONTRIB_PATH}/clucene ${PROJECT_BINARY_DIR}/clucene EXCLUDE_FROM_ALL)
216224

217225
set(clucene_options -w -Wall)
218226
if (COMPILER_CLANG)
@@ -227,7 +235,7 @@ target_compile_options(clucene-contribs-lib PRIVATE ${clucene_options})
227235
target_compile_options(ic PRIVATE ${clucene_options})
228236

229237
install(DIRECTORY
230-
${SRC_DIR}/clucene/src/contribs-lib/CLucene/analysis/jieba/dict
238+
${CONTRIB_PATH}/clucene/src/contribs-lib/CLucene/analysis/jieba/dict
231239
DESTINATION ${OUTPUT_DIR})
232240

233241
install(DIRECTORY
@@ -436,15 +444,15 @@ set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
436444

437445
# Set include dirs
438446
include_directories(
439-
${SRC_DIR}/apache-orc/c++/include
440-
${CMAKE_CURRENT_BINARY_DIR}/src/apache-orc/c++/include
447+
${CONTRIB_PATH}/apache-orc/c++/include
448+
${CMAKE_CURRENT_BINARY_DIR}/apache-orc/c++/include
441449
)
442450

443451
include_directories(
444-
${CMAKE_CURRENT_BINARY_DIR}/src/clucene/src/shared
445-
${SRC_DIR}/clucene/src/core
446-
${SRC_DIR}/clucene/src/shared
447-
${SRC_DIR}/clucene/src/contribs-lib
452+
${CMAKE_CURRENT_BINARY_DIR}/clucene/src/shared
453+
${CONTRIB_PATH}/clucene/src/core
454+
${CONTRIB_PATH}/clucene/src/shared
455+
${CONTRIB_PATH}/clucene/src/contribs-lib
448456
)
449457

450458
include_directories(
@@ -561,11 +569,8 @@ endif()
561569
if (absl_FOUND)
562570
set(COMMON_THIRDPARTY
563571
${COMMON_THIRDPARTY}
564-
absl::flags_internal
565-
absl::flags_reflection
566-
absl::random_internal_pool_urbg
567-
absl::random_internal_randen
568-
absl::random_internal_seed_material
572+
absl::flags
573+
absl::random_random
569574
absl::spinlock_wait
570575
absl::status
571576
absl::statusor
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#pragma once
19+
20+
#include <benchmark/benchmark.h>
21+
22+
#include <random>
23+
#include <vector>
24+
25+
#include "util/frame_of_reference_coding.h"
26+
27+
namespace doris {
28+
29+
// original bit_unpack function
30+
template <typename T>
31+
void bit_unpack(const uint8_t* input, uint8_t in_num, int bit_width, T* output) {
32+
unsigned char in_mask = 0x80;
33+
int bit_index = 0;
34+
while (in_num > 0) {
35+
*output = 0;
36+
for (int i = 0; i < bit_width; i++) {
37+
if (bit_index > 7) {
38+
input++;
39+
bit_index = 0;
40+
}
41+
*output |= ((T)((*input & (in_mask >> bit_index)) >> (7 - bit_index)))
42+
<< (bit_width - i - 1);
43+
bit_index++;
44+
}
45+
output++;
46+
in_num--;
47+
}
48+
}
49+
50+
static void BM_BitUnpack(benchmark::State& state) {
51+
int w = state.range(0);
52+
int n = 255;
53+
54+
std::default_random_engine e;
55+
std::uniform_int_distribution<__int128_t> u;
56+
ForEncoder<__int128_t> encoder(nullptr);
57+
ForDecoder<__int128_t> decoder(nullptr, 0);
58+
std::vector<__int128_t> test_data(n);
59+
__int128_t in_mask = (((__int128_t)1) << w) - 1;
60+
61+
for (int i = 0; i < n; i++) {
62+
test_data[i] = u(e) & in_mask;
63+
}
64+
std::vector<uint8_t> o((n * w + 7) / 8);
65+
encoder.bit_pack(test_data.data(), n, w, o.data());
66+
67+
std::vector<__int128_t> output(n);
68+
69+
for (auto _ : state) {
70+
benchmark::DoNotOptimize(o.data());
71+
benchmark::DoNotOptimize(output.data());
72+
bit_unpack(o.data(), n, w, output.data());
73+
benchmark::ClobberMemory();
74+
}
75+
76+
int64_t size = o.size();
77+
state.SetBytesProcessed(int64_t(state.iterations()) * size);
78+
}
79+
80+
static void BM_BitUnpackOptimized(benchmark::State& state) {
81+
int w = state.range(0);
82+
int n = 255;
83+
84+
std::default_random_engine e;
85+
std::uniform_int_distribution<__int128_t> u;
86+
87+
ForEncoder<__int128_t> encoder(nullptr);
88+
ForDecoder<__int128_t> decoder(nullptr, 0);
89+
std::vector<__int128_t> test_data(n);
90+
__int128_t in_mask = (((__int128_t)1) << w) - 1;
91+
92+
for (int i = 0; i < n; i++) {
93+
test_data[i] = u(e) & in_mask;
94+
}
95+
std::vector<uint8_t> o((n * w + 7) / 8);
96+
encoder.bit_pack(test_data.data(), n, w, o.data());
97+
98+
std::vector<__int128_t> output(n);
99+
100+
for (auto _ : state) {
101+
benchmark::DoNotOptimize(o.data());
102+
benchmark::DoNotOptimize(output.data());
103+
decoder.bit_unpack(o.data(), n, w, output.data());
104+
benchmark::ClobberMemory();
105+
}
106+
107+
int64_t size = o.size();
108+
state.SetBytesProcessed(int64_t(state.iterations()) * size);
109+
}
110+
111+
BENCHMARK(BM_BitUnpack)->DenseRange(1, 127)->Unit(benchmark::kNanosecond);
112+
BENCHMARK(BM_BitUnpackOptimized)->DenseRange(1, 127)->Unit(benchmark::kNanosecond);
113+
} // namespace doris

be/src/agent/cgroup_cpu_ctl.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
namespace doris {
3030

31+
#include "common/compile_check_begin.h"
32+
3133
bool CgroupCpuCtl::is_a_valid_cgroup_path(std::string cg_path) {
3234
if (!cg_path.empty()) {
3335
if (cg_path.back() != '/') {
@@ -214,7 +216,7 @@ Status CgroupCpuCtl::write_cg_sys_file(std::string file_path, std::string value,
214216
}};
215217

216218
auto str = fmt::format("{}\n", value);
217-
int ret = write(fd, str.c_str(), str.size());
219+
ssize_t ret = write(fd, str.c_str(), str.size());
218220
if (ret == -1) {
219221
LOG(ERROR) << msg << " write sys file failed";
220222
return Status::InternalError<false>("{} write sys file failed", msg);
@@ -250,7 +252,7 @@ Status CgroupCpuCtl::delete_unused_cgroup_path(std::set<uint64_t>& used_wg_ids)
250252
struct stat st;
251253
// == 0 means exists
252254
if (stat(dir_name.c_str(), &st) == 0 && (st.st_mode & S_IFDIR)) {
253-
int pos = dir_name.rfind("/");
255+
auto pos = dir_name.rfind("/");
254256
std::string wg_dir_name = dir_name.substr(pos + 1, dir_name.length());
255257
if (wg_dir_name.empty()) {
256258
return Status::InternalError<false>("find an empty workload group path, path={}",
@@ -335,8 +337,8 @@ Status CgroupV1CpuCtl::modify_cg_cpu_soft_limit_no_lock(int cpu_shares) {
335337
}
336338

337339
Status CgroupV1CpuCtl::modify_cg_cpu_hard_limit_no_lock(int cpu_hard_limit) {
338-
int val = cpu_hard_limit > 0 ? (_cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100)
339-
: CGROUP_CPU_HARD_LIMIT_DEFAULT_VALUE;
340+
uint64_t val = cpu_hard_limit > 0 ? (_cpu_cfs_period_us * _cpu_core_num * cpu_hard_limit / 100)
341+
: CGROUP_CPU_HARD_LIMIT_DEFAULT_VALUE;
340342
std::string str_val = std::to_string(val);
341343
std::string msg = "modify cpu quota value to " + str_val;
342344
return CgroupCpuCtl::write_cg_sys_file(_cgroup_v1_cpu_tg_quota_file, str_val, msg, false);
@@ -419,4 +421,6 @@ Status CgroupV2CpuCtl::add_thread_to_cgroup() {
419421
return CgroupCpuCtl::add_thread_to_cgroup(_cgroup_v2_query_wg_thread_file);
420422
}
421423

424+
#include "common/compile_check_end.h"
425+
422426
} // namespace doris

be/src/agent/task_worker_pool.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
#include "util/trace.h"
101101

102102
namespace doris {
103+
#include "common/compile_check_begin.h"
103104
using namespace ErrorCode;
104105

105106
namespace {
@@ -180,7 +181,7 @@ Status get_tablet_info(StorageEngine& engine, const TTabletId tablet_id,
180181
}
181182

182183
void random_sleep(int second) {
183-
Random rnd(UnixMillis());
184+
Random rnd(static_cast<uint32_t>(UnixMillis()));
184185
sleep(rnd.Uniform(second) + 1);
185186
}
186187

@@ -626,13 +627,13 @@ Status PriorTaskWorkerPool::submit_high_prior_and_cancel_low(const TAgentTaskReq
626627
// If it doesn't exist, put it directly into the priority queue
627628
add_task_count(*req, 1);
628629
set.insert(signature);
629-
std::lock_guard lock(_mtx);
630+
std::lock_guard temp_lock(_mtx);
630631
_high_prior_queue.push_back(std::move(req));
631632
_high_prior_condv.notify_one();
632633
_normal_condv.notify_one();
633634
break;
634635
} else {
635-
std::lock_guard lock(_mtx);
636+
std::lock_guard temp_lock(_mtx);
636637
for (auto it = _normal_queue.begin(); it != _normal_queue.end();) {
637638
// If it exists in the normal queue, cancel the task in the normal queue
638639
if ((*it)->signature == signature) {
@@ -1613,7 +1614,7 @@ void create_tablet_callback(StorageEngine& engine, const TAgentTaskRequest& req)
16131614
MonotonicStopWatch watch;
16141615
watch.start();
16151616
SCOPED_CLEANUP({
1616-
auto elapsed_time = static_cast<int64_t>(watch.elapsed_time());
1617+
auto elapsed_time = static_cast<double>(watch.elapsed_time());
16171618
if (elapsed_time / 1e9 > config::agent_task_trace_threshold_sec) {
16181619
COUNTER_UPDATE(profile->total_time_counter(), elapsed_time);
16191620
std::stringstream ss;
@@ -1739,21 +1740,20 @@ void drop_tablet_callback(CloudStorageEngine& engine, const TAgentTaskRequest& r
17391740
count++;
17401741
}
17411742

1742-
CloudTablet::recycle_cached_data(std::move(clean_rowsets));
1743+
CloudTablet::recycle_cached_data(clean_rowsets);
17431744
break;
17441745
}
17451746

17461747
if (!found) {
17471748
LOG(WARNING) << "tablet not found when dropping tablet_id=" << drop_tablet_req.tablet_id
1748-
<< ", cost " << static_cast<int64_t>(watch.elapsed_time()) / 1e9 << "(s)";
1749+
<< ", cost " << static_cast<double>(watch.elapsed_time()) / 1e9 << "(s)";
17491750
return;
17501751
}
17511752

17521753
engine.tablet_mgr().erase_tablet(drop_tablet_req.tablet_id);
17531754
LOG(INFO) << "drop cloud tablet_id=" << drop_tablet_req.tablet_id
17541755
<< " and clean file cache first 10 rowsets {" << rowset_ids_stream.str() << "}, cost "
1755-
<< static_cast<int64_t>(watch.elapsed_time()) / 1e9 << "(s)";
1756-
return;
1756+
<< static_cast<double>(watch.elapsed_time()) / 1e9 << "(s)";
17571757
}
17581758

17591759
void push_callback(StorageEngine& engine, const TAgentTaskRequest& req) {
@@ -1964,7 +1964,7 @@ void PublishVersionWorkerPool::publish_version_callback(const TAgentTaskRequest&
19641964
}
19651965
}
19661966
}
1967-
uint32_t cost_second = time(nullptr) - req.recv_time;
1967+
int64_t cost_second = time(nullptr) - req.recv_time;
19681968
g_publish_version_latency << cost_second;
19691969
LOG_INFO("successfully publish version")
19701970
.tag("signature", req.signature)
@@ -2254,4 +2254,5 @@ void report_index_policy_callback(const ClusterInfo* cluster_info) {
22542254
}
22552255
}
22562256

2257+
#include "common/compile_check_end.h"
22572258
} // namespace doris

0 commit comments

Comments
 (0)