Skip to content

Commit 7db28e8

Browse files
Merge branch 'apache:master' into s4
2 parents 13e0953 + 349a0b6 commit 7db28e8

File tree

461 files changed

+20228
-6962
lines changed

Some content is hidden

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

461 files changed

+20228
-6962
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)

.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: 15 additions & 9 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)
@@ -196,8 +199,10 @@ SET(LZ4_INCLUDE_DIR "$ENV{DORIS_THIRDPARTY}/installed/include/lz4")
196199
SET(ZLIB_HOME "$ENV{DORIS_THIRDPARTY}/installed")
197200
SET(ZSTD_HOME "$ENV{DORIS_THIRDPARTY}/installed")
198201
SET(ZSTD_INCLUDE_DIR "$ENV{DORIS_THIRDPARTY}/installed/include/zstd")
202+
SET(CONTRIB_PATH "${PROJECT_SOURCE_DIR}/../contrib")
199203

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

203208
option(BUILD_STATIC_LIBRARIES "Build static libraries" ON)
@@ -212,7 +217,8 @@ set(USE_STAT64 0)
212217
# disable clucene bthread supported.
213218
set(USE_BTHREAD OFF)
214219

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

217223
set(clucene_options -w -Wall)
218224
if (COMPILER_CLANG)
@@ -227,7 +233,7 @@ target_compile_options(clucene-contribs-lib PRIVATE ${clucene_options})
227233
target_compile_options(ic PRIVATE ${clucene_options})
228234

229235
install(DIRECTORY
230-
${SRC_DIR}/clucene/src/contribs-lib/CLucene/analysis/jieba/dict
236+
${CONTRIB_PATH}/clucene/src/contribs-lib/CLucene/analysis/jieba/dict
231237
DESTINATION ${OUTPUT_DIR})
232238

233239
install(DIRECTORY
@@ -436,15 +442,15 @@ set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
436442

437443
# Set include dirs
438444
include_directories(
439-
${SRC_DIR}/apache-orc/c++/include
440-
${CMAKE_CURRENT_BINARY_DIR}/src/apache-orc/c++/include
445+
${CONTRIB_PATH}/apache-orc/c++/include
446+
${CMAKE_CURRENT_BINARY_DIR}/apache-orc/c++/include
441447
)
442448

443449
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
450+
${CMAKE_CURRENT_BINARY_DIR}/clucene/src/shared
451+
${CONTRIB_PATH}/clucene/src/core
452+
${CONTRIB_PATH}/clucene/src/shared
453+
${CONTRIB_PATH}/clucene/src/contribs-lib
448454
)
449455

450456
include_directories(
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/workload_group_listener.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727

2828
namespace doris {
2929

30+
#include "common/compile_check_begin.h"
31+
3032
void WorkloadGroupListener::handle_topic_info(const std::vector<TopicInfo>& topic_info_list) {
3133
std::set<uint64_t> current_wg_ids;
3234
bool is_set_workload_group_info = false;
33-
int list_size = topic_info_list.size();
35+
auto list_size = topic_info_list.size();
3436
for (const TopicInfo& topic_info : topic_info_list) {
3537
if (!topic_info.__isset.workload_group_info) {
3638
continue;
@@ -84,4 +86,6 @@ void WorkloadGroupListener::handle_topic_info(const std::vector<TopicInfo>& topi
8486
}
8587
_exec_env->workload_group_mgr()->delete_workload_group_by_ids(current_wg_ids);
8688
}
89+
90+
#include "common/compile_check_end.h"
8791
} // namespace doris

be/src/cloud/cloud_internal_service.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "io/cache/block_file_cache_factory.h"
2424

2525
namespace doris {
26+
#include "common/compile_check_begin.h"
2627

2728
CloudInternalServiceImpl::CloudInternalServiceImpl(CloudStorageEngine& engine, ExecEnv* exec_env)
2829
: PInternalService(exec_env), _engine(engine) {}
@@ -83,7 +84,7 @@ void CloudInternalServiceImpl::get_file_cache_meta_by_tablet_id(
8384
auto rowsets = tablet->get_snapshot_rowset();
8485
std::for_each(rowsets.cbegin(), rowsets.cend(), [&](const RowsetSharedPtr& rowset) {
8586
std::string rowset_id = rowset->rowset_id().to_string();
86-
for (int64_t segment_id = 0; segment_id < rowset->num_segments(); segment_id++) {
87+
for (int32_t segment_id = 0; segment_id < rowset->num_segments(); segment_id++) {
8788
std::string file_name = fmt::format("{}_{}.dat", rowset_id, segment_id);
8889
auto cache_key = io::BlockFileCache::hash(file_name);
8990
auto* cache = io::FileCacheFactory::instance()->get_by_path(cache_key);
@@ -107,5 +108,6 @@ void CloudInternalServiceImpl::get_file_cache_meta_by_tablet_id(
107108
VLOG_DEBUG << "warm up get meta request=" << request->DebugString()
108109
<< ", response=" << response->DebugString();
109110
}
111+
#include "common/compile_check_end.h"
110112

111113
} // namespace doris

be/src/cloud/cloud_storage_engine.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ Status CloudStorageEngine::_check_all_root_path_cluster_id() {
11751175
return Status::OK();
11761176
} else {
11771177
// If no cluster id file exists, use the configured cluster id
1178-
RETURN_IF_ERROR(set_cluster_id(_effective_cluster_id));
1178+
return set_cluster_id(_effective_cluster_id);
11791179
}
11801180
}
11811181
if (cluster_ids.size() > 1) {
@@ -1184,12 +1184,12 @@ Status CloudStorageEngine::_check_all_root_path_cluster_id() {
11841184
"different cluster ids: {}",
11851185
fmt::join(cluster_ids, ", "));
11861186
}
1187-
if (_effective_cluster_id != -1 && *cluster_ids.begin() != _effective_cluster_id) {
1188-
RETURN_NOT_OK_STATUS_WITH_WARN(
1189-
Status::Corruption("multiple cluster ids is not equal. config::cluster_id={}, "
1190-
"storage path cluster_id={}",
1191-
_effective_cluster_id, *cluster_ids.begin()),
1192-
"cluster id not equal");
1187+
if (_effective_cluster_id != -1 && !cluster_ids.empty() &&
1188+
*cluster_ids.begin() != _effective_cluster_id) {
1189+
return Status::Corruption(
1190+
"multiple cluster ids is not equal. config::cluster_id={}, "
1191+
"storage path cluster_id={}",
1192+
_effective_cluster_id, *cluster_ids.begin());
11931193
}
11941194
return Status::OK();
11951195
}

0 commit comments

Comments
 (0)