Skip to content

Conversation

@mrhhsg
Copy link
Member

@mrhhsg mrhhsg commented May 22, 2025

What problem does this PR solve?

Pick #50720 #50993 #51124

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

mrhhsg and others added 4 commits May 22, 2025 15:19
…_flags (apache#50993) (apache#51089)

Pick apache#50993

Introduced by apache#51050

The build block maybe be `clear_column_mem_not_keep` in build phase when
the operator is closed.

```cpp
Status HashJoinBuildSinkLocalState::close(RuntimeState* state, Status exec_status) {
    if (_closed) {
        return Status::OK();
    }
    auto& p = _parent->cast<HashJoinBuildSinkOperatorX>();
    Defer defer {[&]() {
        if (!_should_build_hash_table) {
            return;
        }
        // The build side hash key column maybe no need output, but we need to keep the column in block
        // because it is used to compare with probe side hash key column

        if (p._should_keep_hash_key_column && _build_col_ids.size() == 1) {
            p._should_keep_column_flags[_build_col_ids[0]] = true;
        }

        if (_shared_state->build_block) {
            // release the memory of unused column in probe stage
            _shared_state->build_block->clear_column_mem_not_keep(p._should_keep_column_flags,
                                                                  p._use_shared_hash_table);
        }

        if (p._use_shared_hash_table) {
            std::unique_lock lock(p._mutex);
            p._signaled = true;
            for (auto& dep : _shared_state->sink_deps) {
                dep->set_ready();
            }
            for (auto& dep : p._finish_dependencies) {
                dep->set_ready();
            }
        }
    }};
```

```
*** Aborted at 1747343165 (unix time) try "date -d @1747343165" if you are using GNU date ***
*** Current BE git commitID: e7a3e78 ***
*** SIGSEGV address not mapped to object (@0x1) received by PID 7474 (TID 9641 OR 0x7f3f8c0e5640) from PID 1; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/doris/be/src/common/signal_handler.h:421
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so
 3# 0x00007F4368F76520 in /lib/x86_64-linux-gnu/libc.so.6
 4# doris::Status doris::pipeline::ProcessHashTableProbe<7>::finish_probing > > >(doris::vectorized::MethodKeysFixed > >&, doris::vectorized::MutableBlock&, doris::vectorized::Block*, bool*, bool) at /root/doris/be/src/pipeline/exec/join/process_hash_table_probe_impl.h:738
 5# std::__detail::__variant::__gen_vtable_impl (*)(doris::pipeline::HashJoinProbeOperatorX::pull(doris::RuntimeState*, doris::vectorized::Block*, bool*) const::$_1&&, std::variant > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber, doris::JoinHashTable, HashCRC32 > > >, doris::vectorized::MethodOneNumber, doris::JoinHashTable, HashCRC32 > > >, doris::vectorized::MethodKeysFixed > >, doris::vectorized::MethodKeysFixed, HashCRC32 > > >, doris::vectorized::MethodKeysFixed > >, doris::vectorized::MethodKeysFixed, HashCRC32 > > >, doris::vectorized::MethodStringNoCache > > >&, std::variant, doris::pipeline::ProcessHashTableProbe<2>, doris::pipeline::ProcessHashTableProbe<8>, doris::pipeline::ProcessHashTableProbe<1>, doris::pipeline::ProcessHashTableProbe<4>, doris::pipeline::ProcessHashTableProbe<3>, doris::pipeline::ProcessHashTableProbe<7>, doris::pipeline::ProcessHashTableProbe<9>, doris::pipeline::ProcessHashTableProbe<10>, doris::pipeline::ProcessHashTableProbe<11> >&)>, std::integer_sequence >::__visit_invoke(doris::pipeline::HashJoinProbeOperatorX::pull(doris::RuntimeState*, doris::vectorized::Block*, bool*) const::$_1&&, std::variant > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber > >, doris::vectorized::MethodOneNumber, doris::JoinHashTable, HashCRC32 > > >, doris::vectorized::MethodOneNumber, doris::JoinHashTable, HashCRC32 > > >, doris::vectorized::MethodKeysFixed > >, doris::vectorized::MethodKeysFixed, HashCRC32 > > >, doris::vectorized::MethodKeysFixed > >, doris::vectorized::MethodKeysFixed, HashCRC32 > > >, doris::vectorized::MethodStringNoCache > > >&, std::variant, doris::pipeline::ProcessHashTableProbe<2>, doris::pipeline::ProcessHashTableProbe<8>, doris::pipeline::ProcessHashTableProbe<1>, doris::pipeline::ProcessHashTableProbe<4>, doris::pipeline::ProcessHashTableProbe<3>, doris::pipeline::ProcessHashTableProbe<7>, doris::pipeline::ProcessHashTableProbe<9>, doris::pipeline::ProcessHashTableProbe<10>, doris::pipeline::ProcessHashTableProbe<11> >&) at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/variant:1013
 6# doris::pipeline::HashJoinProbeOperatorX::pull(doris::RuntimeState*, doris::vectorized::Block*, bool*) const at /root/doris/be/src/pipeline/exec/hashjoin_probe_operator.cpp:281
 7# doris::pipeline::StatefulOperatorX::get_block(doris::RuntimeState*, doris::vectorized::Block*, bool*) at /root/doris/be/src/pipeline/exec/operator.cpp:670
 8# doris::pipeline::OperatorXBase::get_block_after_projects(doris::RuntimeState*, doris::vectorized::Block*, bool*) at /root/doris/be/src/pipeline/exec/operator.cpp:381
 9# doris::pipeline::PipelineTask::execute(bool*) in /mnt/hdd01/ci/doris-deploy-master-local/be/lib/doris_be
10# doris::pipeline::TaskScheduler::_do_work(int) at /root/doris/be/src/pipeline/task_scheduler.cpp:144
11# doris::ThreadPool::dispatch_thread() at /root/doris/be/src/util/threadpool.cpp:622
12# doris::Thread::supervise_thread(void*) at /root/doris/be/src/util/thread.cpp:469
13# start_thread at ./nptl/pthread_create.c:442
14# 0x00007F436905A850 at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:83
```

Related PR: #xxx

Problem Summary:

None

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change. - [ ] No code files have been
changed. - [ ] Other reason <!-- Add your reason? -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@mrhhsg mrhhsg requested a review from dataroaring as a code owner May 22, 2025 07:50
@Thearas
Copy link
Contributor

Thearas commented May 22, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@mrhhsg
Copy link
Member Author

mrhhsg commented May 22, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39527 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 05c0c42ff07f7d001808c0350739221eeee7d5ad, data reload: false

------ Round 1 ----------------------------------
q1	17596	7596	6580	6580
q2	2079	168	172	168
q3	10554	1077	1184	1077
q4	10551	718	719	718
q5	7748	2837	2821	2821
q6	209	134	131	131
q7	985	617	604	604
q8	9353	1941	2031	1941
q9	6592	6445	6363	6363
q10	7037	2243	2284	2243
q11	473	260	254	254
q12	402	210	201	201
q13	17805	2978	2984	2978
q14	238	199	201	199
q15	489	466	462	462
q16	474	375	368	368
q17	978	581	486	486
q18	7257	6728	6629	6629
q19	1388	1045	1076	1045
q20	466	196	207	196
q21	3994	3065	3100	3065
q22	1058	1020	998	998
Total cold run time: 107726 ms
Total hot run time: 39527 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6596	6557	6544	6544
q2	332	233	234	233
q3	2860	2759	2879	2759
q4	2053	1784	1812	1784
q5	5783	5732	5699	5699
q6	213	127	125	125
q7	2279	1827	1815	1815
q8	3372	3562	3524	3524
q9	8996	8744	8940	8744
q10	3539	3507	3510	3507
q11	595	489	507	489
q12	840	611	632	611
q13	9385	3130	3204	3130
q14	290	271	256	256
q15	502	461	460	460
q16	501	463	445	445
q17	1831	1615	1640	1615
q18	8290	7845	7693	7693
q19	1701	1632	1479	1479
q20	2123	1837	1831	1831
q21	5052	4992	5021	4992
q22	1091	1099	1072	1072
Total cold run time: 68224 ms
Total hot run time: 58807 ms

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/130) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 41.07% (10860/26444)
Line Coverage 31.88% (92734/290929)
Region Coverage 30.96% (47833/154492)
Branch Coverage 27.43% (24488/89272)

@doris-robot
Copy link

TPC-DS: Total hot run time: 197030 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 05c0c42ff07f7d001808c0350739221eeee7d5ad, data reload: false

query1	1278	903	914	903
query2	6338	1957	1904	1904
query3	10821	4382	4255	4255
query4	60915	28929	23443	23443
query5	5204	438	423	423
query6	405	181	178	178
query7	5476	326	308	308
query8	310	222	223	222
query9	8309	2616	2601	2601
query10	475	264	256	256
query11	17966	15374	16197	15374
query12	165	98	101	98
query13	1448	435	424	424
query14	9866	7261	7194	7194
query15	201	196	176	176
query16	7267	459	500	459
query17	1207	591	594	591
query18	1883	334	315	315
query19	200	160	162	160
query20	116	121	112	112
query21	207	104	106	104
query22	4791	4480	4676	4480
query23	34761	34440	34104	34104
query24	6108	2913	2876	2876
query25	539	429	427	427
query26	652	165	169	165
query27	1804	360	377	360
query28	4224	2168	2161	2161
query29	708	465	469	465
query30	236	159	151	151
query31	946	801	823	801
query32	69	55	57	55
query33	499	289	285	285
query34	991	509	532	509
query35	828	742	722	722
query36	1107	954	981	954
query37	111	69	71	69
query38	3999	4005	3917	3917
query39	1504	1492	1502	1492
query40	201	102	96	96
query41	49	48	47	47
query42	110	98	107	98
query43	534	509	481	481
query44	1155	793	800	793
query45	184	166	170	166
query46	1153	713	720	713
query47	2071	1919	1960	1919
query48	497	385	403	385
query49	766	422	396	396
query50	847	429	431	429
query51	7536	7255	7342	7255
query52	105	90	94	90
query53	274	185	185	185
query54	572	460	487	460
query55	79	77	79	77
query56	266	246	249	246
query57	1257	1151	1142	1142
query58	232	226	220	220
query59	3208	3083	3077	3077
query60	274	248	250	248
query61	114	140	105	105
query62	771	654	670	654
query63	219	184	189	184
query64	1405	658	622	622
query65	3285	3167	3223	3167
query66	632	303	299	299
query67	15890	15711	15713	15711
query68	4196	576	559	559
query69	418	266	256	256
query70	1178	1126	1105	1105
query71	330	259	258	258
query72	6397	4108	3986	3986
query73	762	342	355	342
query74	10364	9227	9075	9075
query75	3335	2660	2643	2643
query76	1991	1135	940	940
query77	515	281	281	281
query78	10572	9616	9543	9543
query79	2123	595	600	595
query80	1333	404	439	404
query81	504	223	227	223
query82	1241	84	86	84
query83	159	169	140	140
query84	277	80	79	79
query85	977	301	283	283
query86	364	303	310	303
query87	4397	4174	4250	4174
query88	3940	2414	2363	2363
query89	419	283	287	283
query90	1888	180	183	180
query91	179	150	147	147
query92	61	46	48	46
query93	2827	551	538	538
query94	713	292	303	292
query95	362	265	251	251
query96	618	282	277	277
query97	3344	3189	3136	3136
query98	217	205	201	201
query99	1644	1300	1285	1285
Total cold run time: 315265 ms
Total hot run time: 197030 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.69 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 05c0c42ff07f7d001808c0350739221eeee7d5ad, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.07
query4	1.63	0.10	0.10
query5	0.51	0.49	0.51
query6	1.14	0.72	0.72
query7	0.03	0.04	0.02
query8	0.04	0.03	0.03
query9	0.56	0.50	0.50
query10	0.54	0.54	0.55
query11	0.14	0.10	0.11
query12	0.14	0.12	0.11
query13	0.61	0.59	0.59
query14	0.77	0.80	0.78
query15	0.84	0.83	0.81
query16	0.36	0.38	0.40
query17	1.06	1.04	1.07
query18	0.25	0.22	0.22
query19	1.99	1.90	1.87
query20	0.01	0.01	0.01
query21	15.40	0.59	0.58
query22	3.54	3.06	1.80
query23	16.91	0.92	0.91
query24	3.49	1.57	1.48
query25	0.18	0.16	0.03
query26	0.61	0.13	0.14
query27	0.05	0.04	0.06
query28	9.11	0.51	0.53
query29	12.59	3.27	3.19
query30	0.25	0.06	0.07
query31	2.84	0.38	0.37
query32	3.26	0.45	0.47
query33	3.03	2.94	3.00
query34	17.17	4.45	4.47
query35	4.52	4.54	4.57
query36	0.70	0.47	0.48
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.03
query40	0.17	0.14	0.12
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.09 s
Total hot run time: 30.69 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dataroaring dataroaring merged commit ea52c3f into apache:branch-3.0 Jun 11, 2025
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants