Skip to content

Commit 9c0e9b1

Browse files
authored
Merge branch 'master' into opt-master-lazyopen-260814
2 parents 4826368 + b119273 commit 9c0e9b1

350 files changed

Lines changed: 19489 additions & 2656 deletions

File tree

Some content is hidden

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

.github/workflows/auto-cherry-pick.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ permissions:
3131
jobs:
3232
auto_cherry_pick:
3333
runs-on: ubuntu-latest
34-
if: ${{(contains(github.event.pull_request.labels.*.name, 'dev/4.0.x') || github.event.label.name == 'dev/4.0.x' || contains(github.event.pull_request.labels.*.name, 'dev/4.1.x') || github.event.label.name == 'dev/4.1.x') && github.event.pull_request.merged == true }}
34+
if: ${{(contains(github.event.pull_request.labels.*.name, 'dev/4.1.x') || github.event.label.name == 'dev/4.1.x') && github.event.pull_request.merged == true }}
3535
steps:
3636
- name: Checkout repository
3737
uses: actions/checkout@v3
@@ -55,15 +55,6 @@ jobs:
5555
echo "SHA matches: $calculated_sha"
5656
fi
5757
58-
- name: Auto cherry-pick to branch-4.0
59-
if: ${{ ((github.event.action == 'labeled' && github.event.label.name == 'dev/4.0.x'))|| ((github.event_name == 'pull_request_target' && github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'dev/4.0.x')) }}
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
REPO_NAME: ${{ github.repository }}
63-
CONFLICT_LABEL: dev/4.0.x-conflict
64-
run: |
65-
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-4.0
66-
6758
- name: Auto cherry-pick to branch-4.1
6859
if: ${{ ((github.event.action == 'labeled' && github.event.label.name == 'dev/4.1.x'))|| ((github.event_name == 'pull_request_target' && github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'dev/4.1.x')) }}
6960
env:

.github/workflows/build-thirdparty.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ jobs:
227227
'gettext'
228228
'wget'
229229
'pcre'
230-
'openjdk@11'
230+
'openjdk@17'
231231
'maven'
232232
'node'
233233
'llvm@20'
@@ -292,7 +292,7 @@ jobs:
292292
'gettext'
293293
'wget'
294294
'pcre'
295-
'openjdk@11'
295+
'openjdk@17'
296296
'maven'
297297
'node'
298298
'llvm@20'

LICENSE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ The following components are provided under the Apache License. See project link
206206
The text of each license is the standard Apache 2.0 license.
207207

208208
software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder from AWS SDK v2 (sdk-core 2.29.52)
209+
org.apache.hadoop.fs.FileSystem from Apache Hadoop (hadoop-common 3.4.2)
209210

210211
--------------------------------------------------------------------------------
211212

SECURITY.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,23 @@ scanners, review agents, and vulnerability triagers should read
1313
Findings that are out of model or by design under `threat-model.md`
1414
should be reported with that disposition instead of being treated as
1515
Doris vulnerabilities.
16+
17+
Before testing the FE HTTP surface, confirm `enable_all_http_auth` is
18+
`true` on the running FE — it is the default, and it must not be
19+
turned off for the test run. Confirm it against the *effective*
20+
runtime value, not against `fe.conf` alone: FE reads `fe.conf` and
21+
then `${custom_config_dir}/fe_custom.conf`, and the latter overwrites
22+
the former. In releases where this flag was mutable, `ADMIN SET
23+
FRONTEND CONFIG (...) PROPERTIES("persist" = "true")` could write
24+
`enable_all_http_auth=false` into `fe_custom.conf`; making the flag
25+
non-mutable does not remove or migrate such a value, so an upgraded
26+
cluster can have no `false` entry anywhere in `fe.conf` and still be
27+
running with authentication off. Read the value back from
28+
`/api/show_config` (or `ADMIN SHOW FRONTEND CONFIG`) and check both
29+
files. With it off, FE serves part of its HTTP surface (metadata,
30+
statistics and import REST endpoints) without checking credentials,
31+
and every finding that depends on it being off is out of model. On BE
32+
the same flag still defaults to `false`; BE 8040 is an internal port
33+
that operators are required to keep off end-user networks, so findings
34+
there are disclaimed rather than valid. See the security-testing
35+
baseline in §4.5a of `threat-model.md`.

be/CMakeLists.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ add_definitions(-DGLOG_CUSTOM_PREFIX_SUPPORT)
8080
option(GLIBC_COMPATIBILITY "Enable compatibility with older glibc libraries." ON)
8181
option(USE_LIBCPP "Use libc++" OFF)
8282
option(USE_JEMALLOC "Use jemalloc" ON)
83+
# Merge groups of .cpp files into jumbo translation units for much faster full
84+
# builds. Turn OFF for precise per-file diagnostics, per-file tooling
85+
# (clang-tidy/coverage), or the finest-grained incremental rebuilds.
86+
option(ENABLE_UNITY_BUILD "Enable CMake unity builds for BE targets" ON)
87+
# Normalize to a strict ON/OFF. Every pilot target sets its UNITY_BUILD property
88+
# unconditionally from this value: OFF must be an explicit OFF, otherwise a
89+
# cache that also carries CMake's own CMAKE_UNITY_BUILD=ON leaves the property
90+
# ON (it initializes UNITY_BUILD at add_library time) and the escape hatch does
91+
# nothing.
92+
if (ENABLE_UNITY_BUILD)
93+
set(DORIS_UNITY_BUILD ON)
94+
else()
95+
set(DORIS_UNITY_BUILD OFF)
96+
endif()
8397
if (OS_MACOSX)
8498
set(GLIBC_COMPATIBILITY OFF)
8599
set(USE_LIBCPP ON)
@@ -103,6 +117,7 @@ message(STATUS "USE_LIBCPP is ${USE_LIBCPP}")
103117
message(STATUS "USE_JEMALLOC is ${USE_JEMALLOC}")
104118
message(STATUS "USE_UNWIND is ${USE_UNWIND}")
105119
message(STATUS "ENABLE_PCH is ${ENABLE_PCH}")
120+
message(STATUS "ENABLE_UNITY_BUILD is ${ENABLE_UNITY_BUILD}")
106121
message(STATUS "USE_AVX2 is ${USE_AVX2}")
107122

108123
# set CMAKE_BUILD_TYPE
@@ -394,7 +409,14 @@ if (COMPILER_CLANG)
394409
-Wthread-safety)
395410
add_compile_options(-Wno-gnu-statement-expression
396411
-Wno-implicit-float-conversion
397-
-Wno-sign-conversion)
412+
-Wno-sign-conversion
413+
# libstdc++-15 puts `#pragma GCC unroll` on loops in its own
414+
# headers (bits/stl_algobase.h); when a sanitizer/coverage
415+
# build compiles at low optimization the unroller punts and
416+
# clang's -Wpass-failed turns that missed *hint* into an
417+
# -Werror failure. The diagnostic carries no correctness
418+
# signal, so drop it.
419+
-Wno-pass-failed)
398420
if (USE_LIBCPP)
399421
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>)
400422
add_definitions(-DUSE_LIBCPP)
@@ -966,6 +988,24 @@ function(pch_reuse target)
966988
endif()
967989
endfunction(pch_reuse target)
968990

991+
# Every unity opt-out goes through this helper. set_source_files_properties()
992+
# silently ignores paths that do not exist, so a skip entry going stale after
993+
# a rename or move would quietly re-join its unity batch -- slower builds, or
994+
# new file-scope clashes, with no diagnostic anywhere. Fail the configure
995+
# instead. Entries under GENSRC_DIR are exempt: they are emitted by
996+
# add_custom_command at build time (wkt_lex.l.cpp, the generated
997+
# thrift/protobuf sources) and legitimately do not exist on a fresh configure.
998+
function(doris_skip_unity_inclusion)
999+
foreach(entry IN LISTS ARGN)
1000+
string(FIND "${entry}" "${GENSRC_DIR}" gensrc_prefix_pos)
1001+
if(NOT gensrc_prefix_pos EQUAL 0 AND NOT EXISTS "${entry}")
1002+
message(FATAL_ERROR
1003+
"unity skip entry does not exist (renamed or moved?): ${entry}")
1004+
endif()
1005+
endforeach()
1006+
set_source_files_properties(${ARGN} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
1007+
endfunction()
1008+
9691009

9701010
add_subdirectory(${SRC_DIR}/agent)
9711011
add_subdirectory(${SRC_DIR}/common)

be/src/agent/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ endif()
2929

3030
add_library(Agent STATIC ${AGENT_SOURCES})
3131

32-
pch_reuse(Agent)
32+
pch_reuse(Agent)
33+
34+
# Unity build: nine homogeneous task-worker glue TUs sharing the agent header
35+
# closure; batch 0 merges them into a single unity TU.
36+
set_target_properties(Agent PROPERTIES UNITY_BUILD ${DORIS_UNITY_BUILD}
37+
UNITY_BUILD_BATCH_SIZE 0)

be/src/agent/cgroup_cpu_ctl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#pragma once
19+
1820
#include <fcntl.h>
1921
#include <sys/stat.h>
2022
#include <sys/types.h>

be/src/cloud/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,15 @@ file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS *.cpp)
2222
add_library(Cloud STATIC ${SRC_FILES})
2323

2424
pch_reuse(Cloud)
25+
26+
# Unity build: homogeneous cloud glue TUs sharing the CloudStorageEngine /
27+
# meta-service RPC header closure. Batch 12 bounds jumbo-TU size and memory.
28+
# The two http action TUs stay individual: sibling TUs' file-scope
29+
# `using namespace ErrorCode` makes the unscoped HttpStatus enum constants
30+
# (OK, NOT_FOUND, ...) shadow ErrorCode variables under -Wshadow -Werror.
31+
set(CLOUD_UNITY_SKIP
32+
${CMAKE_CURRENT_SOURCE_DIR}/cloud_compaction_action.cpp
33+
${CMAKE_CURRENT_SOURCE_DIR}/injection_point_action.cpp)
34+
doris_skip_unity_inclusion(${CLOUD_UNITY_SKIP})
35+
set_target_properties(Cloud PROPERTIES UNITY_BUILD ${DORIS_UNITY_BUILD}
36+
UNITY_BUILD_BATCH_SIZE 12)

be/src/cloud/cloud_internal_service.cpp

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,67 @@ bvar::Adder<int64_t> g_peer_server_fill_rejected("peer_server_fill_rejected");
102102
bvar::LatencyRecorder g_peer_server_fill_latency("peer_server_fill_latency");
103103
bvar::LatencyRecorder g_cloud_internal_service_get_file_cache_meta_by_tablet_id_latency(
104104
"cloud_internal_service_get_file_cache_meta_by_tablet_id_latency");
105+
bvar::Adder<int64_t> g_cloud_sync_tablet_meta_requests_total(
106+
"cloud_sync_tablet_meta_requests_total");
107+
bvar::Adder<int64_t> g_cloud_sync_tablet_meta_synced_total("cloud_sync_tablet_meta_synced_total");
108+
bvar::Adder<int64_t> g_cloud_sync_tablet_meta_skipped_total("cloud_sync_tablet_meta_skipped_total");
109+
bvar::Adder<int64_t> g_cloud_sync_tablet_meta_failed_total("cloud_sync_tablet_meta_failed_total");
110+
111+
namespace {
112+
113+
void submit_sync_tablet_meta(CloudStorageEngine& engine, FifoThreadPool& work_pool,
114+
const PSyncTabletMetaRequest* request,
115+
PSyncTabletMetaResponse* response, google::protobuf::Closure* done) {
116+
auto start_time = std::chrono::steady_clock::now();
117+
bool ret = work_pool.try_offer([engine = &engine, request, response, done, start_time]() {
118+
brpc::ClosureGuard closure_guard(done);
119+
LOG(INFO) << "begin to sync tablet meta, request=" << request->ShortDebugString();
120+
int64_t synced = 0;
121+
int64_t skipped = 0;
122+
int64_t failed = 0;
123+
g_cloud_sync_tablet_meta_requests_total << 1;
124+
for (const auto tablet_id : request->tablet_ids()) {
125+
auto tablet = engine->tablet_mgr().get_tablet_if_cached(tablet_id);
126+
if (!tablet) {
127+
++skipped;
128+
continue;
129+
}
130+
auto st = tablet->sync_meta();
131+
if (!st.ok()) {
132+
++failed;
133+
LOG(WARNING) << "failed to sync tablet meta from cloud meta service, tablet="
134+
<< tablet_id << ", err=" << st;
135+
continue;
136+
}
137+
++synced;
138+
}
139+
g_cloud_sync_tablet_meta_synced_total << synced;
140+
g_cloud_sync_tablet_meta_skipped_total << skipped;
141+
g_cloud_sync_tablet_meta_failed_total << failed;
142+
response->set_synced_tablets(synced);
143+
response->set_skipped_tablets(skipped);
144+
response->set_failed_tablets(failed);
145+
Status::OK().to_protobuf(response->mutable_status());
146+
auto cost_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
147+
std::chrono::steady_clock::now() - start_time)
148+
.count();
149+
LOG(INFO) << "finish to sync tablet meta, request=" << request->ShortDebugString()
150+
<< ", response=" << response->ShortDebugString() << ", cost_ms=" << cost_ms;
151+
});
152+
if (!ret) {
153+
brpc::ClosureGuard closure_guard(done);
154+
Status::InternalError("failed to offer sync_tablet_meta request to work pool")
155+
.to_protobuf(response->mutable_status());
156+
auto cost_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
157+
std::chrono::steady_clock::now() - start_time)
158+
.count();
159+
LOG(WARNING) << "failed to offer sync_tablet_meta request to work pool, request="
160+
<< request->ShortDebugString() << ", response=" << response->ShortDebugString()
161+
<< ", cost_ms=" << cost_ms;
162+
}
163+
}
164+
165+
} // namespace
105166

106167
// Concurrency guard for server-side S3 pull-through fills.
107168
static std::atomic<int32_t> g_active_server_fills {0};
@@ -114,6 +175,22 @@ CloudInternalServiceImpl::CloudInternalServiceImpl(CloudStorageEngine& engine, E
114175

115176
CloudInternalServiceImpl::~CloudInternalServiceImpl() = default;
116177

178+
void CloudInternalServiceImpl::sync_tablet_meta(google::protobuf::RpcController* controller,
179+
const PSyncTabletMetaRequest* request,
180+
PSyncTabletMetaResponse* response,
181+
google::protobuf::Closure* done) {
182+
submit_sync_tablet_meta(_engine, _light_work_pool, request, response, done);
183+
}
184+
185+
#ifdef BE_TEST
186+
void test_submit_sync_tablet_meta(CloudStorageEngine& engine, FifoThreadPool& work_pool,
187+
const PSyncTabletMetaRequest* request,
188+
PSyncTabletMetaResponse* response,
189+
google::protobuf::Closure* done) {
190+
submit_sync_tablet_meta(engine, work_pool, request, response, done);
191+
}
192+
#endif
193+
117194
void CloudInternalServiceImpl::alter_vault_sync(google::protobuf::RpcController* controller,
118195
const doris::PAlterVaultSyncRequest* request,
119196
PAlterVaultSyncResponse* response,
@@ -925,12 +1002,7 @@ bvar::Adder<uint64_t> g_file_cache_warm_up_rowset_wait_for_compaction_num(
9251002
bvar::Adder<uint64_t> g_file_cache_warm_up_rowset_wait_for_compaction_timeout_num(
9261003
"file_cache_warm_up_rowset_wait_for_compaction_timeout_num");
9271004

928-
// Per-job windowed metrics for target BE
929-
// bvar::Window enforces MAX_SECONDS_LIMIT = 3600, so the longest window is 1h.
930-
static constexpr int WINDOW_5M = 300;
931-
static constexpr int WINDOW_30M = 1800;
932-
static constexpr int WINDOW_1H = 3600;
933-
1005+
// Per-job windowed metrics for target BE (window spans shared via bvar_windowed_adder.h)
9341006
MBvarWindowedAdder g_warmup_ed_finish_segment_num("warmup_ed_finish_segment_num", {"job_id"},
9351007
{WINDOW_5M, WINDOW_30M, WINDOW_1H}, false);
9361008
MBvarWindowedAdder g_warmup_ed_finish_segment_size("warmup_ed_finish_segment_size", {"job_id"},

be/src/cloud/cloud_internal_service.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ Status test_handle_peer_file_cache_block_request(const PFetchPeerDataRequest* re
3535
brpc::Controller* cntl);
3636
bool test_try_reject_if_queue_timed_out(std::chrono::steady_clock::time_point enqueue_ts,
3737
PFetchPeerDataResponse* response);
38+
void test_submit_sync_tablet_meta(CloudStorageEngine& engine, FifoThreadPool& work_pool,
39+
const PSyncTabletMetaRequest* request,
40+
PSyncTabletMetaResponse* response,
41+
google::protobuf::Closure* done);
3842
#endif
3943

4044
class CloudInternalServiceImpl final : public PInternalService {
@@ -48,6 +52,10 @@ class CloudInternalServiceImpl final : public PInternalService {
4852
PAlterVaultSyncResponse* response,
4953
google::protobuf::Closure* done) override;
5054

55+
void sync_tablet_meta(google::protobuf::RpcController* controller,
56+
const PSyncTabletMetaRequest* request, PSyncTabletMetaResponse* response,
57+
google::protobuf::Closure* done) override;
58+
5159
// Get messages (filename, offset, size) about the tablet data in cache
5260
void get_file_cache_meta_by_tablet_id(google::protobuf::RpcController* controller,
5361
const PGetFileCacheMetaRequest* request,

0 commit comments

Comments
 (0)