Skip to content

Conversation

sollhui
Copy link
Contributor

@sollhui sollhui commented Aug 11, 2025

What problem does this PR solve?

If insert into request to follower, ReturnRows in audit log always 0:

[query] |QueryId=178cb3b149684de9-87f3c24149b1e50b|Timestamp=2025-08-11 11:53:30.132|Client=174.58.0.1:59086|User=root|FeIp=174.58.1.2|Ctl=internal|Db=test_insert_from_follower|State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=145|CpuTimeMS=0|PeakMemoryBytes=1025152|ScanBytes=0|ScanRows=0|ReturnRows=0|ShuffleSendRows=0|ShuffleSendBytes=0|SpillWriteBytesToLocalStorage=0|SpillReadBytesFromLocalStorage=0|ScanBytesFromLocalStorage=0|ScanBytesFromRemoteStorage=0|ParseTimeMs=9|PlanTimesMs={"plan":-1,"garbage_collect":-1,"lock_tables":-1,"analyze":-1,"rewrite":-1,"fold_const_by_be":0,"collect_partitions":-1,"optimize":-1,"translate":-1,"init_scan_node":-1,"finalize_scan_node":-1,"create_scan_range":-1,"distribute":-1}|GetMetaTimesMs={"get_partition_version_time_ms":0,"get_partition_version_count_has_data":0,"get_partition_version_count":0,"get_table_version_time_ms":0,"get_table_version_count":0}|ScheduleTimesMs={"schedule_time_ms":-1,"fragment_assign_time_ms":-1,"fragment_serialize_time_ms":-1,"fragment_rpc_phase_1_time_ms":-1,"fragment_rpc_phase_2_time_ms":-1,"fragment_compressed_size_byte":0.0,"fragment_rpc_count":0}|HitSqlCache=false|isHandledInFe=false|queriedTablesAndViews=|chosenMViews=|ChangedVariables={"character_set_results":"NULL","sql_mode":"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}|FuzzyVariables=|SqlMode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES|CommandType=Query|StmtType=INSERT|StmtId=27|SqlHash=fb91c45fdb1cfed22fb12838a979dea9|SqlDigest=|IsQuery=false|IsNereids=true|IsInternal=false|WorkloadGroup=|ComputeGroupName=UNKNOWN|Stmt= INSERT INTO test_insert_from_follower_tbl (k1, k2) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "e");

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

@Thearas
Copy link
Contributor

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

@sollhui
Copy link
Contributor Author

sollhui commented Aug 11, 2025

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 83.45% (1417/1698)
Line Coverage 66.77% (24293/36384)
Region Coverage 67.97% (12101/17804)
Branch Coverage 57.53% (6351/11040)

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17592	5250	5186	5186
q2	1919	301	189	189
q3	10297	1381	718	718
q4	10217	1051	521	521
q5	8334	2404	2346	2346
q6	235	171	138	138
q7	887	759	653	653
q8	9319	1277	1050	1050
q9	7124	5300	5196	5196
q10	6959	2348	1995	1995
q11	476	288	265	265
q12	370	357	220	220
q13	17799	3466	2968	2968
q14	245	243	228	228
q15	551	467	469	467
q16	442	440	380	380
q17	573	840	351	351
q18	7120	7155	7013	7013
q19	1241	983	543	543
q20	408	311	217	217
q21	3360	3165	2332	2332
q22	1056	1041	999	999
Total cold run time: 106524 ms
Total hot run time: 33975 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5359	5307	5256	5256
q2	339	315	225	225
q3	2097	2604	2176	2176
q4	1335	1738	1332	1332
q5	4137	4627	4219	4219
q6	218	173	159	159
q7	2078	2110	1798	1798
q8	2674	2447	2402	2402
q9	7269	7368	7458	7368
q10	3132	3426	2935	2935
q11	548	510	490	490
q12	825	841	660	660
q13	3385	3849	3332	3332
q14	304	317	292	292
q15	489	456	468	456
q16	501	717	414	414
q17	1206	1483	1406	1406
q18	7868	7789	7922	7789
q19	17194	843	771	771
q20	1965	1926	1731	1731
q21	13020	4331	4272	4272
q22	1048	1019	1007	1007
Total cold run time: 76991 ms
Total hot run time: 50490 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 169827 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 396edc2b595038e4570f8f899986ae33af8d1b2d, data reload: false

============================================
query1	975	382	394	382
query2	6521	1856	1690	1690
query3	6744	233	216	216
query4	27209	23640	23006	23006
query5	4349	655	502	502
query6	312	234	214	214
query7	4628	530	291	291
query8	278	228	217	217
query9	8551	2966	2954	2954
query10	445	335	290	290
query11	15662	14926	14815	14815
query12	185	136	134	134
query13	1657	586	420	420
query14	8580	5854	5845	5845
query15	218	194	162	162
query16	7131	673	505	505
query17	980	773	647	647
query18	2002	453	335	335
query19	242	237	185	185
query20	153	142	139	139
query21	222	129	115	115
query22	4040	4063	3879	3879
query23	34385	34195	34433	34195
query24	5351	2363	2472	2363
query25	515	536	469	469
query26	710	295	170	170
query27	2246	505	361	361
query28	3019	2320	2316	2316
query29	649	625	520	520
query30	294	302	199	199
query31	818	812	695	695
query32	90	76	78	76
query33	461	428	375	375
query34	791	862	515	515
query35	782	822	785	785
query36	1002	1057	947	947
query37	133	113	93	93
query38	3891	3894	3890	3890
query39	1433	1360	1375	1360
query40	237	150	131	131
query41	121	57	55	55
query42	140	123	123	123
query43	505	508	465	465
query44	1423	864	879	864
query45	194	181	180	180
query46	952	1063	673	673
query47	1784	1821	1718	1718
query48	401	425	315	315
query49	672	509	437	437
query50	691	690	417	417
query51	4158	4201	4109	4109
query52	125	127	113	113
query53	256	285	215	215
query54	647	655	566	566
query55	106	84	88	84
query56	358	356	353	353
query57	1184	1218	1137	1137
query58	328	328	329	328
query59	2658	2697	2577	2577
query60	410	391	399	391
query61	126	128	129	128
query62	760	738	674	674
query63	254	222	207	207
query64	2407	1125	869	869
query65	4235	4073	4139	4073
query66	1088	451	322	322
query67	query68	17396	624	585	585
query69	988	326	286	286
query70	1426	1144	1103	1103
query71	724	340	317	317
query72	9179	2312	2358	2312
query73	3470	648	359	359
query74	9464	8960	8762	8762
query75	7687	3144	2668	2668
query76	8858	1213	786	786
query77	1147	423	330	330
query78	9545	11738	9437	9437
query79	14786	628	563	563
query80	1980	566	486	486
query81	547	255	231	231
query82	543	159	120	120
query83	418	282	269	269
query84	311	99	85	85
query85	864	395	345	345
query86	375	348	301	301
query87	4188	4156	4093	4093
query88	5462	2230	2233	2230
query89	475	358	310	310
query90	2429	223	226	223
query91	163	139	115	115
query92	92	76	67	67
query93	6180	984	649	649
query94	1078	394	279	279
query95	424	335	329	329
query96	513	586	288	288
query97	2647	2715	2600	2600
query98	249	236	223	223
query99	1494	1421	1280	1280
Total cold run time: 298976 ms
Total hot run time: 169827 ms

dataroaring
dataroaring previously approved these changes Aug 11, 2025
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 added dev/3.0.x dev/3.1.x usercase Important user case type label labels Aug 11, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 11, 2025
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.11	0.06	0.05
query3	0.29	0.07	0.06
query4	1.59	0.08	0.08
query5	0.42	0.41	0.41
query6	1.15	0.67	0.67
query7	0.02	0.02	0.01
query8	0.06	0.05	0.06
query9	0.61	0.47	0.47
query10	0.54	0.53	0.54
query11	0.26	0.12	0.12
query12	0.25	0.14	0.13
query13	0.67	0.69	0.70
query14	0.94	1.12	1.09
query15	1.02	0.92	0.93
query16	0.39	0.39	0.39
query17	1.04	1.08	1.11
query18	0.25	0.24	0.24
query19	2.04	1.91	1.99
query20	0.02	0.01	0.01
query21	15.38	0.99	0.71
query22	0.96	1.17	0.89
query23	14.72	1.50	0.90
query24	4.99	0.62	0.39
query25	0.19	0.12	0.10
query26	0.55	0.23	0.19
query27	0.12	0.11	0.11
query28	11.09	1.17	0.64
query29	12.58	4.05	3.54
query30	3.15	3.01	2.98
query31	2.88	0.63	0.46
query32	3.25	0.65	0.57
query33	3.04	3.32	3.32
query34	16.62	5.50	4.90
query35	4.85	5.03	5.08
query36	0.67	0.53	0.53
query37	0.26	0.23	0.24
query38	0.24	0.24	0.22
query39	0.07	0.06	0.06
query40	0.19	0.18	0.17
query41	0.13	0.07	0.07
query42	0.08	0.07	0.08
query43	0.08	0.06	0.06
Total cold run time: 107.8 s
Total hot run time: 35.08 s

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Aug 11, 2025
@sollhui
Copy link
Contributor Author

sollhui commented Aug 11, 2025

run buildall

Copy link
Contributor

@liaoxin01 liaoxin01 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 Aug 11, 2025
Copy link
Contributor

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

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 83.45% (1417/1698)
Line Coverage 66.73% (24278/36384)
Region Coverage 67.95% (12098/17804)
Branch Coverage 57.48% (6346/11040)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/3) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17656	5166	5134	5134
q2	1923	307	183	183
q3	10252	1410	724	724
q4	10211	982	550	550
q5	7519	2347	2310	2310
q6	203	165	132	132
q7	902	741	616	616
q8	9312	1306	1086	1086
q9	7101	5206	5083	5083
q10	6937	2366	1965	1965
q11	466	297	271	271
q12	359	370	224	224
q13	17743	3508	2972	2972
q14	248	243	219	219
q15	542	471	459	459
q16	441	418	370	370
q17	577	847	360	360
q18	7149	7080	6910	6910
q19	1248	960	566	566
q20	323	300	211	211
q21	3436	3264	2409	2409
q22	1051	1056	1000	1000
Total cold run time: 105599 ms
Total hot run time: 33754 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5485	5220	5294	5220
q2	230	304	220	220
q3	2098	2576	2225	2225
q4	1414	1722	1343	1343
q5	4151	4374	4490	4374
q6	213	171	141	141
q7	2002	1981	1852	1852
q8	2671	2524	2433	2433
q9	7431	7293	7304	7293
q10	3209	3420	2910	2910
q11	533	495	476	476
q12	753	958	649	649
q13	3402	3681	3267	3267
q14	311	313	277	277
q15	498	454	451	451
q16	441	500	478	478
q17	1196	1566	1451	1451
q18	8132	7766	7661	7661
q19	8413	908	922	908
q20	1941	1941	1857	1857
q21	14949	4262	4212	4212
q22	1017	1079	1024	1024
Total cold run time: 70490 ms
Total hot run time: 50722 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 170191 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 a7c4ae17160ccb0fa01bd7f5ac46b9322e37bc53, data reload: false

============================================
query1	981	398	426	398
query2	6523	1811	1683	1683
query3	6736	220	227	220
query4	26832	23577	23026	23026
query5	4381	657	543	543
query6	332	250	234	234
query7	4660	524	301	301
query8	264	230	204	204
query9	8540	2953	2872	2872
query10	480	332	288	288
query11	15907	15086	14750	14750
query12	183	136	127	127
query13	1667	551	418	418
query14	8663	5892	5814	5814
query15	211	202	167	167
query16	7666	647	470	470
query17	1415	769	630	630
query18	2064	442	327	327
query19	270	208	190	190
query20	155	144	138	138
query21	221	127	114	114
query22	4148	4220	4029	4029
query23	34714	34594	34547	34547
query24	7655	2373	2460	2373
query25	577	573	433	433
query26	722	284	163	163
query27	2513	504	344	344
query28	3068	2325	2303	2303
query29	700	604	490	490
query30	292	237	201	201
query31	892	776	704	704
query32	85	73	78	73
query33	564	414	398	398
query34	800	855	513	513
query35	781	875	771	771
query36	1036	1023	953	953
query37	126	109	91	91
query38	3952	3999	3939	3939
query39	1437	1370	1375	1370
query40	234	140	136	136
query41	68	57	53	53
query42	141	121	127	121
query43	522	521	479	479
query44	1410	898	877	877
query45	201	187	189	187
query46	937	1057	675	675
query47	1796	1839	1766	1766
query48	389	420	335	335
query49	660	502	418	418
query50	658	701	416	416
query51	4201	4196	4199	4196
query52	124	136	121	121
query53	257	279	209	209
query54	640	637	549	549
query55	87	88	91	88
query56	373	355	362	355
query57	1221	1205	1123	1123
query58	332	320	337	320
query59	2606	2663	2564	2564
query60	433	408	389	389
query61	126	128	125	125
query62	769	717	717	717
query63	264	211	208	208
query64	2819	1093	787	787
query65	4368	4122	4124	4122
query66	913	452	337	337
query67	query68	17472	1275	767	767
query69	1011	280	291	280
query70	1414	1114	1152	1114
query71	708	337	312	312
query72	9165	2320	2357	2320
query73	3251	631	355	355
query74	8942	9023	8662	8662
query75	7475	3117	2674	2674
query76	8853	1216	788	788
query77	1149	407	329	329
query78	9508	10813	9236	9236
query79	14408	654	584	584
query80	1340	606	502	502
query81	546	262	222	222
query82	313	154	122	122
query83	359	293	273	273
query84	302	97	77	77
query85	844	386	339	339
query86	363	306	276	276
query87	4163	4217	4073	4073
query88	3766	2210	2205	2205
query89	476	358	321	321
query90	2687	234	235	234
query91	172	137	110	110
query92	91	73	69	69
query93	4014	964	650	650
query94	924	384	280	280
query95	399	327	321	321
query96	515	590	278	278
query97	2736	2756	2614	2614
query98	252	254	225	225
query99	1470	1414	1297	1297
Total cold run time: 297850 ms
Total hot run time: 170191 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.11	0.07	0.06
query3	0.29	0.06	0.06
query4	1.60	0.10	0.10
query5	0.43	0.41	0.41
query6	1.16	0.68	0.67
query7	0.02	0.02	0.01
query8	0.07	0.05	0.06
query9	0.62	0.47	0.49
query10	0.53	0.53	0.53
query11	0.26	0.13	0.12
query12	0.26	0.13	0.14
query13	0.67	0.67	0.69
query14	0.93	1.12	1.34
query15	1.01	0.92	0.93
query16	0.39	0.40	0.39
query17	1.10	1.12	1.06
query18	0.25	0.23	0.24
query19	1.97	1.86	2.05
query20	0.02	0.01	0.02
query21	15.39	1.02	0.72
query22	0.96	1.18	0.90
query23	14.70	1.51	0.92
query24	4.58	0.62	0.39
query25	0.18	0.12	0.11
query26	0.56	0.23	0.19
query27	0.10	0.10	0.10
query28	11.21	1.16	0.63
query29	12.59	4.10	3.59
query30	3.07	3.11	3.12
query31	2.81	0.63	0.48
query32	3.25	0.66	0.56
query33	3.11	3.18	3.34
query34	16.80	5.49	4.89
query35	4.82	4.98	5.05
query36	0.75	0.54	0.52
query37	0.26	0.25	0.23
query38	0.24	0.24	0.24
query39	0.07	0.06	0.06
query40	0.20	0.18	0.17
query41	0.12	0.08	0.07
query42	0.07	0.06	0.07
query43	0.07	0.07	0.06
Total cold run time: 107.64 s
Total hot run time: 35.06 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.98% (16588/28126)
Line Coverage 47.87% (150438/314293)
Region Coverage 36.71% (112714/307076)
Branch Coverage 39.63% (50013/126194)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.51% (22498/27601)
Line Coverage 74.17% (233121/314292)
Region Coverage 61.40% (193620/315338)
Branch Coverage 65.52% (83698/127742)

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 6f62230 into apache:master Aug 11, 2025
26 of 29 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 11, 2025
…eed forward (#54548)

### What problem does this PR solve?

If insert into request to follower, ReturnRows in audit log always 0:
```
[query] |QueryId=178cb3b149684de9-87f3c24149b1e50b|Timestamp=2025-08-11 11:53:30.132|Client=174.58.0.1:59086|User=root|FeIp=174.58.1.2|Ctl=internal|Db=test_insert_from_follower|State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=145|CpuTimeMS=0|PeakMemoryBytes=1025152|ScanBytes=0|ScanRows=0|ReturnRows=0|ShuffleSendRows=0|ShuffleSendBytes=0|SpillWriteBytesToLocalStorage=0|SpillReadBytesFromLocalStorage=0|ScanBytesFromLocalStorage=0|ScanBytesFromRemoteStorage=0|ParseTimeMs=9|PlanTimesMs={"plan":-1,"garbage_collect":-1,"lock_tables":-1,"analyze":-1,"rewrite":-1,"fold_const_by_be":0,"collect_partitions":-1,"optimize":-1,"translate":-1,"init_scan_node":-1,"finalize_scan_node":-1,"create_scan_range":-1,"distribute":-1}|GetMetaTimesMs={"get_partition_version_time_ms":0,"get_partition_version_count_has_data":0,"get_partition_version_count":0,"get_table_version_time_ms":0,"get_table_version_count":0}|ScheduleTimesMs={"schedule_time_ms":-1,"fragment_assign_time_ms":-1,"fragment_serialize_time_ms":-1,"fragment_rpc_phase_1_time_ms":-1,"fragment_rpc_phase_2_time_ms":-1,"fragment_compressed_size_byte":0.0,"fragment_rpc_count":0}|HitSqlCache=false|isHandledInFe=false|queriedTablesAndViews=|chosenMViews=|ChangedVariables={"character_set_results":"NULL","sql_mode":"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}|FuzzyVariables=|SqlMode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES|CommandType=Query|StmtType=INSERT|StmtId=27|SqlHash=fb91c45fdb1cfed22fb12838a979dea9|SqlDigest=|IsQuery=false|IsNereids=true|IsInternal=false|WorkloadGroup=|ComputeGroupName=UNKNOWN|Stmt= INSERT INTO test_insert_from_follower_tbl (k1, k2) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "e");
```

### 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 -->
morrySnow pushed a commit that referenced this pull request Aug 13, 2025
… statement need forward #54548 (#54580)

Cherry-picked from #54548

Co-authored-by: hui lai <[email protected]>
sollhui added a commit to sollhui/doris that referenced this pull request Aug 20, 2025
…eed forward (apache#54548)

If insert into request to follower, ReturnRows in audit log always 0:
```
[query] |QueryId=178cb3b149684de9-87f3c24149b1e50b|Timestamp=2025-08-11 11:53:30.132|Client=174.58.0.1:59086|User=root|FeIp=174.58.1.2|Ctl=internal|Db=test_insert_from_follower|State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=145|CpuTimeMS=0|PeakMemoryBytes=1025152|ScanBytes=0|ScanRows=0|ReturnRows=0|ShuffleSendRows=0|ShuffleSendBytes=0|SpillWriteBytesToLocalStorage=0|SpillReadBytesFromLocalStorage=0|ScanBytesFromLocalStorage=0|ScanBytesFromRemoteStorage=0|ParseTimeMs=9|PlanTimesMs={"plan":-1,"garbage_collect":-1,"lock_tables":-1,"analyze":-1,"rewrite":-1,"fold_const_by_be":0,"collect_partitions":-1,"optimize":-1,"translate":-1,"init_scan_node":-1,"finalize_scan_node":-1,"create_scan_range":-1,"distribute":-1}|GetMetaTimesMs={"get_partition_version_time_ms":0,"get_partition_version_count_has_data":0,"get_partition_version_count":0,"get_table_version_time_ms":0,"get_table_version_count":0}|ScheduleTimesMs={"schedule_time_ms":-1,"fragment_assign_time_ms":-1,"fragment_serialize_time_ms":-1,"fragment_rpc_phase_1_time_ms":-1,"fragment_rpc_phase_2_time_ms":-1,"fragment_compressed_size_byte":0.0,"fragment_rpc_count":0}|HitSqlCache=false|isHandledInFe=false|queriedTablesAndViews=|chosenMViews=|ChangedVariables={"character_set_results":"NULL","sql_mode":"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}|FuzzyVariables=|SqlMode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES|CommandType=Query|StmtType=INSERT|StmtId=27|SqlHash=fb91c45fdb1cfed22fb12838a979dea9|SqlDigest=|IsQuery=false|IsNereids=true|IsInternal=false|WorkloadGroup=|ComputeGroupName=UNKNOWN|Stmt= INSERT INTO test_insert_from_follower_tbl (k1, k2) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "e");
```

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 -->
dataroaring pushed a commit that referenced this pull request Aug 20, 2025
… statement need forward (#54548) (#55053)

pick #54548

If insert into request to follower, ReturnRows in audit log always 0:
```
[query] |QueryId=178cb3b149684de9-87f3c24149b1e50b|Timestamp=2025-08-11 11:53:30.132|Client=174.58.0.1:59086|User=root|FeIp=174.58.1.2|Ctl=internal|Db=test_insert_from_follower|State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=145|CpuTimeMS=0|PeakMemoryBytes=1025152|ScanBytes=0|ScanRows=0|ReturnRows=0|ShuffleSendRows=0|ShuffleSendBytes=0|SpillWriteBytesToLocalStorage=0|SpillReadBytesFromLocalStorage=0|ScanBytesFromLocalStorage=0|ScanBytesFromRemoteStorage=0|ParseTimeMs=9|PlanTimesMs={"plan":-1,"garbage_collect":-1,"lock_tables":-1,"analyze":-1,"rewrite":-1,"fold_const_by_be":0,"collect_partitions":-1,"optimize":-1,"translate":-1,"init_scan_node":-1,"finalize_scan_node":-1,"create_scan_range":-1,"distribute":-1}|GetMetaTimesMs={"get_partition_version_time_ms":0,"get_partition_version_count_has_data":0,"get_partition_version_count":0,"get_table_version_time_ms":0,"get_table_version_count":0}|ScheduleTimesMs={"schedule_time_ms":-1,"fragment_assign_time_ms":-1,"fragment_serialize_time_ms":-1,"fragment_rpc_phase_1_time_ms":-1,"fragment_rpc_phase_2_time_ms":-1,"fragment_compressed_size_byte":0.0,"fragment_rpc_count":0}|HitSqlCache=false|isHandledInFe=false|queriedTablesAndViews=|chosenMViews=|ChangedVariables={"character_set_results":"NULL","sql_mode":"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES"}|FuzzyVariables=|SqlMode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES|CommandType=Query|StmtType=INSERT|StmtId=27|SqlHash=fb91c45fdb1cfed22fb12838a979dea9|SqlDigest=|IsQuery=false|IsNereids=true|IsInternal=false|WorkloadGroup=|ComputeGroupName=UNKNOWN|Stmt= INSERT INTO test_insert_from_follower_tbl (k1, k2) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "e");
```
@gavinchou gavinchou mentioned this pull request Sep 1, 2025
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. dev/3.0.8-merged dev/3.1.0-merged reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants