Skip to content

[fix](be) Replay schema-change WAL with duplicate column IDs - #70160

Merged
liaoxin01 merged 2 commits into
apache:masterfrom
liaoxin01:codex/fix-wal-shadow-column-ids
Nov 5, 2026
Merged

liaoxin01 merged 2 commits into
apache:masterfrom
liaoxin01:codex/fix-wal-shadow-column-ids

Conversation

@liaoxin01

@liaoxin01 liaoxin01 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Heavy ALTER operations can write base and shadow columns with the same ID into Group Commit WALs. V2 rejects these valid headers as corruption. Accept duplicate IDs while preserving physical column order and the existing first-column mapping.

Related PR: #66008

Release note

Fix Group Commit WAL replay failures during heavy schema changes with FileScannerV2.

Check List (For Author)

  • Regression test: the unchanged case fails before the fix and passes after it; covers RUNNING, FINISHED and CANCELLED ALTER states on a local integrated cluster.
  • Unit Test: all 5 WAL reader tests pass with ASAN.
  • Behavior changed: No.
  • Does this need documentation: No.

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#66008

Problem Summary: Heavy schema changes retain the original column ID on a shadow column. Group Commit can therefore write both columns with the same ID into its WAL. The V2 reader rejects this valid header as corruption, leaving asynchronous writes unreplayed. Preserve all physical header entries and reuse the existing first-ID mapping and type conversion, matching the legacy reader's column selection.

### Release note

Fix Group Commit WAL replay failures caused by duplicate column IDs during heavy schema changes when FileScannerV2 is enabled.

### Check List (For Author)

- Test: ASAN BE build; 5 WalReaderV2Test unit tests; regression for replay during RUNNING, FINISHED and CANCELLED ALTER states; recovery of two original failing WAL files. clang-format v16, build hygiene and clang-tidy checks passed. Unit tests disabled the redundant GLIBC compatibility layer for the local toolchain.
- Behavior changed: Yes, accept valid WAL headers containing base and shadow columns with the same ID.
- 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?

@liaoxin01

Copy link
Copy Markdown
Contributor Author

/review

@liaoxin01

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable defects found in the four changed files at head 7b8ce08. Accepting duplicate WAL column IDs preserves physical positions and the existing first/base-column mapping, restoring replay of valid schema-change WALs. No existing inline findings require retention, and no additional user review focus was supplied.

Critical checkpoint conclusions:

  1. Goal and evidence: the writer-backed unit test distinguishes base/shadow values, preserves the trailing physical ordinal, and checks reordered INT-to-BIGINT mapping. The regression covers RUNNING, FINISHED and CANCELLED ALTER states, including NULL values.
  2. Scope and reuse: the production change removes only duplicate-ID rejection and its set; existing mapping and conversion machinery is reused.
  3. Concurrency and locks: parser state remains reader-local, with no new production synchronization. Regression blocking points distinguish FE completion from BE conversion so cancellation can acquire the FE job monitor.
  4. Lifecycle and memory safety: physical IDs remain distinct local ordinals; existing first-payload transfer, ownership moves, EOF and close behavior are unchanged. No new allocation ownership or static initialization dependency is introduced.
  5. Configuration: no production setting is added. The regression restores the global scanner flag in finally and disables its named debug points.
  6. Compatibility: WAL header/PBlock formats and execution-version checks are unchanged. Legacy emplace and v2 first-match field-ID lookup both retain the first occurrence; valid older duplicate-ID WALs become readable.
  7. Thrift/protobuf: no definitions, wire IDs, enums or function signatures change.
  8. Parallel paths: legacy replay already accepts duplicates. Shared WAL production/replay serves cloud and non-cloud modes; the regression selects the matching BE conversion hook.
  9. Conditions and errors: malformed-token, physical column-count, version and invalid-position failures remain. Duplicate IDs are valid schema-change metadata. Replay SQL deduplicates IDs before projection; TableReader performs file-to-table casts rather than reinterpreting payload bytes.
  10. Test coverage: focused unit and ordered regression coverage address this fix. New targeted fixtures do not cover duplicate-empty/multiple-block WALs, nested/other-type evolution or crash/failover transitions; these unchanged shared paths were inspected.
  11. Expected results: every output section correctly includes (1,10,100), (2,20,200), and (3,NULL,300), with order_qt ensuring deterministic comparison. Output-generation provenance was not independently verified.
  12. Observability: existing parser/schema/read errors and replay/commit logs remain sufficient for the changed admission behavior; no additional asynchronous stage is introduced.
  13. Persistence and transactions: writer bytes, labels, commit/rollback and FE logging are unchanged. Replay projects each live unique ID once and commits through the existing ordinary stream-load path.
  14. Writes, crashes and core invariants: this reader change adds no transaction or visibility boundary. Partition-version and MoW delete-bitmap logic is untouched; no new crash-cleanup or atomicity defect was found in the affected path.
  15. FE/BE variables: none are added, so no transmission paths require changes.
  16. Performance and further checks: parsing remains linear while removing hash-set work; no new per-row work, copies, cache/pruning changes, header-hygiene changes or ABI dependencies are introduced. Replay bypasses the held group-load error injection, and the bounded FE WAL-drain timeout allows the FINISHED scenario to proceed.

Static review only: no builds, tests, benchmarks or runtime validation were executed. Author-reported executions were not treated as independently verified results. All changed paths, candidate dispositions and both initial risk focuses were checked; no unresolved code question remains. Review converged after two rounds, including final confirmation of the frozen payload.

Review converged after 2 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 67.41% (32170/47726)
Line Coverage 52.24% (338575/648059)
Region Coverage 47.76% (275235/576277)
Branch Coverage 49.59% (129756/261659)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17608	5103	5033	5033
q2	2151	306	246	246
q3	10258	1378	823	823
q4	4685	466	345	345
q5	7441	803	542	542
q6	179	185	150	150
q7	780	791	598	598
q8	9252	1336	1125	1125
q9	5694	4255	4177	4177
q10	6823	1297	1025	1025
q11	443	246	235	235
q12	633	406	280	280
q13	18304	3538	3050	3050
q14	280	271	243	243
q15	q16	713	717	658	658
q17	1213	754	577	577
q18	6977	6171	6123	6123
q19	1104	975	594	594
q20	401	332	228	228
q21	5722	2547	2438	2438
q22	384	338	274	274
Total cold run time: 101045 ms
Total hot run time: 28764 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5925	5930	6054	5930
q2	754	646	577	577
q3	5580	5872	5387	5387
q4	2023	2163	1568	1568
q5	5990	5609	5677	5609
q6	251	187	140	140
q7	2232	2012	1770	1770
q8	3160	2645	2643	2643
q9	7794	7484	7514	7484
q10	3637	3585	3146	3146
q11	577	406	382	382
q12	687	668	501	501
q13	3273	3633	3023	3023
q14	298	285	269	269
q15	q16	669	680	631	631
q17	7803	7041	6889	6889
q18	13008	12242	12898	12242
q19	898	769	765	765
q20	2130	2148	1905	1905
q21	5581	4545	4706	4545
q22	518	456	414	414
Total cold run time: 72788 ms
Total hot run time: 65820 ms

@hello-stephen

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

query5	4310	604	448	448
query6	428	219	195	195
query7	4814	459	232	232
query8	326	166	151	151
query9	8808	3189	3223	3189
query10	474	308	263	263
query11	6000	3838	3584	3584
query12	147	91	86	86
query13	1259	447	312	312
query14	6095	3895	3647	3647
query14_1	3433	3497	3379	3379
query15	209	202	179	179
query16	945	462	420	420
query17	856	667	559	559
query18	2430	413	300	300
query19	193	156	130	130
query20	80	83	81	81
query21	211	125	103	103
query22	12942	12910	12723	12723
query23	13348	12958	12431	12431
query23_1	12501	12479	12396	12396
query24	7345	815	468	468
query24_1	490	486	492	486
query25	507	390	326	326
query26	1263	251	132	132
query27	2784	435	274	274
query28	4641	2058	2042	2042
query29	1551	584	429	429
query30	300	223	188	188
query31	991	935	801	801
query32	155	88	87	87
query33	516	285	230	230
query34	894	852	501	501
query35	733	746	650	650
query36	797	838	716	716
query37	127	93	76	76
query38	1762	1755	1661	1661
query39	797	790	735	735
query39_1	748	725	742	725
query40	214	114	96	96
query41	67	65	65	65
query42	96	84	79	79
query43	350	357	308	308
query44	1328	713	711	711
query45	176	176	161	161
query46	841	964	582	582
query47	2858	2892	2677	2677
query48	293	318	231	231
query49	583	407	299	299
query50	668	280	226	226
query51	10715	10366	10511	10366
query52	77	79	70	70
query53	188	210	158	158
query54	250	212	222	212
query55	82	71	63	63
query56	256	223	228	223
query57	1642	1611	1574	1574
query58	289	272	287	272
query59	2166	2182	1952	1952
query60	299	260	240	240
query61	169	171	171	171
query62	388	331	308	308
query63	188	164	166	164
query64	2859	1059	855	855
query65	3334	3250	3261	3250
query66	1773	415	305	305
query67	20196	20037	19906	19906
query68	2970	1021	629	629
query69	393	274	251	251
query70	846	768	823	768
query71	305	238	197	197
query72	2821	2825	2302	2302
query73	505	534	300	300
query74	4609	4488	4329	4329
query75	2354	2281	1892	1892
query76	2325	1009	603	603
query77	341	347	269	269
query78	10012	9628	9115	9115
query79	1044	896	557	557
query80	640	416	334	334
query81	555	327	269	269
query82	713	132	114	114
query83	269	198	185	185
query84	311	122	103	103
query85	856	416	356	356
query86	323	253	230	230
query87	2007	1981	1793	1793
query88	3810	2826	2801	2801
query89	326	281	244	244
query90	1847	171	173	171
query91	163	150	128	128
query92	97	91	89	89
query93	994	1001	577	577
query94	476	328	264	264
query95	587	331	313	313
query96	677	491	245	245
query97	2451	2411	2371	2371
query98	160	150	148	148
query99	764	758	645	645
Total cold run time: 234819 ms
Total hot run time: 150792 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.09	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.10	0.10
query5	0.24	0.23	0.25
query6	1.16	0.68	0.68
query7	0.04	0.01	0.01
query8	0.06	0.04	0.03
query9	0.41	0.34	0.36
query10	0.58	0.61	0.58
query11	0.19	0.15	0.14
query12	0.18	0.15	0.15
query13	0.48	0.48	0.50
query14	1.02	1.00	1.01
query15	0.62	0.61	0.61
query16	0.35	0.35	0.34
query17	1.18	1.15	1.14
query18	0.22	0.20	0.19
query19	2.13	1.93	1.99
query20	0.02	0.02	0.02
query21	15.50	0.19	0.14
query22	4.86	0.06	0.06
query23	16.27	0.31	0.12
query24	2.70	0.57	0.47
query25	0.11	0.06	0.06
query26	1.52	0.23	0.16
query27	0.04	0.05	0.04
query28	3.19	0.68	0.37
query29	12.51	4.15	3.26
query30	0.28	0.13	0.10
query31	2.77	0.55	0.32
query32	3.22	0.59	0.51
query33	3.22	3.16	3.24
query34	15.30	3.95	3.39
query35	3.36	3.34	3.33
query36	0.56	0.44	0.40
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.02
query40	0.18	0.15	0.14
query41	0.08	0.02	0.02
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.78 s
Total hot run time: 24.34 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.82% (35981/46239)
Line Coverage 63.16% (404828/640992)
Region Coverage 59.82% (343113/573590)
Branch Coverage 60.92% (158843/260719)

### What problem does this PR solve?

Related PR: apache#70160, apache#69723

Problem Summary: Master always uses FileScannerV2 and exposes the deprecated
rollout option under a prefixed SHOW name. The WAL schema-change case queries
the old name, gets no rows and fails before testing replay. Remove the obsolete
global-option setup and restoration.

### Release note

None

### Check List (For Author)

- Test: Regression test test_group_commit_schema_change_wal on the local integrated ASAN cluster (RUNNING, FINISHED and CANCELLED); existing expected output unchanged.
- Behavior changed: No
- Does this need documentation: No
@liaoxin01

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17568	5218	5015	5015
q2	2107	298	246	246
q3	10293	1390	820	820
q4	4671	463	332	332
q5	7434	789	530	530
q6	180	187	155	155
q7	748	805	593	593
q8	9274	1330	1073	1073
q9	5357	4164	4168	4164
q10	6846	1286	1029	1029
q11	408	241	234	234
q12	630	400	274	274
q13	18105	3552	3030	3030
q14	269	266	252	252
q15	q16	713	706	665	665
q17	1176	746	592	592
q18	6933	6155	6096	6096
q19	1106	945	605	605
q20	377	329	229	229
q21	5171	2096	2273	2096
q22	337	298	247	247
Total cold run time: 99703 ms
Total hot run time: 28277 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5560	5544	5534	5534
q2	674	568	520	520
q3	5204	5352	4908	4908
q4	1980	2155	1536	1536
q5	5250	5156	5430	5156
q6	264	206	162	162
q7	2412	2111	1825	1825
q8	2980	2653	2648	2648
q9	8057	7981	7936	7936
q10	3754	3917	3190	3190
q11	611	461	415	415
q12	705	693	510	510
q13	3633	3857	3294	3294
q14	315	312	295	295
q15	q16	681	692	691	691
q17	8128	7029	6847	6847
q18	12927	12178	12852	12178
q19	885	783	767	767
q20	2135	2155	1910	1910
q21	5639	4647	4783	4647
q22	490	484	404	404
Total cold run time: 72284 ms
Total hot run time: 65373 ms

@hello-stephen

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

query5	4310	591	442	442
query6	433	215	198	198
query7	4809	444	232	232
query8	319	165	152	152
query9	8781	3163	3161	3161
query10	468	306	281	281
query11	6056	3848	3538	3538
query12	160	91	90	90
query13	1232	444	330	330
query14	6099	3961	3638	3638
query14_1	3410	3394	3437	3394
query15	209	212	184	184
query16	929	440	429	429
query17	863	660	538	538
query18	2421	419	311	311
query19	192	175	140	140
query20	87	84	85	84
query21	205	127	109	109
query22	12889	13082	12802	12802
query23	13429	12670	12476	12476
query23_1	12564	12610	12493	12493
query24	7383	853	483	483
query24_1	479	495	483	483
query25	539	426	368	368
query26	1260	253	141	141
query27	2769	440	283	283
query28	4601	2035	2018	2018
query29	1576	615	453	453
query30	293	220	187	187
query31	1012	922	827	827
query32	149	88	94	88
query33	538	309	241	241
query34	892	867	505	505
query35	728	783	655	655
query36	800	806	720	720
query37	130	98	90	90
query38	1752	1742	1671	1671
query39	788	790	743	743
query39_1	731	733	739	733
query40	222	118	103	103
query41	74	73	68	68
query42	94	89	87	87
query43	346	366	314	314
query44	1341	718	719	718
query45	176	182	164	164
query46	830	979	589	589
query47	3023	2904	2875	2875
query48	311	336	268	268
query49	569	405	293	293
query50	712	284	215	215
query51	10609	10749	10581	10581
query52	79	81	67	67
query53	194	210	150	150
query54	233	207	189	189
query55	74	70	63	63
query56	232	202	199	199
query57	1642	1622	1575	1575
query58	279	260	258	258
query59	2154	2233	2021	2021
query60	306	242	228	228
query61	144	145	145	145
query62	387	330	302	302
query63	184	155	158	155
query64	2727	970	777	777
query65	3346	3297	3268	3268
query66	1795	417	309	309
query67	20159	20133	19902	19902
query68	2944	1005	616	616
query69	406	288	251	251
query70	870	785	774	774
query71	296	233	208	208
query72	2704	2609	2272	2272
query73	510	517	305	305
query74	4615	4513	4322	4322
query75	2322	2317	1923	1923
query76	2327	1004	585	585
query77	349	362	256	256
query78	9765	9730	9146	9146
query79	982	903	527	527
query80	775	421	346	346
query81	549	323	271	271
query82	574	137	106	106
query83	292	192	177	177
query84	314	125	95	95
query85	956	425	365	365
query86	353	249	236	236
query87	1986	1927	1814	1814
query88	3738	2778	2774	2774
query89	328	290	245	245
query90	1713	171	175	171
query91	167	158	127	127
query92	95	89	91	89
query93	1002	1000	572	572
query94	511	306	258	258
query95	567	384	303	303
query96	670	472	244	244
query97	2413	2429	2274	2274
query98	165	160	149	149
query99	758	752	661	661
Total cold run time: 234232 ms
Total hot run time: 151429 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.09	0.05	0.05
query3	0.25	0.09	0.09
query4	1.66	0.10	0.10
query5	0.23	0.24	0.24
query6	1.18	0.68	0.68
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.40	0.34	0.35
query10	0.58	0.59	0.60
query11	0.19	0.14	0.14
query12	0.18	0.15	0.15
query13	0.49	0.49	0.50
query14	1.04	1.02	1.01
query15	0.62	0.60	0.61
query16	0.36	0.35	0.34
query17	1.16	1.11	1.14
query18	0.21	0.19	0.18
query19	2.07	1.92	1.95
query20	0.02	0.02	0.01
query21	15.50	0.20	0.13
query22	4.83	0.05	0.05
query23	16.28	0.31	0.13
query24	3.02	0.65	0.48
query25	0.12	0.05	0.05
query26	1.63	0.22	0.15
query27	0.06	0.03	0.05
query28	3.46	0.78	0.38
query29	12.48	4.15	3.27
query30	0.30	0.13	0.10
query31	2.76	0.58	0.33
query32	3.23	0.60	0.50
query33	3.22	3.26	3.20
query34	15.30	4.00	3.42
query35	3.34	3.32	3.35
query36	0.55	0.46	0.43
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 97.44 s
Total hot run time: 24.42 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 67.41% (32171/47727)
Line Coverage 52.26% (338663/648096)
Region Coverage 47.75% (275228/576341)
Branch Coverage 49.60% (129793/261688)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.81% (35979/46240)
Line Coverage 63.16% (404884/641029)
Region Coverage 59.77% (342888/573654)
Branch Coverage 60.92% (158837/260748)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.81% (35979/46240)
Line Coverage 63.16% (404887/641029)
Region Coverage 59.77% (342891/573654)
Branch Coverage 60.92% (158839/260748)

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.81% (35979/46240)
Line Coverage 63.16% (404887/641029)
Region Coverage 59.77% (342891/573654)
Branch Coverage 60.92% (158839/260748)

@liaoxin01

Copy link
Copy Markdown
Contributor Author

Local pipeline review — ✅ PASS

schema: doris-repo-review/v1
status: PASS
pr: apache/doris#70160
commit: cdd0b0bd02d42fb0b21b5ad28400d99e8e4531a3
base: 736649fcb41544ef977bb7677a1e6a5df5b7996b
reviewed_at: 2026-11-05T17:07+08:00
reviewer: liaoxin01
model: gpt-6-astra
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: true

Notes for maintainers

  • Static source review covered the reader, unit test and RUNNING/FINISHED/CANCELLED regression paths, including cloud counterparts. No build or test execution was performed; pure-text BE build-hygiene checks passed. Author-reported test runs were not independently reproduced.

Reviewed locally with the doris-repo-review pipeline. Repository policy may accept this receipt for the matching commit; it is not a human Apache approval.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.81% (35980/46240)
Line Coverage 63.17% (404908/641029)
Region Coverage 59.77% (342853/573654)
Branch Coverage 60.92% (158841/260748)

@gavinchou gavinchou added the p0_b label Nov 5, 2026
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.81% (35979/46240)
Line Coverage 63.16% (404875/641029)
Region Coverage 59.75% (342738/573654)
Branch Coverage 60.92% (158836/260748)

@liaoxin01
liaoxin01 merged commit 17e561b into apache:master Nov 5, 2026
45 checks passed
@liaoxin01
liaoxin01 deleted the codex/fix-wal-shadow-column-ids branch November 5, 2026 12:45
github-actions Bot pushed a commit that referenced this pull request Nov 5, 2026
### What problem does this PR solve?

Heavy ALTER operations can write base and shadow columns with the same
ID into Group Commit WALs. V2 rejects these valid headers as corruption.
Accept duplicate IDs while preserving physical column order and the
existing first-column mapping.

Related PR: #66008

### Release note

Fix Group Commit WAL replay failures during heavy schema changes with
FileScannerV2.
github-actions Bot pushed a commit that referenced this pull request Nov 5, 2026
### What problem does this PR solve?

Heavy ALTER operations can write base and shadow columns with the same
ID into Group Commit WALs. V2 rejects these valid headers as corruption.
Accept duplicate IDs while preserving physical column order and the
existing first-column mapping.

Related PR: #66008

### Release note

Fix Group Commit WAL replay failures during heavy schema changes with
FileScannerV2.
liaoxin01 added a commit to liaoxin01/doris that referenced this pull request Nov 6, 2026
### Background

Group commit producers and consumers can be planned on different FEs. Their block layouts follow the table's full schema.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#69660 (same layout issue), apache#70160 (upstream WAL replay compatibility)
PR Type: Bugfix

Problem Summary:

Different index-map iteration orders can produce different MV column layouts across FEs, causing group commit cast errors or swapped values.

### Details

- **Frequency:** Multiple synchronous MVs with producer and consumer plans generated on different FEs.
- **Root cause:** Full-schema construction follows map iteration order, which can differ after metadata recovery.
- **Why existing tests missed it:** Coverage missed recovery followed by adding another MV across FEs.
- **Fix:** Keep base columns first, then visit indexes in ascending ID order and deduplicate columns by definition name.
- **Other paths and branches:** Rollup, Schema Change and Gson recovery share this method. Mixed-version FEs can still generate different layouts during rollout.
- **Behavior change:** Identical index metadata produces identical full-schema layouts across FEs.

### Testing

- 44 FE unit tests passed. Both new regression tests fail before the fix and pass afterward.
- FE server build with Checkstyle passed (UI disabled); baseline ASAN BE rebuilt.
- Six-MV `multiple_ssb` passed through both FEs. All 54 output columns matched, including after follower restart.
- Base-only, multi-MV and Schema Change WAL replay regressions passed through the follower. The initial ASAN run hit the local 16 GB memory cap; rerunning with 32 GB passed.

### Release note

Fix group commit failures and incorrect MV values caused by inconsistent column ordering across FEs.

### Check List (For Author)

- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Ready; local checks passed, CI pending.

### AI Disclosure

- Tool: Codex
- Generated: Code, tests, and description
- Human review: Pending author review
yiguolei pushed a commit that referenced this pull request Nov 10, 2026
yiguolei pushed a commit that referenced this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants