Skip to content

Conversation

@zhangstar333
Copy link
Contributor

What problem does this PR solve?

Problem Summary:
cherry-pick from master (#54137)

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

…pache#54137)

Problem Summary:
```
doris_be: /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511: void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char *>, HashCRC32<doris::vectorized::UInt8>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>>::constructor::operator()(Args &&...) const [Policy = phmap::priv::FlatHashMapPolicy<unsigned char, char *>, Hash = HashCRC32<doris::vectorized::UInt8>, Eq = phmap::EqualTo<unsigned char>, Alloc = doris::vectorized::Allocator_<std::pair<const unsigned char, char *>>, Args = <unsigned char &, std::nullptr_t>]: Assertion `*slot_' failed.
*** Query id: 6bda59ac672d4496-bcf117ae8ce3f894 ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1753928330 (unix time) try "date -d @1753928330" if you are using GNU date ***
*** Current BE git commitID: 9634891 ***
*** SIGABRT unknown detail explain (@0x3ef003cad02) received by PID 3976450 (TID 3979645 OR 0x7fad84c15700) from PID 3976450; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/disk8/zhangsida/doris/be/src/common/signal_handler.h:420
 1# 0x00007FAF620E25B0 in /lib64/libc.so.6
 2# __GI_raise in /lib64/libc.so.6
 3# __GI_abort in /lib64/libc.so.6
 4# _nl_load_domain.cold.0 in /lib64/libc.so.6
 5# 0x00007FAF620DAE86 in /lib64/libc.so.6
 6# void phmap::priv::raw_hash_set<phmap::priv::FlatHashMapPolicy<unsigned char, char*>, HashCRC32<unsigned char>, phmap::EqualTo<unsigned char>, doris::vectorized::Allocator_<std::pair<unsigned char const, char*> > >::constructor::operator()<unsigned char&, decltype(nullptr)>(unsigned char&, decltype(nullptr)&&) const at /mnt/disk8/zhangsida/doris/thirdparty/installed/include/parallel_hashmap/phmap.h:1511
 7# _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIbEEON5doris10vectorized8OverloadIJZNS5_8pipeline17AggSinkLocalState30_emplace_into_hash_table_limitEPPcPNS6_5BlockERKSt6vectorIiSaIiEERSE_IPKNS6_7IColumnESaISL_EEjE3$_0ZNS9_30_emplace_into_hash_table_limitESB_SD_SI_SO_jE3$_1EEERSt7variantIJSt9monostateNS6_16MethodSerializedI9PHHashMapINS5_9StringRefESA_11DefaultHashISX_vEEEENS6_15MethodOneNumberIhSW_IhSA_9HashCRC32IhEEEENS12_ItSW_ItSA_S13_ItEEEENS12_IjSW_IjSA_S13_IjEEEENS12_ImSW_ImSA_S13_ImEEEENS6_19MethodStringNoCacheINS5_13StringHashMapISA_NS5_9AllocatorILb1ELb1ELb0ENS5_22DefaultMemoryAllocatorELb1EEEEEEENS12_IN4wide7integerILm128EjEESW_IS1P_SA_S13_IS1P_EEEENS12_INS1O_ILm256EjEESW_IS1T_SA_S13_IS1T_EEEENS12_IjSW_IjSA_14HashMixWrapperIjS1A_EEEENS12_ImSW_ImSA_S1X_ImS1D_EEEENS6_26MethodSingleNullableColumnINS12_IhNS6_15DataWithNullKeyIS15_EEEEEENS24_INS12_ItNS25_IS18_EEEEEENS24_INS12_IjNS25_IS1B_EEEEEENS24_INS12_ImNS25_IS1E_EEEEEENS24_INS12_IjNS25_IS1Z_EEEEEENS24_INS12_ImNS25_IS22_EEEEEENS24_INS12_IS1P_NS25_IS1R_EEEEEENS24_INS12_IS1T_NS25_IS1V_EEEEEENS24_INS1G_INS25_IS1L_EEEEEENS6_15MethodKeysFixedIS1E_EENS2X_IS1R_EENS2X_IS1V_EENS2X_ISW_INS6_7UInt136ESA_S13_IS31_EEEEEEEJEEESt16integer_sequenceImJLm11EEEE14__visit_invokeESS_S36_ at /mnt/disk8/zhangsida/install_data/ldb_toolchain_robin/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/variant:1032
 8# doris::pipeline::AggSinkLocalState::_emplace_into_hash_table_limit(char**, doris::vectorized::Block*, std::vector<int, std::allocator<int> > const&, std::vector<doris::vectorized::IColumn const*, std::allocator<doris::vectorized::IColumn const*> >&, unsigned int) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:584
 9# doris::Status doris::pipeline::AggSinkLocalState::_execute_with_serialized_key_helper<true>(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:496
10# doris::pipeline::AggSinkLocalState::_execute_with_serialized_key(doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.cpp:443
11# doris::pipeline::AggSinkLocalState::Executor<false, false>::execute(doris::pipeline::AggSinkLocalState*, doris::vectorized::Block*) at /mnt/disk8/zhangsida/doris/be/src/pipeline/exec/aggregation_sink_operator.h:62
```

```
                                try {
                                    HashMethodType::try_presis_key_and_origin(key, origin,
                                                                              _agg_arena_pool);
                                    auto mapped =
                                            _shared_state->aggregate_data_container->append_data(
                                                    origin);
                                    auto st = _create_agg_status(mapped);
                                    if (!st) {
                                        throw Exception(st.code(), st.to_string());
                                    }
                                    ctor(key, mapped);
                                   _shared_state->refresh_top_limit(i, key_columns);
                                } catch (...) {
                                    // Exception-safety - if it can not allocate memory or create status,
                                    // the destructors will not be called.
                                    ctor(key, nullptr);
                                    throw;
                                }
```

when _shared_state->refresh_top_limit(i, key_columns); throw exception
will exectue ctor(key, nullptr);, but before have exectue ctor(key,
mapped)

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 -->
@Thearas
Copy link
Contributor

Thearas commented Aug 4, 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?

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17593	6901	6677	6677
q2	2081	209	174	174
q3	10572	1108	1151	1108
q4	10446	707	691	691
q5	7762	2808	2791	2791
q6	216	136	130	130
q7	981	619	610	610
q8	9361	1963	1994	1963
q9	6676	6397	6427	6397
q10	7030	2227	2263	2227
q11	459	260	256	256
q12	410	208	219	208
q13	17786	2992	2978	2978
q14	235	214	213	213
q15	519	460	476	460
q16	487	378	373	373
q17	958	598	641	598
q18	7261	6688	6631	6631
q19	1389	1099	970	970
q20	486	193	203	193
q21	4127	3209	3123	3123
q22	1136	1002	1017	1002
Total cold run time: 107971 ms
Total hot run time: 39773 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6689	6554	6780	6554
q2	326	233	228	228
q3	2878	2932	2908	2908
q4	2089	1833	1768	1768
q5	5686	5733	5735	5733
q6	209	130	130	130
q7	2280	1809	1780	1780
q8	3366	3528	3577	3528
q9	8810	8946	8811	8811
q10	3558	3534	3544	3534
q11	594	487	524	487
q12	786	591	628	591
q13	8414	3222	3182	3182
q14	300	277	267	267
q15	503	461	453	453
q16	498	441	446	441
q17	1835	1630	1608	1608
q18	8180	7729	7633	7633
q19	1745	1476	1636	1476
q20	2048	1804	1832	1804
q21	5264	5099	5141	5099
q22	1111	1054	1010	1010
Total cold run time: 67169 ms
Total hot run time: 59025 ms

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 41.89% (11135/26582)
Line Coverage 32.42% (95387/294248)
Region Coverage 31.56% (49274/156127)
Branch Coverage 28.00% (25254/90198)

@doris-robot
Copy link

TPC-DS: Total hot run time: 195275 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 4409e135d28c6d9c33ea1c1f7ba466721315e1a4, data reload: false

query1	1279	895	896	895
query2	6349	1904	1831	1831
query3	10972	4460	4611	4460
query4	33461	23902	23417	23417
query5	4306	446	439	439
query6	273	168	172	168
query7	3992	313	318	313
query8	273	215	219	215
query9	9559	2570	2561	2561
query10	489	263	259	259
query11	18075	15248	15226	15226
query12	155	104	102	102
query13	1538	430	413	413
query14	9060	6776	6778	6776
query15	222	193	174	174
query16	7783	519	517	517
query17	1636	611	614	611
query18	2030	341	314	314
query19	213	168	174	168
query20	128	118	121	118
query21	204	108	111	108
query22	4838	4511	4464	4464
query23	35246	34626	34290	34290
query24	12617	2947	2944	2944
query25	765	426	426	426
query26	2155	182	172	172
query27	2998	354	343	343
query28	7678	2163	2138	2138
query29	1161	467	459	459
query30	262	160	159	159
query31	1059	838	844	838
query32	92	57	57	57
query33	763	304	301	301
query34	935	494	506	494
query35	880	744	702	702
query36	1093	945	961	945
query37	207	68	71	68
query38	4094	4010	3948	3948
query39	1530	1461	1499	1461
query40	259	101	107	101
query41	55	50	49	49
query42	113	99	104	99
query43	517	487	466	466
query44	1348	802	788	788
query45	189	169	166	166
query46	1159	729	746	729
query47	2024	1916	1896	1896
query48	472	388	396	388
query49	1000	426	409	409
query50	851	407	412	407
query51	7511	7239	7396	7239
query52	100	90	90	90
query53	263	181	183	181
query54	1260	475	464	464
query55	87	74	81	74
query56	264	259	254	254
query57	1331	1222	1209	1209
query58	231	215	204	204
query59	3230	2948	2903	2903
query60	285	258	269	258
query61	115	151	163	151
query62	838	688	687	687
query63	230	197	196	196
query64	5426	686	636	636
query65	3382	3306	3195	3195
query66	1291	297	307	297
query67	15914	15630	15851	15630
query68	4672	596	579	579
query69	433	262	275	262
query70	1149	1108	1099	1099
query71	350	253	250	250
query72	6230	2491	3905	2491
query73	760	347	355	347
query74	10582	8947	9096	8947
query75	3409	2656	2680	2656
query76	2619	1099	1129	1099
query77	410	303	280	280
query78	10575	9692	9501	9501
query79	1701	602	576	576
query80	1142	423	426	423
query81	553	217	220	217
query82	969	93	91	91
query83	239	146	143	143
query84	235	84	84	84
query85	1383	301	290	290
query86	443	299	285	285
query87	4357	4213	4293	4213
query88	3393	2379	2314	2314
query89	411	291	292	291
query90	1935	187	185	185
query91	187	154	147	147
query92	68	51	53	51
query93	1866	548	546	546
query94	860	290	287	287
query95	369	256	257	256
query96	634	278	284	278
query97	3267	3161	3162	3161
query98	219	205	193	193
query99	1525	1273	1296	1273
Total cold run time: 307060 ms
Total hot run time: 195275 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.23	0.06	0.06
query4	1.66	0.10	0.10
query5	0.54	0.52	0.51
query6	1.13	0.73	0.73
query7	0.02	0.02	0.01
query8	0.04	0.03	0.02
query9	0.57	0.51	0.50
query10	0.55	0.56	0.55
query11	0.14	0.10	0.10
query12	0.14	0.10	0.11
query13	0.61	0.60	0.60
query14	0.77	0.80	0.79
query15	0.85	0.82	0.83
query16	0.40	0.39	0.39
query17	1.03	1.01	1.06
query18	0.24	0.21	0.22
query19	1.96	1.88	1.79
query20	0.02	0.01	0.02
query21	15.38	0.59	0.58
query22	2.37	2.03	1.51
query23	17.05	1.12	0.81
query24	3.56	0.74	2.13
query25	0.26	0.20	0.19
query26	0.27	0.14	0.14
query27	0.04	0.05	0.05
query28	9.46	0.54	0.44
query29	12.54	3.26	3.22
query30	0.25	0.06	0.06
query31	2.85	0.38	0.38
query32	3.22	0.46	0.46
query33	2.92	3.00	3.00
query34	17.21	4.49	4.54
query35	4.55	4.57	4.59
query36	0.66	0.52	0.47
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.02	0.02
query40	0.16	0.12	0.12
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 104.1 s
Total hot run time: 29.77 s

@zhangstar333 zhangstar333 force-pushed the branch-3.0-0804 branch 2 times, most recently from 11952ca to 4409e13 Compare August 4, 2025 07:47
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.95% (19664/26236)
Line Coverage 68.21% (200455/293883)
Region Coverage 66.34% (119968/180829)
Branch Coverage 59.69% (60868/101978)

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 568a8d0 into apache:branch-3.0 Sep 5, 2025
34 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants