Skip to content

Commit 00ba857

Browse files
Merge branch 'branch-3.0' into pick-lru-persist-for-3.0
2 parents 2bf5767 + 980a86b commit 00ba857

File tree

1,364 files changed

+59328
-10703
lines changed

Some content is hidden

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

1,364 files changed

+59328
-10703
lines changed

.github/actions/setup-maven

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/be-ut-mac.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,8 @@ jobs:
8585
brew install "${cellars[@]}" || true
8686
8787
pushd thirdparty
88-
branch="${{ github.base_ref }}"
89-
if [[ -z "${branch}" ]] || [[ "${branch}" == 'master' ]]; then
90-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz \
91-
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
92-
else
93-
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" \
94-
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
95-
fi
88+
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz \
89+
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
9690
tar -xvf doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
9791
popd
9892

.github/workflows/build-extension.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,7 @@ jobs:
6666
- name: Setup thrift
6767
run: |
6868
pushd thirdparty
69-
branch="${{ github.base_ref }}"
70-
if [[ -z "${branch}" ]] || [[ "${branch}" == 'master' || "${branch}" == 'branch-3.0' || "${branch}" == 'branch-2.1' ]]; then
71-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-linux-x86_64.tar.xz \
72-
-o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
73-
else
74-
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/doris-thirdparty-prebuilt-linux-x86_64.tar.xz" \
75-
-o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
76-
fi
69+
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-prebuilt-linux-x86_64.tar.xz" -o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
7770
tar -xvf doris-thirdparty-prebuilt-linux-x86_64.tar.xz
7871
popd
7972
export PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:$(pwd)/thirdparty/installed/bin/:${PATH}"

.github/workflows/build-thirdparty.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Download
7373
run: |
7474
cd thirdparty
75-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-source.tgz \
75+
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-source.tgz \
7676
-o doris-thirdparty-source.tgz
7777
tar -zxvf doris-thirdparty-source.tgz
7878
@@ -138,7 +138,7 @@ jobs:
138138
- name: Download
139139
run: |
140140
cd thirdparty
141-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-source.tgz \
141+
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-source.tgz \
142142
-o doris-thirdparty-source.tgz
143143
tar -zxvf doris-thirdparty-source.tgz
144144
@@ -196,7 +196,7 @@ jobs:
196196
- name: Download
197197
run: |
198198
cd thirdparty
199-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-source.tgz \
199+
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-source.tgz \
200200
-o doris-thirdparty-source.tgz
201201
tar -zxvf doris-thirdparty-source.tgz
202202

.github/workflows/checkstyle.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ jobs:
4242
- 'gensrc/proto/**'
4343
- 'gensrc/thrift/**'
4444
45-
- name: Setup Maven Action
45+
- name: Set up JDK with Maven
4646
if: steps.filter.outputs.fe_changes == 'true'
47-
uses: ./.github/actions/setup-maven
47+
uses: actions/setup-java@v4
4848
with:
49-
maven-version: 3.8.4
49+
distribution: 'temurin'
50+
java-version: '17'
51+
cache: 'maven'
5052

5153
- name: Run java checkstyle
5254
if: steps.filter.outputs.fe_changes == 'true'

.github/workflows/code-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
sudo DEBIAN_FRONTEND=noninteractive apt install --yes tzdata byacc
100100
101101
pushd thirdparty
102-
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-linux-x86_64.tar.xz \
102+
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation-3.0/doris-thirdparty-prebuilt-linux-x86_64.tar.xz \
103103
-o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
104104
tar -xvf doris-thirdparty-prebuilt-linux-x86_64.tar.xz
105105
popd

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
[submodule ".github/actions/get-workflow-origin"]
55
path = .github/actions/get-workflow-origin
66
url = https://github.com/potiuk/get-workflow-origin.git
7-
[submodule ".github/actions/setup-maven"]
8-
path = .github/actions/setup-maven
9-
url = https://github.com/stCarolas/setup-maven.git
107
[submodule ".github/actions/paths-filter"]
118
path = .github/actions/paths-filter
129
url = https://github.com/dorny/paths-filter

be/src/agent/agent_server.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "olap/snapshot_manager.h"
4444
#include "olap/storage_engine.h"
4545
#include "runtime/exec_env.h"
46+
#include "util/work_thread_pool.hpp"
4647

4748
using std::string;
4849
using std::vector;
@@ -169,8 +170,8 @@ void AgentServer::start_workers(StorageEngine& engine, ExecEnv* exec_env) {
169170
_workers[TTaskType::ALTER] = std::make_unique<TaskWorkerPool>(
170171
"ALTER_TABLE", config::alter_tablet_worker_count, [&engine](auto&& task) { return alter_tablet_callback(engine, task); });
171172

172-
_workers[TTaskType::CLONE] = std::make_unique<TaskWorkerPool>(
173-
"CLONE", config::clone_worker_count, [&engine, &cluster_info = _cluster_info](auto&& task) { return clone_callback(engine, cluster_info, task); });
173+
_workers[TTaskType::CLONE] = std::make_unique<PriorTaskWorkerPool>(
174+
"CLONE", config::clone_worker_count,config::clone_worker_count, [&engine, &cluster_info = _cluster_info](auto&& task) { return clone_callback(engine, cluster_info, task); });
174175

175176
_workers[TTaskType::STORAGE_MEDIUM_MIGRATE] = std::make_unique<TaskWorkerPool>(
176177
"STORAGE_MEDIUM_MIGRATE", config::storage_medium_migrate_count, [&engine](auto&& task) { return storage_medium_migrate_callback(engine, task); });
@@ -196,6 +197,8 @@ void AgentServer::start_workers(StorageEngine& engine, ExecEnv* exec_env) {
196197
_report_workers.push_back(std::make_unique<ReportWorker>(
197198
"REPORT_OLAP_TABLET", _cluster_info, config::report_tablet_interval_seconds,[&engine, &cluster_info = _cluster_info] { report_tablet_callback(engine, cluster_info); }));
198199
// clang-format on
200+
201+
exec_env->storage_engine().to_local().workers = &_workers;
199202
}
200203

201204
void AgentServer::cloud_start_workers(CloudStorageEngine& engine, ExecEnv* exec_env) {

be/src/agent/heartbeat_server.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <string>
2828
#include <vector>
2929

30+
#include "cloud/cloud_cluster_info.h"
3031
#include "cloud/cloud_tablet_mgr.h"
3132
#include "cloud/config.h"
3233
#include "common/config.h"
@@ -299,6 +300,12 @@ Status HeartbeatServer::_heartbeat(const TMasterInfo& master_info) {
299300
LOG(INFO) << "set config cloud_unique_id " << master_info.cloud_unique_id << " " << st;
300301
}
301302

303+
if (master_info.__isset.cloud_cluster_info &&
304+
master_info.cloud_cluster_info.__isset.isStandby) {
305+
auto* cloud_cluster_info = static_cast<CloudClusterInfo*>(_cluster_info);
306+
cloud_cluster_info->set_is_in_standby(master_info.cloud_cluster_info.isStandby);
307+
}
308+
302309
if (master_info.__isset.tablet_report_inactive_duration_ms) {
303310
doris::g_tablet_report_inactive_duration_ms =
304311
master_info.tablet_report_inactive_duration_ms;

be/src/agent/task_worker_pool.cpp

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "agent/task_worker_pool.h"
1919

20+
#include <brpc/controller.h>
2021
#include <fmt/format.h>
2122
#include <gen_cpp/AgentService_types.h>
2223
#include <gen_cpp/DataSinks_types.h>
@@ -84,6 +85,7 @@
8485
#include "runtime/memory/global_memory_arbitrator.h"
8586
#include "runtime/snapshot_loader.h"
8687
#include "service/backend_options.h"
88+
#include "util/brpc_client_cache.h"
8789
#include "util/debug_points.h"
8890
#include "util/doris_metrics.h"
8991
#include "util/jni-util.h"
@@ -291,7 +293,7 @@ void alter_cloud_tablet(CloudStorageEngine& engine, const TAgentTaskRequest& age
291293
job.process_alter_tablet(agent_task_req.alter_tablet_req_v2),
292294
[&](const doris::Exception& ex) {
293295
DorisMetrics::instance()->create_rollup_requests_failed->increment(1);
294-
job.clean_up_on_failed();
296+
job.clean_up_on_failure();
295297
});
296298
return Status::OK();
297299
}();
@@ -604,6 +606,52 @@ Status PriorTaskWorkerPool::submit_task(const TAgentTaskRequest& task) {
604606
});
605607
}
606608

609+
Status PriorTaskWorkerPool::submit_high_prior_and_cancel_low(const TAgentTaskRequest& task) {
610+
const TTaskType::type task_type = task.task_type;
611+
int64_t signature = task.signature;
612+
std::string type_str;
613+
EnumToString(TTaskType, task_type, type_str);
614+
auto req = std::make_unique<TAgentTaskRequest>(task);
615+
616+
DCHECK(req->__isset.priority && req->priority == TPriority::HIGH);
617+
do {
618+
std::lock_guard lock(s_task_signatures_mtx);
619+
auto& set = s_task_signatures[task_type];
620+
if (!set.contains(signature)) {
621+
// If it doesn't exist, put it directly into the priority queue
622+
add_task_count(*req, 1);
623+
set.insert(signature);
624+
std::lock_guard lock(_mtx);
625+
_high_prior_queue.push_back(std::move(req));
626+
_high_prior_condv.notify_one();
627+
_normal_condv.notify_one();
628+
break;
629+
} else {
630+
std::lock_guard lock(_mtx);
631+
for (auto it = _normal_queue.begin(); it != _normal_queue.end();) {
632+
// If it exists in the normal queue, cancel the task in the normal queue
633+
if ((*it)->signature == signature) {
634+
_normal_queue.erase(it); // cancel the original task
635+
_high_prior_queue.push_back(std::move(req)); // add the new task to the queue
636+
_high_prior_condv.notify_one();
637+
_normal_condv.notify_one();
638+
break;
639+
} else {
640+
++it; // doesn't meet the condition, continue to the next one
641+
}
642+
}
643+
// If it exists in the high priority queue, no operation is needed
644+
LOG_INFO("task has already existed in high prior queue.").tag("signature", signature);
645+
}
646+
} while (false);
647+
648+
// Set the receiving time of task so that we can determine whether it is timed out later
649+
(const_cast<TAgentTaskRequest&>(task)).__set_recv_time(time(nullptr));
650+
651+
LOG_INFO("successfully submit task").tag("type", type_str).tag("signature", signature);
652+
return Status::OK();
653+
}
654+
607655
void PriorTaskWorkerPool::normal_loop() {
608656
while (true) {
609657
std::unique_ptr<TAgentTaskRequest> req;
@@ -1432,23 +1480,15 @@ void update_s3_resource(const TStorageResource& param, io::RemoteFileSystemSPtr
14321480
DCHECK_EQ(existed_fs->type(), io::FileSystemType::S3) << param.id << ' ' << param.name;
14331481
auto client = static_cast<io::S3FileSystem*>(existed_fs.get())->client_holder();
14341482
auto new_s3_conf = S3Conf::get_s3_conf(param.s3_storage_param);
1435-
S3ClientConf conf {
1436-
.endpoint {},
1437-
.region {},
1438-
.ak = std::move(new_s3_conf.client_conf.ak),
1439-
.sk = std::move(new_s3_conf.client_conf.sk),
1440-
.token = std::move(new_s3_conf.client_conf.token),
1441-
.bucket {},
1442-
.provider = new_s3_conf.client_conf.provider,
1443-
};
1483+
S3ClientConf conf = std::move(new_s3_conf.client_conf);
14441484
st = client->reset(conf);
14451485
fs = std::move(existed_fs);
14461486
}
14471487

14481488
if (!st.ok()) {
14491489
LOG(WARNING) << "update s3 resource failed: " << st;
14501490
} else {
1451-
LOG_INFO("successfully update hdfs resource")
1491+
LOG_INFO("successfully update s3 resource")
14521492
.tag("resource_id", param.id)
14531493
.tag("resource_name", param.name);
14541494
put_storage_resource(param.id, {std::move(fs)}, param.version);

0 commit comments

Comments
 (0)