Skip to content

Commit 29d73cf

Browse files
authored
Merge branch 'main' into murphy_ref_exec_mem_limit
Signed-off-by: Murphy <[email protected]>
2 parents 7c670e3 + 3acc890 commit 29d73cf

File tree

1,218 files changed

+36834
-10133
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,218 files changed

+36834
-10133
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ If yes, please specify the type of change:
3232
- [ ] I have added test cases for my bug fix or my new feature
3333
- [ ] This pr needs user documentation (for new or modified features or behaviors)
3434
- [ ] I have added documentation for my new feature or new function
35+
- [ ] This is a backport pr
3536

3637
## Bugfix cherry-pick branch check:
37-
3838
- [ ] I have checked the version labels which the pr will be auto-backported to the target branch
3939
- [ ] 3.2
4040
- [ ] 3.1

.github/workflows/ci-doc-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686

8787
- uses: articulate/[email protected]
8888
with:
89-
config: "docs/.markdownlint.yaml"
89+
config: "docs/.markdownlint.json"
9090
files: 'docs/**/*.md'
9191
ignore: node_modules
9292
version: 0.28.1

.github/workflows/inspection-pipeline.yml

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ on:
77
- cron: "30 8 * * 1-5"
88
- cron: "30 10 * * 1-5"
99
workflow_dispatch:
10-
11-
concurrency:
12-
group: 'INSPECTION-MAIN'
13-
cancel-in-progress: false
10+
inputs:
11+
BRANCH:
12+
description: 'BRANCH'
13+
required: true
14+
type: string
15+
COMMIT_ID:
16+
description: 'COMMIT ID'
17+
required: true
18+
type: string
19+
TAR_PATH:
20+
description: 'TAR PATH'
21+
required: true
22+
type: string
1423

1524
permissions:
1625
checks: write
@@ -30,7 +39,7 @@ jobs:
3039

3140
be-ut:
3241
runs-on: [self-hosted, normal]
33-
if: github.repository == 'StarRocks/starrocks'
42+
if: github.event_name == 'schedule' && github.repository == 'StarRocks/starrocks'
3443
timeout-minutes: 180
3544
name: BE UT
3645
env:
@@ -68,7 +77,7 @@ jobs:
6877
fe-ut:
6978
runs-on: [self-hosted, normal]
7079
name: FE UT
71-
if: github.repository == 'StarRocks/starrocks'
80+
if: github.event_name == 'schedule' && github.repository == 'StarRocks/starrocks'
7281
env:
7382
BRANCH: 'main'
7483
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -147,7 +156,7 @@ jobs:
147156
build:
148157
runs-on: [self-hosted, normal]
149158
name: BUILD
150-
if: github.repository == 'StarRocks/starrocks'
159+
if: github.event_name == 'schedule' && github.repository == 'StarRocks/starrocks'
151160
env:
152161
BRANCH: 'main'
153162
outputs:
@@ -187,7 +196,10 @@ jobs:
187196
188197
deploy:
189198
runs-on: [self-hosted, normal]
190-
if: always() && needs.build.result == 'success'
199+
if: >
200+
always() &&
201+
((github.event_name == 'schedule' && needs.build.result == 'success') ||
202+
github.event_name != 'schedule')
191203
needs: build
192204
name: DEPLOY SR
193205
env:
@@ -198,12 +210,31 @@ jobs:
198210
fe: ${{steps.deploy_sr.outputs.fe}}
199211
be: ${{steps.deploy_sr.outputs.be}}
200212
deploy_conf_file: ${{steps.apply_resource.outputs.deploy_conf_file}}
213+
pr_number: ${{steps.init_params.outputs.PR_NUMBER}}
214+
base_version: ${{steps.init_params.outputs.BASE_VERSION}}
215+
branch: ${{steps.init_params.outputs.BRANCH}}
201216
steps:
202217
- name: Clean Workspace
203218
uses: AutoModality/[email protected]
204219

220+
- name: init params
221+
id: init_params
222+
run: |
223+
if [[ "${{ github.event_name }}" == "schedule" ]]; then
224+
echo "PR_NUMBER=${{ needs.build.outputs.pr_number }}" >> $GITHUB_OUTPUT
225+
echo "BRANCH=main" >> $GITHUB_OUTPUT
226+
echo "BASE_VERSION=${{ needs.build.outputs.base_version }}" >> $GITHUB_OUTPUT
227+
else
228+
echo "PR_NUMBER=${{ inputs.COMMIT_ID }}" >> $GITHUB_OUTPUT
229+
echo "BRANCH=${{ inputs.BRANCH }}" >> $GITHUB_OUTPUT
230+
echo "TAR_PATH=${{ inputs.TAR_PATH }}" >> $GITHUB_OUTPUT
231+
echo "BASE_VERSION=${{ inputs.COMMIT_ID }}" >> $GITHUB_OUTPUT
232+
fi
233+
205234
- name: Apply for resources
206235
id: apply_resource
236+
env:
237+
PR_NUMBER: ${{ steps.init_params.outputs.PR_NUMBER }}
207238
run: |
208239
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
209240
./bin/elastic-cluster.sh --template ci-admit
@@ -212,13 +243,24 @@ jobs:
212243
213244
- name: Deploy SR
214245
id: deploy_sr
246+
env:
247+
PR_NUMBER: ${{ steps.init_params.outputs.PR_NUMBER }}
248+
BRANCH: ${{ steps.init_params.outputs.BRANCH }}
249+
TAR_PATH: ${{ steps.init_params.outputs.TAR_PATH }}
215250
run: |
216251
cd ci-tool && source lib/init.sh
217-
repo="${{ github.repository }}"
218-
bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'`
219-
tar_path="oss://${bucket_prefix}-ci-release/$BRANCH/Release/pr/${{needs.build.outputs.build_output_tar}}"
252+
253+
if [[ "${{ github.event_name }}" == "schedule" ]]; then
254+
repo="${{ github.repository }}"
255+
bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'`
256+
tar_path="oss://${bucket_prefix}-ci-release/$BRANCH/Release/pr/${{needs.build.outputs.build_output_tar}}"
257+
with_cov="--with-coverage"
258+
else
259+
tar_path=${TAR_PATH}
260+
fi
261+
220262
echo ${tar_path}
221-
./bin/deploy-cluster.sh -c ${CLUSTER_NAME} --output ${tar_path} --with-coverage
263+
./bin/deploy-cluster.sh -c ${CLUSTER_NAME} --output ${tar_path} ${with_cov}
222264
223265
- run: |
224266
echo "FE: ${{ steps.deploy_sr.outputs.fe }}, BE: ${{ steps.deploy_sr.outputs.be }}"
@@ -231,16 +273,16 @@ jobs:
231273
SQL-Tester:
232274
runs-on: [self-hosted, normal]
233275
name: SQL-Tester
234-
needs: [ build, deploy ]
276+
needs: [ deploy ]
235277
if: always() && needs.deploy.result == 'success'
236278
timeout-minutes: 60
237279
env:
238-
PR_NUMBER: ${{ needs.build.outputs.pr_number }}
280+
PR_NUMBER: ${{ needs.deploy.outputs.pr_number }}
239281
CLUSTER_NAME: ci-admit
240282
FE_NODE: ${{ needs.deploy.outputs.fe }}
241283
BE_NODE: ${{ needs.deploy.outputs.be }}
242-
BASE_VERSION: ${{needs.build.outputs.base_version}}
243-
BRANCH: 'main'
284+
BASE_VERSION: ${{needs.deploy.outputs.base_version}}
285+
BRANCH: ${{needs.deploy.outputs.branch}}
244286
outputs:
245287
MYSQL_ECI_ID: ${{ steps.run_case.outputs.MYSQL_ECI_ID }}
246288
steps:
@@ -306,7 +348,7 @@ jobs:
306348
runs-on: [self-hosted, normal]
307349
name: ADMIT TEST
308350
needs: [ build, deploy, SQL-Tester ]
309-
if: always() && needs.deploy.result == 'success'
351+
if: always() && github.event_name == 'schedule' && needs.deploy.result == 'success'
310352
timeout-minutes: 40
311353
env:
312354
PR_NUMBER: ${{ needs.build.outputs.pr_number }}
@@ -390,7 +432,7 @@ jobs:
390432
./bin/elastic-cluster.sh --renew 0.5
391433
392434
- name: save unstable cases
393-
if: always()
435+
if: always() && github.event_name == 'schedule'
394436
run: |
395437
cd ci-tool && source lib/init.sh
396438
./bin/save_unstable_cases.sh

.github/workflows/pr-checker.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,55 @@ jobs:
4242
steps:
4343
- run: echo "Normal PR."
4444

45+
- name: backport assign
46+
if: startsWith(github.head_ref, 'mergify/bp/') && github.event.action == 'opened'
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
PR_NUMBER: ${{ github.event.number }}
50+
REPO: ${{ github.repository }}
51+
run: |
52+
ORI_PR=$(echo "${{ github.event.pull_request.title }}" | grep -oP '\(backport #\K\d+' | tail -n 1)
53+
author=$(gh pr view ${ORI_PR} -R ${REPO} --json author -q '.author.login')
54+
if [[ ! "${author}" =~ "mergify" ]]; then
55+
gh pr edit ${PR_NUMBER} -R ${REPO} --add-assignee ${author}
56+
fi
57+
4558
title-check:
4659
runs-on: ubuntu-latest
4760
needs: sync-checker
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
PR_NUMBER: ${{ github.event.number }}
64+
REPO: ${{ github.repository }}
4865
steps:
4966
- uses: thehanimo/[email protected]
5067
with:
5168
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5269
pass_on_octokit_error: false
5370
configuration_path: ".github/pr-title-checker-config.json"
5471

72+
- name: update body
73+
if: always() && github.base_ref != 'main' && github.event.action == 'opened'
74+
env:
75+
GH_TOKEN: ${{ secrets.PAT }}
76+
run: |
77+
gh pr view ${PR_NUMBER} -R ${REPO} --json body -q .body > body.txt
78+
ori_body=$(cat body.txt)
79+
sed -i "s#\[ \] This is a backport pr#\[x\] This is a backport pr#g" body.txt
80+
if [[ "${ori_body}" != $(cat body.txt) ]]; then
81+
gh pr edit ${PR_NUMBER} -R ${REPO} -F body.txt
82+
fi
83+
84+
- name: check backport pr's title
85+
if: github.base_ref != 'main' && contains(toJson(github.event.pull_request.body), '[x] This is a backport pr')
86+
run: |
87+
PR_TITLE=$(echo "${{ github.event.pull_request.title }}")
88+
count=$(echo $PR_TITLE | grep -E '\(backport #[0-9]+)$' | wc -l)
89+
if [[ $count -le 0 ]]; then
90+
echo "::error::Backport PR title is not valid. It should end with '(backport #[0-9]+)'"
91+
exit 1
92+
fi
93+
5594
backport-check:
5695
needs: title-check
5796
runs-on: ubuntu-latest
@@ -134,7 +173,9 @@ jobs:
134173
(!contains(toJson(github.event.pull_request.body), '[ ] No, this PR will not result in a change in behavior') &&
135174
!contains(toJson(github.event.pull_request.body), '[x] No, this PR will not result in a change in behavior')) ||
136175
(contains(toJson(github.event.pull_request.body), '[x] Yes, this PR will result in a change in behavior') &&
137-
contains(toJson(github.event.pull_request.body), '[x] No, this PR will not result in a change in behavior'))
176+
contains(toJson(github.event.pull_request.body), '[x] No, this PR will not result in a change in behavior')) ||
177+
(contains(toJson(github.event.pull_request.body), '[ ] Yes, this PR will result in a change in behavior') &&
178+
contains(toJson(github.event.pull_request.body), '[ ] No, this PR will not result in a change in behavior'))
138179
run: |
139180
echo "::error::Please check the format of your pr body about the behavior change checkbox!"
140181
exit 1
@@ -193,7 +234,7 @@ jobs:
193234
with:
194235
token: ${{ secrets.PAT }}
195236
pull-request-number: ${{ github.event.pull_request.number }}
196-
merge-method: rebase
237+
merge-method: squash
197238

198239
changelist-check:
199240
runs-on: [self-hosted, normal]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ We welcome all kinds of contributions from the community, individuals and partne
106106

107107
1. See [Contributing.md](https://github.com/StarRocks/starrocks/blob/main/CONTRIBUTING.md) to get started.
108108
2. Set up StarRocks development environment:
109-
* [IDE Setup](https://docs.starrocks.io/en-us/main/developers/development-environment/ide-setup)
109+
* [IDE Setup](https://docs.starrocks.io/docs/developers/development-environment/ide-setup/)
110110
3. Understand our [GitHub workflow](https://github.com/StarRocks/community/blob/main/Contributors/guide/workflow.md) for opening a pull request; use this [PR Template](https://github.com/StarRocks/starrocks/blob/main/.github/PULL_REQUEST_TEMPLATE.md) when submitting a pull request.
111111
4. Pick a [good first issue](https://github.com/StarRocks/starrocks/labels/good%20first%20issue) and start contributing.
112112

@@ -121,6 +121,6 @@ We welcome all kinds of contributions from the community, individuals and partne
121121
This project is used by the following companies. Learn more about their use cases:
122122

123123
- [Airbnb](https://www.youtube.com/watch?v=AzDxEZuMBwM&ab_channel=StarRocks_labs)
124+
- [Tencent](https://www.starrocks.io/blog/tencent-unifies-their-gaming-analytics-with-starrocks)
124125
- [Trip.com](https://starrocks.medium.com/trip-com-starrocks-efficiently-supports-high-concurrent-queries-dramatically-reduces-labor-and-1e1921dd6bf8)
125-
- [Zepp Health](https://starrocks.io/blog/zeppheath)
126-
- [Lenovo](https://starrocks.io/blog/lenovo_en)
126+
- [Didi](https://www.starrocks.io/blog/reduced-80-cost-didis-journey-from-multiple-olap-engines-to-starrocks)

be/src/agent/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/agent")
2323

2424
add_library(Agent STATIC
2525
agent_server.cpp
26-
client_cache.cpp
2726
heartbeat_server.cpp
2827
task_worker_pool.cpp
2928
utils.cpp

be/src/agent/agent_server.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void AgentServer::Impl::init_or_die() {
158158
// But it seems that there's no limit for the number of tablets of a partition.
159159
// Since a large queue size brings a little overhead, a big one is chosen here.
160160
#ifdef BE_TEST
161-
BUILD_DYNAMIC_TASK_THREAD_POOL("publish_version", 1, 1, DEFAULT_DYNAMIC_THREAD_POOL_QUEUE_SIZE,
161+
BUILD_DYNAMIC_TASK_THREAD_POOL("publish_version", 1, 3, DEFAULT_DYNAMIC_THREAD_POOL_QUEUE_SIZE,
162162
_thread_pool_publish_version);
163163
#else
164164
int max_publish_version_worker_count = config::transaction_publish_version_worker_count;
@@ -177,9 +177,8 @@ void AgentServer::Impl::init_or_die() {
177177
BUILD_DYNAMIC_TASK_THREAD_POOL("drop", 1, config::drop_tablet_worker_count, std::numeric_limits<int>::max(),
178178
_thread_pool_drop);
179179

180-
BUILD_DYNAMIC_TASK_THREAD_POOL("create_tablet", config::create_tablet_worker_count,
181-
config::create_tablet_worker_count, std::numeric_limits<int>::max(),
182-
_thread_pool_create_tablet);
180+
BUILD_DYNAMIC_TASK_THREAD_POOL("create_tablet", 1, config::create_tablet_worker_count,
181+
std::numeric_limits<int>::max(), _thread_pool_create_tablet);
183182

184183
BUILD_DYNAMIC_TASK_THREAD_POOL("alter_tablet", 0, config::alter_tablet_worker_count,
185184
std::numeric_limits<int>::max(), _thread_pool_alter_tablet);

be/src/agent/agent_task.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "agent/task_signatures_manager.h"
2020
#include "boost/lexical_cast.hpp"
2121
#include "common/status.h"
22+
#include "io/io_profiler.h"
2223
#include "runtime/current_thread.h"
2324
#include "runtime/snapshot_loader.h"
2425
#include "service/backend_options.h"
@@ -305,6 +306,8 @@ void run_clone_task(const std::shared_ptr<CloneAgentTaskRequest>& agent_task_req
305306
const TCloneReq& clone_req = agent_task_req->task_req;
306307
AgentStatus status = STARROCKS_SUCCESS;
307308

309+
auto scope = IOProfiler::scope(IOProfiler::TAG_CLONE, clone_req.tablet_id);
310+
308311
// Return result to fe
309312
TStatus task_status;
310313
TFinishTaskRequest finish_task_request;
@@ -377,6 +380,9 @@ void run_clone_task(const std::shared_ptr<CloneAgentTaskRequest>& agent_task_req
377380
void run_storage_medium_migrate_task(const std::shared_ptr<StorageMediumMigrateTaskRequest>& agent_task_req,
378381
ExecEnv* exec_env) {
379382
const TStorageMediumMigrateReq& storage_medium_migrate_req = agent_task_req->task_req;
383+
384+
auto scope = IOProfiler::scope(IOProfiler::TAG_CLONE, storage_medium_migrate_req.tablet_id);
385+
380386
TStatusCode::type status_code = TStatusCode::OK;
381387
std::vector<std::string> error_msgs;
382388
TStatus task_status;

be/src/agent/finish_task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
#include "finish_task.h"
1616

17-
#include "agent/client_cache.h"
1817
#include "agent/status.h"
1918
#include "agent/utils.h"
2019
#include "common/logging.h"
20+
#include "runtime/exec_env.h"
2121
#include "util/starrocks_metrics.h"
2222

2323
namespace starrocks {
@@ -32,7 +32,7 @@ void finish_task(const TFinishTaskRequest& finish_task_request) {
3232
int32_t sleep_seconds = 1;
3333
int32_t max_retry_times = TASK_FINISH_MAX_RETRY;
3434

35-
MasterServerClient client(&g_frontend_service_client_cache);
35+
MasterServerClient client(ExecEnv::GetInstance()->frontend_client_cache());
3636

3737
while (try_time < max_retry_times) {
3838
StarRocksMetrics::instance()->finish_task_requests_total.increment(1);

be/src/agent/report_task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
#include "agent/report_task.h"
1616

17-
#include "agent/client_cache.h"
1817
#include "agent/utils.h"
18+
#include "runtime/exec_env.h"
1919

2020
namespace starrocks {
2121

2222
AgentStatus report_task(const TReportRequest& request, TMasterResult* result) {
23-
MasterServerClient client(&g_frontend_service_client_cache);
23+
MasterServerClient client(ExecEnv::GetInstance()->frontend_client_cache());
2424
return client.report(request, result);
2525
}
2626

be/src/block_cache/cache_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#pragma once
1616

17+
#include <cstdint>
1718
#include <string>
1819
#include <vector>
1920

be/src/column/binary_column.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void BinaryColumnBase<T>::append_value_multiple_times(const void* value, size_t
291291
template <typename T>
292292
void BinaryColumnBase<T>::_build_slices() const {
293293
if constexpr (std::is_same_v<T, uint32_t>) {
294-
CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow";
294+
DCHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow";
295295
}
296296

297297
DCHECK(_offsets.size() > 0);

0 commit comments

Comments
 (0)