Skip to content

Commit 07f0f00

Browse files
committed
Merge remote-tracking branch 'origin/feature/Enhancement-dynamic_partition' into feature/Enhancement-dynamic_partition
2 parents 9eb6e07 + 31e8833 commit 07f0f00

File tree

832 files changed

+26165
-7973
lines changed

Some content is hidden

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

832 files changed

+26165
-7973
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
*.thrift text eol=lf
1515
*.proto text eol=lf
1616
*.conf text eol=lf
17-
*.out text eol=lf -diff
17+
*.out text eol=lf diff
1818
*.groovy -linguist-detectable
1919
regression-test/ export-ignore

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

Lines changed: 10 additions & 2 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/3.0.x') || contains(github.event.pull_request.labels.*.name, 'dev/2.1.x') || contains(github.event.pull_request.labels.*.name, 'dev/3.1.x') || github.event.label.name == 'dev/3.0.x' || github.event.label.name == 'dev/2.1.x' || github.event.label.name == 'dev/3.1.x') && github.event.pull_request.merged == true }}
34+
if: ${{(contains(github.event.pull_request.labels.*.name, 'dev/3.0.x') || contains(github.event.pull_request.labels.*.name, 'dev/4.0.x') || contains(github.event.pull_request.labels.*.name, 'dev/2.1.x') || contains(github.event.pull_request.labels.*.name, 'dev/3.1.x') || github.event.label.name == 'dev/4.0.x' || github.event.label.name == 'dev/3.0.x' || github.event.label.name == 'dev/2.1.x' || github.event.label.name == 'dev/3.1.x') && github.event.pull_request.merged == true }}
3535
steps:
3636
- name: Checkout repository
3737
uses: actions/checkout@v3
@@ -77,4 +77,12 @@ jobs:
7777
REPO_NAME: ${{ github.repository }}
7878
CONFLICT_LABEL: dev/3.1.x-conflict
7979
run: |
80-
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-3.1
80+
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-3.1
81+
- name: Auto cherry-pick to branch-4.0
82+
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')) }}
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
REPO_NAME: ${{ github.repository }}
86+
CONFLICT_LABEL: dev/4.0.x-conflict
87+
run: |
88+
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-4.0

.github/workflows/comment-to-trigger-teamcity.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
"${COMMENT_BODY}" == *'run vault_p0'* ||
6060
"${COMMENT_BODY}" == *'run nonConcurrent'* ||
6161
"${COMMENT_BODY}" == *'run check_coverage'* ||
62-
"${COMMENT_BODY}" == *'run arm'* ||
6362
"${COMMENT_BODY}" == *'run performance'* ]]; then
6463
echo "comment_trigger=true" | tee -a "$GITHUB_OUTPUT"
6564
echo "comment_skip=false" | tee -a "$GITHUB_OUTPUT"
@@ -83,6 +82,10 @@ jobs:
8382
echo "COMMENT_USER_ID ${COMMENT_USER_ID} is allowed to skip buildall for branch-3.1"
8483
echo "comment_trigger=false" | tee -a "$GITHUB_OUTPUT"
8584
echo "comment_skip=true" | tee -a "$GITHUB_OUTPUT"
85+
elif [[ "${COMMENT_USER_ID}" == '9208457' && "${TARGET_BRANCH}" == *'branch-4.0'* ]]; then
86+
echo "COMMENT_USER_ID ${COMMENT_USER_ID} is allowed to skip buildall for branch-4.0"
87+
echo "comment_trigger=false" | tee -a "$GITHUB_OUTPUT"
88+
echo "comment_skip=true" | tee -a "$GITHUB_OUTPUT"
8689
else
8790
echo "COMMENT_USER_ID ${COMMENT_USER_ID} is not allowed to skip buildall."
8891
exit
@@ -117,7 +120,7 @@ jobs:
117120
echo "TARGET_BRANCH='${TARGET_BRANCH}'" | tee -a "$GITHUB_OUTPUT"
118121
echo "COMMENT_BODY='${COMMENT_BODY}'" | tee -a "$GITHUB_OUTPUT"
119122
120-
reg="run (buildall|compile|p0|p1|feut|beut|cloudut|external|clickbench|cloud_p0|cloud_p1|vault_p0|nonConcurrent|arm|performance|check_coverage)( [1-9]*[0-9]+)*"
123+
reg="run (buildall|compile|p0|p1|feut|beut|cloudut|external|clickbench|cloud_p0|cloud_p1|vault_p0|nonConcurrent|performance|check_coverage)( [1-9]*[0-9]+)*"
121124
COMMENT_TRIGGER_TYPE="$(echo -e "${COMMENT_BODY}" | xargs | grep -E "${reg}" | awk -F' ' '{print $2}' | sed -n 1p | sed 's/\r//g')"
122125
COMMENT_REPEAT_TIMES="$(echo -e "${COMMENT_BODY}" | xargs | grep -E "${reg}" | awk -F' ' '{print $3}' | sed -n 1p | sed 's/\r//g')"
123126
echo "COMMENT_TRIGGER_TYPE=${COMMENT_TRIGGER_TYPE}" | tee -a "$GITHUB_OUTPUT"
@@ -152,12 +155,10 @@ jobs:
152155
if file_changed_regression_p0; then
153156
echo "changed_p0=true" | tee -a "$GITHUB_OUTPUT"
154157
echo "changed_external=true" | tee -a "$GITHUB_OUTPUT"
155-
echo "changed_arm=true" | tee -a "$GITHUB_OUTPUT"
156158
echo "changed_nonConcurrent=true" | tee -a "$GITHUB_OUTPUT"
157159
else
158160
echo "changed_p0=false" | tee -a "$GITHUB_OUTPUT"
159161
echo "changed_external=false" | tee -a "$GITHUB_OUTPUT"
160-
echo "changed_arm=false" | tee -a "$GITHUB_OUTPUT"
161162
echo "changed_nonConcurrent=false" | tee -a "$GITHUB_OUTPUT"
162163
fi
163164
if file_changed_regression_p1; then
@@ -194,7 +195,6 @@ jobs:
194195
echo "changed_cloud_ut=true" | tee -a "$GITHUB_OUTPUT"
195196
echo "changed_p0=true" | tee -a "$GITHUB_OUTPUT"
196197
echo "changed_external=true" | tee -a "$GITHUB_OUTPUT"
197-
echo "changed_arm=true" | tee -a "$GITHUB_OUTPUT"
198198
echo "changed_p1=true" | tee -a "$GITHUB_OUTPUT"
199199
echo "changed_performance=true" | tee -a "$GITHUB_OUTPUT"
200200
echo "changed_cloud_p0=true" | tee -a "$GITHUB_OUTPUT"
@@ -403,19 +403,6 @@ jobs:
403403
"cloud_p1" \
404404
"${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
405405
406-
- name: "Trigger or Skip arm"
407-
if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && contains(fromJSON('["arm", "buildall"]'), steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
408-
run: |
409-
source ./regression-test/pipeline/common/teamcity-utils.sh
410-
set -x
411-
trigger_or_skip_build \
412-
"${{ steps.changes.outputs.changed_arm }}" \
413-
"${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
414-
"${{ steps.parse.outputs.TARGET_BRANCH }}" \
415-
"${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
416-
"arm" \
417-
"${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
418-
419406
- name: "Trigger or Skip performance"
420407
if: ${{ fromJSON(steps.parse.outputs.comment_trigger) && contains(fromJSON('["performance", "buildall"]'), steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
421408
run: |
@@ -440,7 +427,6 @@ jobs:
440427
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" p1
441428
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" external
442429
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" performance
443-
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" arm
444430
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" cloud_p0
445431
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" cloud_p1
446432
skip_build "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" cloudut

be/src/agent/task_worker_pool.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ void update_tablet_meta_callback(StorageEngine& engine, const TAgentTaskRequest&
895895
tablet->tablet_meta()->mutable_tablet_schema()->set_is_in_memory(
896896
tablet_meta_info.is_in_memory);
897897
std::shared_lock rlock(tablet->get_header_lock());
898-
for (auto& rowset_meta : tablet->tablet_meta()->all_mutable_rs_metas()) {
898+
for (auto& [_, rowset_meta] : tablet->tablet_meta()->all_mutable_rs_metas()) {
899899
rowset_meta->tablet_schema()->set_is_in_memory(tablet_meta_info.is_in_memory);
900900
}
901901
tablet->tablet_schema_unlocked()->set_is_in_memory(tablet_meta_info.is_in_memory);
@@ -993,7 +993,7 @@ void update_tablet_meta_callback(StorageEngine& engine, const TAgentTaskRequest&
993993
std::shared_lock rlock(tablet->get_header_lock());
994994
tablet->tablet_meta()->mutable_tablet_schema()->set_enable_single_replica_compaction(
995995
tablet_meta_info.enable_single_replica_compaction);
996-
for (auto& rowset_meta : tablet->tablet_meta()->all_mutable_rs_metas()) {
996+
for (auto& [_, rowset_meta] : tablet->tablet_meta()->all_mutable_rs_metas()) {
997997
rowset_meta->tablet_schema()->set_enable_single_replica_compaction(
998998
tablet_meta_info.enable_single_replica_compaction);
999999
}
@@ -1005,7 +1005,7 @@ void update_tablet_meta_callback(StorageEngine& engine, const TAgentTaskRequest&
10051005
std::shared_lock rlock(tablet->get_header_lock());
10061006
tablet->tablet_meta()->mutable_tablet_schema()->set_disable_auto_compaction(
10071007
tablet_meta_info.disable_auto_compaction);
1008-
for (auto& rowset_meta : tablet->tablet_meta()->all_mutable_rs_metas()) {
1008+
for (auto& [_, rowset_meta] : tablet->tablet_meta()->all_mutable_rs_metas()) {
10091009
rowset_meta->tablet_schema()->set_disable_auto_compaction(
10101010
tablet_meta_info.disable_auto_compaction);
10111011
}
@@ -1018,7 +1018,7 @@ void update_tablet_meta_callback(StorageEngine& engine, const TAgentTaskRequest&
10181018
std::shared_lock rlock(tablet->get_header_lock());
10191019
tablet->tablet_meta()->mutable_tablet_schema()->set_skip_write_index_on_load(
10201020
tablet_meta_info.skip_write_index_on_load);
1021-
for (auto& rowset_meta : tablet->tablet_meta()->all_mutable_rs_metas()) {
1021+
for (auto& [_, rowset_meta] : tablet->tablet_meta()->all_mutable_rs_metas()) {
10221022
rowset_meta->tablet_schema()->set_skip_write_index_on_load(
10231023
tablet_meta_info.skip_write_index_on_load);
10241024
}
@@ -1093,6 +1093,7 @@ void report_task_callback(const ClusterInfo* cluster_info) {
10931093
}
10941094
}
10951095
request.__set_backend(BackendOptions::get_local_backend());
1096+
request.__set_running_tasks(ExecEnv::GetInstance()->fragment_mgr()->running_query_num());
10961097
bool succ = handle_report(request, cluster_info, "task");
10971098
report_task_total << 1;
10981099
if (!succ) [[unlikely]] {

be/src/cloud/cloud_meta_mgr.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ static std::string debug_info(const Request& req) {
351351
return fmt::format(" table_id={}, lock_id={}", req.table_id(), req.lock_id());
352352
} else if constexpr (is_any_v<Request, GetTabletRequest>) {
353353
return fmt::format(" tablet_id={}", req.tablet_id());
354-
} else if constexpr (is_any_v<Request, GetObjStoreInfoRequest>) {
354+
} else if constexpr (is_any_v<Request, GetObjStoreInfoRequest, ListSnapshotRequest,
355+
GetInstanceRequest>) {
355356
return "";
356357
} else if constexpr (is_any_v<Request, CreateRowsetRequest>) {
357358
return fmt::format(" tablet_id={}", req.rowset_meta().tablet_id());
@@ -2034,7 +2035,7 @@ Status CloudMetaMgr::fill_version_holes(CloudTablet* tablet, int64_t max_version
20342035
}
20352036

20362037
Versions existing_versions;
2037-
for (const auto& rs : tablet->tablet_meta()->all_rs_metas()) {
2038+
for (const auto& [_, rs] : tablet->tablet_meta()->all_rs_metas()) {
20382039
existing_versions.emplace_back(rs->version());
20392040
}
20402041

@@ -2176,5 +2177,36 @@ Status CloudMetaMgr::create_empty_rowset_for_hole(CloudTablet* tablet, int64_t v
21762177

21772178
return Status::OK();
21782179
}
2180+
2181+
Status CloudMetaMgr::list_snapshot(std::vector<SnapshotInfoPB>& snapshots) {
2182+
ListSnapshotRequest req;
2183+
ListSnapshotResponse res;
2184+
req.set_cloud_unique_id(config::cloud_unique_id);
2185+
req.set_include_aborted(true);
2186+
RETURN_IF_ERROR(retry_rpc("list snapshot", req, &res, &MetaService_Stub::list_snapshot));
2187+
for (auto& snapshot : snapshots) {
2188+
snapshots.emplace_back(snapshot);
2189+
}
2190+
return Status::OK();
2191+
}
2192+
2193+
Status CloudMetaMgr::get_snapshot_properties(SnapshotSwitchStatus& switch_status,
2194+
int64_t& max_reserved_snapshots,
2195+
int64_t& snapshot_interval_seconds) {
2196+
GetInstanceRequest req;
2197+
GetInstanceResponse res;
2198+
req.set_cloud_unique_id(config::cloud_unique_id);
2199+
RETURN_IF_ERROR(
2200+
retry_rpc("get snapshot properties", req, &res, &MetaService_Stub::get_instance));
2201+
switch_status = res.instance().has_snapshot_switch_status()
2202+
? res.instance().snapshot_switch_status()
2203+
: SnapshotSwitchStatus::SNAPSHOT_SWITCH_DISABLED;
2204+
max_reserved_snapshots =
2205+
res.instance().has_max_reserved_snapshot() ? res.instance().max_reserved_snapshot() : 0;
2206+
snapshot_interval_seconds = res.instance().has_snapshot_interval_seconds()
2207+
? res.instance().snapshot_interval_seconds()
2208+
: 3600;
2209+
return Status::OK();
2210+
}
21792211
#include "common/compile_check_end.h"
21802212
} // namespace doris::cloud

be/src/cloud/cloud_meta_mgr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ class CloudMetaMgr {
161161
RowsetMetaSharedPtr prev_rowset_meta,
162162
RowsetSharedPtr* rowset);
163163

164+
Status list_snapshot(std::vector<SnapshotInfoPB>& snapshots);
165+
Status get_snapshot_properties(SnapshotSwitchStatus& switch_status,
166+
int64_t& max_reserved_snapshots,
167+
int64_t& snapshot_interval_seconds);
168+
164169
private:
165170
bool sync_tablet_delete_bitmap_by_cache(CloudTablet* tablet, int64_t old_max_version,
166171
std::ranges::range auto&& rs_metas,

be/src/cloud/cloud_schema_change_job.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,14 @@ Status CloudSchemaChangeJob::_process_delete_bitmap(int64_t alter_version,
490490
tmp_meta->delete_bitmap().delete_bitmap.clear();
491491
// Keep only version [0-1] rowset, other rowsets will be added in _output_rowsets
492492
auto& rs_metas = tmp_meta->all_mutable_rs_metas();
493-
rs_metas.erase(std::remove_if(rs_metas.begin(), rs_metas.end(),
494-
[](const RowsetMetaSharedPtr& rs_meta) {
495-
return !(rs_meta->version().first == 0 &&
496-
rs_meta->version().second == 1);
497-
}),
498-
rs_metas.end());
493+
for (auto it = rs_metas.begin(); it != rs_metas.end();) {
494+
const auto& rs_meta = it->second;
495+
if (rs_meta->version().first == 0 && rs_meta->version().second == 1) {
496+
++it;
497+
} else {
498+
it = rs_metas.erase(it);
499+
}
500+
}
499501

500502
std::shared_ptr<CloudTablet> tmp_tablet =
501503
std::make_shared<CloudTablet>(_cloud_storage_engine, tmp_meta);

be/src/cloud/cloud_snapshot_mgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Status CloudSnapshotMgr::make_snapshot(int64_t target_tablet_id, StorageResource
8383
if (tablet_meta.all_rs_metas().size() > 0) {
8484
tablet_meta_pb.mutable_inc_rs_metas()->Reserve(
8585
cast_set<int>(tablet_meta.all_rs_metas().size()));
86-
for (auto& rs : tablet_meta.all_rs_metas()) {
86+
for (auto& [_, rs] : tablet_meta.all_rs_metas()) {
8787
rs->to_rowset_pb(tablet_meta_pb.add_rs_metas());
8888
}
8989
}

be/src/cloud/cloud_tablet.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,11 @@ Status CloudTablet::capture_rs_readers_with_freshness_tolerance(
297297
return ret;
298298
};
299299
// use std::views::concat after C++26
300-
bool should_fallback = std::ranges::any_of(_tablet_meta->all_rs_metas(),
301-
should_be_visible_but_not_warmed_up) ||
302-
std::ranges::any_of(_tablet_meta->all_stale_rs_metas(),
303-
should_be_visible_but_not_warmed_up);
300+
bool should_fallback =
301+
std::ranges::any_of(std::views::values(_tablet_meta->all_rs_metas()),
302+
should_be_visible_but_not_warmed_up) ||
303+
std::ranges::any_of(std::views::values(_tablet_meta->all_stale_rs_metas()),
304+
should_be_visible_but_not_warmed_up);
304305
if (should_fallback) {
305306
rlock.unlock();
306307
g_capture_with_freshness_tolerance_fallback_count << 1;
@@ -983,7 +984,7 @@ int64_t CloudTablet::get_cloud_base_compaction_score() const {
983984
bool has_delete = false;
984985
int64_t point = cumulative_layer_point();
985986
std::shared_lock<std::shared_mutex> rlock(_meta_lock);
986-
for (const auto& rs_meta : _tablet_meta->all_rs_metas()) {
987+
for (const auto& [_, rs_meta] : _tablet_meta->all_rs_metas()) {
987988
if (rs_meta->start_version() >= point) {
988989
continue;
989990
}

0 commit comments

Comments
 (0)