Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #52042

### What problem does this PR solve?

This commit fixes an Undefined Behavior Sanitizer error triggered when
printing `PUniqueId` directly to an ostream.
Among the three types of unique IDs, `UniqueId`, `PUniqueId` (protobuf),
and `TUniqueId` (thrift),
only `UniqueId` has an overloaded `operator<<()`.
Attempting to stream the other two types leads to undefined behavior,
making the current approach error-prone.

Introduces a unified `print_id()` function for safely printing all
unique ID types (`UniqueId`, `PUniqueId`, `TUniqueId`).
It is recommended to use `print_id()` instead of streaming directly.
@github-actions github-actions bot requested a review from dataroaring as a code owner June 25, 2025 02:25
@hello-stephen
Copy link
Contributor

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?

@dataroaring dataroaring reopened this Jun 25, 2025
@hello-stephen
Copy link
Contributor

run buildall

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

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

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

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17760	7034	6695	6695
q2	2273	179	187	179
q3	11564	1190	1196	1190
q4	10303	746	753	746
q5	8502	2952	2848	2848
q6	216	133	136	133
q7	967	612	620	612
q8	9357	1972	2026	1972
q9	6731	6421	6390	6390
q10	6994	2269	2338	2269
q11	459	262	268	262
q12	404	216	219	216
q13	17787	3001	2997	2997
q14	239	209	209	209
q15	500	457	472	457
q16	480	403	381	381
q17	1011	638	596	596
q18	7467	6589	6649	6589
q19	1401	1119	1097	1097
q20	475	195	204	195
q21	3899	3082	3252	3082
q22	1089	1000	996	996
Total cold run time: 109878 ms
Total hot run time: 40111 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6589	7388	6542	6542
q2	325	236	243	236
q3	2900	2943	2975	2943
q4	2063	1764	1808	1764
q5	5717	5795	5699	5699
q6	202	122	123	122
q7	2151	1816	1800	1800
q8	3412	3536	3553	3536
q9	8883	8954	8924	8924
q10	3572	3550	3559	3550
q11	620	510	489	489
q12	800	580	606	580
q13	9611	3132	3132	3132
q14	300	282	265	265
q15	507	467	455	455
q16	488	425	434	425
q17	1854	1627	1607	1607
q18	8338	7833	7744	7744
q19	1712	1586	1668	1586
q20	2089	1866	1878	1866
q21	5129	4944	4803	4803
q22	1102	1046	992	992
Total cold run time: 68364 ms
Total hot run time: 59060 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 189897 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 2ec642848f83ad2f332c98bc8196b0b104dc4291, data reload: false

query1	983	381	379	379
query2	6516	1897	1826	1826
query3	6708	216	222	216
query4	33768	23424	23377	23377
query5	4341	455	451	451
query6	267	194	173	173
query7	4637	308	301	301
query8	275	225	231	225
query9	9676	2572	2552	2552
query10	456	296	266	266
query11	18164	15312	15095	15095
query12	158	101	102	101
query13	1641	419	410	410
query14	9714	7119	7197	7119
query15	253	170	193	170
query16	8020	472	485	472
query17	1635	577	566	566
query18	2029	300	307	300
query19	291	167	153	153
query20	114	108	111	108
query21	210	105	104	104
query22	4545	4404	4241	4241
query23	34356	33509	33065	33065
query24	11130	2872	2836	2836
query25	680	416	423	416
query26	1375	170	171	170
query27	2883	355	344	344
query28	7769	2099	2096	2096
query29	887	457	444	444
query30	322	162	159	159
query31	1020	794	844	794
query32	101	60	60	60
query33	793	306	308	306
query34	930	494	497	494
query35	898	718	712	712
query36	1099	899	934	899
query37	140	76	78	76
query38	4033	3834	3864	3834
query39	1477	1415	1456	1415
query40	288	107	104	104
query41	52	51	50	50
query42	117	100	98	98
query43	511	482	485	482
query44	1266	806	785	785
query45	187	169	172	169
query46	1159	719	709	709
query47	1930	1844	1838	1838
query48	455	372	375	372
query49	1201	410	409	409
query50	807	424	409	409
query51	7262	7058	7117	7058
query52	103	90	93	90
query53	269	185	187	185
query54	1210	486	471	471
query55	84	77	78	77
query56	280	252	260	252
query57	1267	1148	1147	1147
query58	254	211	221	211
query59	2998	2843	2900	2843
query60	292	264	252	252
query61	111	107	110	107
query62	854	667	658	658
query63	212	190	194	190
query64	5175	639	653	639
query65	3293	3200	3230	3200
query66	1438	305	298	298
query67	15935	15595	15511	15511
query68	4539	565	563	563
query69	448	265	265	265
query70	1087	1024	1106	1024
query71	341	254	256	254
query72	6419	4091	4072	4072
query73	764	345	345	345
query74	10256	9254	9206	9206
query75	3356	2630	2650	2630
query76	2975	956	1149	956
query77	416	275	288	275
query78	10576	9572	9598	9572
query79	2417	613	604	604
query80	895	430	434	430
query81	537	223	225	223
query82	702	88	89	88
query83	267	147	147	147
query84	245	82	75	75
query85	1649	308	301	301
query86	470	265	290	265
query87	4505	4371	4281	4281
query88	4205	2340	2363	2340
query89	410	294	300	294
query90	1987	188	183	183
query91	186	151	152	151
query92	68	52	54	52
query93	1439	556	544	544
query94	871	307	296	296
query95	365	257	258	257
query96	608	274	281	274
query97	3280	3158	3115	3115
query98	214	207	194	194
query99	1528	1323	1282	1282
Total cold run time: 301329 ms
Total hot run time: 189897 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.23	0.07	0.07
query4	1.62	0.11	0.11
query5	0.53	0.51	0.49
query6	1.13	0.73	0.72
query7	0.02	0.01	0.02
query8	0.06	0.03	0.03
query9	0.56	0.51	0.49
query10	0.56	0.53	0.56
query11	0.15	0.10	0.10
query12	0.14	0.12	0.12
query13	0.61	0.60	0.60
query14	0.80	0.78	0.81
query15	0.84	0.83	0.83
query16	0.37	0.39	0.39
query17	1.02	1.08	1.03
query18	0.24	0.22	0.22
query19	1.98	1.74	1.82
query20	0.01	0.02	0.01
query21	15.40	0.60	0.59
query22	2.84	2.44	2.08
query23	16.87	0.91	0.84
query24	3.48	1.57	0.93
query25	0.19	0.24	0.07
query26	0.39	0.15	0.13
query27	0.05	0.04	0.04
query28	9.79	0.56	0.51
query29	12.58	3.18	3.20
query30	0.25	0.06	0.06
query31	2.85	0.38	0.38
query32	3.26	0.48	0.46
query33	2.95	2.99	2.99
query34	17.01	4.51	4.50
query35	4.57	4.55	4.56
query36	0.68	0.50	0.48
query37	0.09	0.06	0.07
query38	0.04	0.03	0.03
query39	0.03	0.03	0.03
query40	0.16	0.13	0.12
query41	0.08	0.02	0.03
query42	0.04	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 104.62 s
Total hot run time: 30.43 s

@dataroaring dataroaring merged commit c8b1ed8 into branch-3.0 Jun 26, 2025
22 of 25 checks passed
@github-actions github-actions bot deleted the auto-pick-52042-branch-3.0 branch June 26, 2025 02:29
koarz pushed a commit to koarz/doris that referenced this pull request Jul 3, 2025
…pache#52042 (apache#52261)

Cherry-picked from apache#52042

Co-authored-by: Kaijie Chen <chenkaijie@selectdb.com>
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.

5 participants