Skip to content

[fix](txn) Set transaction status to COMMITTED only after commit info is fully populated#60749

Open
zclllyybb wants to merge 1 commit intoapache:masterfrom
zclllyybb:txn_mgr_race
Open

[fix](txn) Set transaction status to COMMITTED only after commit info is fully populated#60749
zclllyybb wants to merge 1 commit intoapache:masterfrom
zclllyybb:txn_mgr_race

Conversation

@zclllyybb
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #59990

Problem Summary:

Move setTransactionStatus(COMMITTED) to after idToTableCommitInfos population in both commitTransaction methods. This prevents PublishVersionDaemon from seeing COMMITTED status with empty commit info, as it checks status without synchronized(transactionState) lock.

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

… is fully populated

Move setTransactionStatus(COMMITTED) to after idToTableCommitInfos population in both commitTransaction methods. This prevents PublishVersionDaemon from seeing COMMITTED status with empty commit info, as it checks status without synchronized(transactionState) lock.
@Thearas
Copy link
Contributor

Thearas commented Feb 13, 2026

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?

@zclllyybb
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
============================================
q1	17630	4429	4288	4288
q2	q3	10656	772	515	515
q4	4696	356	256	256
q5	7557	1167	1016	1016
q6	172	172	145	145
q7	767	847	679	679
q8	9297	1476	1335	1335
q9	4807	4725	4685	4685
q10	6807	1873	1623	1623
q11	453	254	234	234
q12	733	578	457	457
q13	17789	4245	3426	3426
q14	224	231	217	217
q15	964	796	786	786
q16	745	723	671	671
q17	704	873	416	416
q18	5942	5304	5219	5219
q19	1370	971	602	602
q20	515	484	392	392
q21	4440	1842	1410	1410
q22	345	286	254	254
Total cold run time: 96613 ms
Total hot run time: 28626 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4430	4374	4362	4362
q2	q3	1765	2178	1718	1718
q4	847	1141	760	760
q5	4021	4308	4342	4308
q6	191	175	144	144
q7	1743	1609	1490	1490
q8	2430	2683	2550	2550
q9	7604	7574	7659	7574
q10	2740	2948	2453	2453
q11	514	445	424	424
q12	531	602	467	467
q13	3946	4419	3656	3656
q14	299	309	283	283
q15	925	837	815	815
q16	747	780	757	757
q17	1186	1544	1287	1287
q18	7231	6682	6633	6633
q19	937	893	902	893
q20	2101	2187	2029	2029
q21	3978	3699	3409	3409
q22	511	490	414	414
Total cold run time: 48677 ms
Total hot run time: 46426 ms

@doris-robot
Copy link

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

query5	4986	642	495	495
query6	338	214	201	201
query7	4214	473	275	275
query8	355	231	232	231
query9	8714	2726	2714	2714
query10	579	395	338	338
query11	16725	17169	16944	16944
query12	211	131	120	120
query13	1497	458	368	368
query14	7299	3301	3039	3039
query14_1	3102	3041	2928	2928
query15	217	201	177	177
query16	1014	476	483	476
query17	1625	788	650	650
query18	3252	496	379	379
query19	225	210	185	185
query20	143	143	127	127
query21	225	136	121	121
query22	5622	4946	4727	4727
query23	17436	17076	16787	16787
query23_1	16847	16774	16955	16774
query24	7069	1604	1230	1230
query24_1	1233	1214	1230	1214
query25	552	474	427	427
query26	1220	262	150	150
query27	2759	471	285	285
query28	4464	1872	1877	1872
query29	835	557	456	456
query30	314	243	200	200
query31	871	715	632	632
query32	79	72	69	69
query33	521	328	272	272
query34	913	908	562	562
query35	627	664	589	589
query36	1049	1088	970	970
query37	132	90	82	82
query38	2979	2944	2858	2858
query39	1028	870	851	851
query39_1	818	822	820	820
query40	223	149	136	136
query41	64	58	59	58
query42	107	101	97	97
query43	373	373	349	349
query44	
query45	202	182	182	182
query46	874	977	598	598
query47	2130	2156	2065	2065
query48	309	311	231	231
query49	629	469	373	373
query50	681	271	219	219
query51	4104	4077	4064	4064
query52	104	107	96	96
query53	286	338	284	284
query54	288	264	252	252
query55	83	79	78	78
query56	305	305	309	305
query57	1371	1353	1286	1286
query58	282	268	276	268
query59	2614	2752	2547	2547
query60	345	347	320	320
query61	146	142	143	142
query62	635	593	556	556
query63	311	274	269	269
query64	4831	1266	969	969
query65	
query66	1387	444	342	342
query67	16133	16152	16030	16030
query68	
query69	385	303	276	276
query70	957	974	922	922
query71	325	298	292	292
query72	2861	2644	2394	2394
query73	547	537	319	319
query74	9911	9917	9720	9720
query75	2838	2735	2451	2451
query76	2299	1031	691	691
query77	346	378	301	301
query78	11132	11420	10688	10688
query79	1158	791	595	595
query80	1352	644	540	540
query81	549	288	252	252
query82	1009	146	109	109
query83	332	259	240	240
query84	258	117	95	95
query85	896	482	443	443
query86	422	308	297	297
query87	3103	3065	3006	3006
query88	3533	2723	2638	2638
query89	428	362	342	342
query90	1978	168	167	167
query91	164	156	130	130
query92	72	74	70	70
query93	1006	842	497	497
query94	641	323	299	299
query95	567	325	311	311
query96	627	521	226	226
query97	2484	2516	2423	2423
query98	222	217	207	207
query99	984	989	939	939
Total cold run time: 255739 ms
Total hot run time: 182664 ms

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

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 Feb 14, 2026
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

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