Skip to content

[fix](binlog) Fix row binlog recovery for multi-tablet transactions - #67508

Open
luwei16 wants to merge 1 commit into
apache:masterfrom
luwei16:fix/doris-28059-row-binlog-recovery
Open

[fix](binlog) Fix row binlog recovery for multi-tablet transactions#67508
luwei16 wants to merge 1 commit into
apache:masterfrom
luwei16:fix/doris-28059-row-binlog-recovery

Conversation

@luwei16

@luwei16 luwei16 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #67091

Related PR: None

Problem Summary: A BE restart indexed row-binlog rowsets only by transaction ID, so multiple tablet pairs in one transaction could attach the wrong companion rowset. Persist each base tablet's companion ID and recover using both transaction and tablet IDs.

Release note

Fix incorrect row-binlog companion recovery after a BE restart for multi-tablet transactions.

Check List (For Author)

  • Test: Unit Test
    • Added and ran GroupRowsetBuilderTest.recoverMultipleRowBinlogPairsInOneTxn and GroupRowsetBuilderTest.*
  • Behavior changed: Yes. BE restart recovery now attaches each base rowset to its persisted companion tablet.
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: close apache#67091

Related PR: None

Problem Summary: A BE restart indexed row-binlog rowsets only by transaction ID, so multiple tablet pairs in one transaction could attach the wrong companion rowset. Persist each base tablet's companion ID and recover using both transaction and tablet IDs.

### Release note

Fix incorrect row-binlog companion recovery after a BE restart for multi-tablet transactions.

### Check List (For Author)

- Test: Unit Test
    - Added and ran GroupRowsetBuilderTest.recoverMultipleRowBinlogPairsInOneTxn and GroupRowsetBuilderTest.*
- Behavior changed: Yes. BE restart recovery now attaches each base rowset to its persisted companion tablet.
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
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?

@luwei16

luwei16 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@luwei16 luwei16 added the binlog label Sep 3, 2026
@luwei16 luwei16 changed the title [fix](be) Fix row binlog recovery for multi-tablet transactions [fix](binlog) Fix row binlog recovery for multi-tablet transactions Sep 3, 2026
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17569	3121	3104	3104
q2	2124	269	227	227
q3	10199	915	509	509
q4	4672	252	198	198
q5	7690	563	389	389
q6	137	114	93	93
q7	537	516	387	387
q8	9235	854	898	854
q9	3420	2383	2415	2383
q10	6503	853	727	727
q11	399	198	180	180
q12	614	275	205	205
q13	18106	1539	1157	1157
q14	160	146	142	142
q15	q16	446	394	359	359
q17	1416	961	781	781
q18	3106	2259	2242	2242
q19	1261	922	759	759
q20	380	280	207	207
q21	5707	1601	1915	1601
q22	331	275	230	230
Total cold run time: 94012 ms
Total hot run time: 16734 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3501	3430	3405	3405
q2	504	390	374	374
q3	2190	2284	2194	2194
q4	1200	1171	893	893
q5	2214	2108	2108	2108
q6	168	118	84	84
q7	1025	908	873	873
q8	1615	1426	1424	1424
q9	3186	3128	3108	3108
q10	1856	1815	1637	1637
q11	356	270	252	252
q12	461	431	348	348
q13	1477	1513	1176	1176
q14	173	169	176	169
q15	q16	395	393	354	354
q17	3641	3306	3216	3216
q18	4832	4451	4744	4451
q19	957	881	871	871
q20	996	970	846	846
q21	3908	3232	3235	3232
q22	396	367	323	323
Total cold run time: 35051 ms
Total hot run time: 31338 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 81861 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 cf913701376f878e54fda737593343f536ccbf6b, data reload: false

query5	4237	397	336	336
query6	390	131	122	122
query7	4971	439	239	239
query8	288	128	119	119
query9	8680	2891	2917	2891
query10	407	209	182	182
query11	5404	1035	906	906
query12	118	68	71	68
query13	1187	412	325	325
query14	6164	2216	2115	2115
query14_1	1983	1968	1955	1955
query15	185	127	111	111
query16	942	365	350	350
query17	805	461	372	372
query18	2345	336	239	239
query19	168	139	112	112
query20	71	68	73	68
query21	212	101	86	86
query22	5382	5389	5210	5210
query23	6797	6237	5885	5885
query23_1	6183	5900	5956	5900
query24	7321	1093	742	742
query24_1	784	748	802	748
query25	409	273	231	231
query26	1216	237	127	127
query27	2781	414	255	255
query28	4690	1494	1489	1489
query29	929	410	326	326
query30	249	155	128	128
query31	835	418	329	329
query32	143	70	70	70
query33	456	208	190	190
query34	1014	801	474	474
query35	405	403	329	329
query36	583	582	545	545
query37	125	85	70	70
query38	1004	851	827	827
query39	504	486	472	472
query39_1	471	470	444	444
query40	205	88	79	79
query41	53	49	51	49
query42	72	70	69	69
query43	240	242	212	212
query44	1010	542	563	542
query45	111	106	104	104
query46	797	833	540	540
query47	754	766	697	697
query48	301	301	235	235
query49	551	252	187	187
query50	763	266	196	196
query51	8276	8155	8383	8155
query52	72	70	66	66
query53	198	205	147	147
query54	235	197	178	178
query55	80	65	57	57
query56	247	261	169	169
query57	673	677	643	643
query58	219	168	156	156
query59	1201	1257	1094	1094
query60	265	196	186	186
query61	130	139	166	139
query62	369	219	183	183
query63	166	143	140	140
query64	2718	685	594	594
query65	1651	1603	1559	1559
query66	1874	253	194	194
query67	9862	9587	9692	9587
query68	2842	1250	783	783
query69	343	227	184	184
query70	678	642	647	642
query71	253	176	173	173
query72	2311	1753	1568	1568
query73	637	563	342	342
query74	1846	1230	1169	1169
query75	1174	1092	954	954
query76	2283	738	516	516
query77	251	256	205	205
query78	3978	3773	3261	3261
query79	2805	822	572	572
query80	1529	316	284	284
query81	508	153	135	135
query82	927	135	100	100
query83	271	219	187	187
query84	299	112	91	91
query85	842	360	354	354
query86	473	176	171	171
query87	1017	986	906	906
query88	3509	2116	2129	2116
query89	284	195	178	178
query90	2200	130	126	126
query91	130	120	107	107
query92	99	73	68	68
query93	3672	1137	739	739
query94	685	265	225	225
query95	527	324	245	245
query96	836	582	280	280
query97	1085	1054	1001	1001
query98	172	139	132	132
query99	432	351	307	307
Total cold run time: 182256 ms
Total hot run time: 81861 ms

@hello-stephen

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

query1	0.01	0.00	0.00
query2	0.07	0.03	0.04
query3	0.26	0.11	0.10
query4	1.60	0.09	0.09
query5	0.17	0.16	0.17
query6	1.27	0.70	0.68
query7	0.04	0.01	0.00
query8	0.04	0.03	0.03
query9	0.29	0.21	0.22
query10	0.35	0.36	0.34
query11	0.16	0.12	0.12
query12	0.14	0.12	0.13
query13	0.30	0.30	0.30
query14	0.45	0.45	0.44
query15	0.37	0.36	0.35
query16	0.21	0.24	0.24
query17	0.68	0.69	0.71
query18	0.19	0.18	0.16
query19	1.13	1.13	1.19
query20	0.01	0.02	0.02
query21	15.50	0.16	0.12
query22	5.05	0.05	0.04
query23	16.19	0.25	0.10
query24	2.96	0.34	0.27
query25	0.12	0.04	0.05
query26	0.73	0.16	0.13
query27	0.04	0.03	0.04
query28	3.59	0.56	0.27
query29	12.45	3.16	2.60
query30	0.25	0.11	0.12
query31	2.75	0.38	0.17
query32	3.51	0.32	0.23
query33	1.38	1.39	1.52
query34	15.37	2.21	1.79
query35	1.74	1.71	1.69
query36	0.46	0.29	0.29
query37	0.07	0.04	0.04
query38	0.05	0.03	0.03
query39	0.03	0.03	0.03
query40	0.11	0.07	0.08
query41	0.08	0.02	0.02
query42	0.03	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 90.24 s
Total hot run time: 14.72 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.04% (34539/45420)
Line Coverage 61.11% (389521/637379)
Region Coverage 57.19% (326813/571497)
Branch Coverage 58.12% (149272/256832)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Binlog] BE restart recovery can mismatch companion rowsets across multiple tablets sharing a transaction

2 participants