Skip to content

[fix](test) Stabilize lineage skip internal schema test#65235

Open
seawinde wants to merge 1 commit into
apache:masterfrom
seawinde:fix-doris-24770-lineage-skip
Open

[fix](test) Stabilize lineage skip internal schema test#65235
seawinde wants to merge 1 commit into
apache:masterfrom
seawinde:fix-doris-24770-lineage-skip

Conversation

@seawinde

@seawinde seawinde commented Jul 6, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: N/A

Related PR: #61004

Problem Summary:

LineageUtilsSkipTest.testSkipInternalSchemaInsert could fail
intermittently in FE UT with Failed to acquire catalog lock. Try again.

Root cause: In LineageUtilsSkipTest.beforeCluster(), the test enabled
FeConstants.enableInternalSchemaDb before the mocked FE cluster started.
This allowed the background InternalSchemaInitializer to run during test
startup. The background initializer and the test method both performed DDL,
so they could race on the catalog lock used by InternalCatalog.createDb().

This PR keeps the background internal schema initializer disabled for the
unit test and creates the required internal schema synchronously in
runBeforeAll().

File Change Description
LineageUtilsSkipTest.java Stop enabling the background internal schema initializer, create the internal schema synchronously before the test body, and remove duplicate per-test initialization.

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

./run-fe-ut.sh --run org.apache.doris.nereids.lineage.LineageUtilsSkipTest#testSkipInternalSchemaInsert

  • 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

@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?

@seawinde

seawinde commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17719	4068	4041	4041
q2	2063	344	218	218
q3	10234	1382	812	812
q4	4682	469	347	347
q5	7518	871	575	575
q6	175	169	135	135
q7	804	822	623	623
q8	9338	1624	1559	1559
q9	5607	4417	4383	4383
q10	6797	1829	1518	1518
q11	502	335	318	318
q12	711	542	430	430
q13	18101	3448	2778	2778
q14	263	262	255	255
q15	q16	793	778	721	721
q17	1011	959	888	888
q18	6905	5891	5510	5510
q19	1265	1310	1044	1044
q20	789	662	543	543
q21	5760	2614	2374	2374
q22	436	359	299	299
Total cold run time: 101473 ms
Total hot run time: 29371 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4358	4293	4267	4267
q2	300	324	216	216
q3	4550	4986	4392	4392
q4	2047	2153	1371	1371
q5	4443	4354	4304	4304
q6	227	171	126	126
q7	1715	1775	1848	1775
q8	2642	2182	2177	2177
q9	8042	8208	7831	7831
q10	4735	4716	4273	4273
q11	570	415	383	383
q12	764	769	595	595
q13	3240	3651	2997	2997
q14	310	323	288	288
q15	q16	731	744	656	656
q17	1343	1311	1271	1271
q18	8067	7262	7301	7262
q19	1178	1104	1040	1040
q20	2193	2190	1944	1944
q21	5222	4498	4458	4458
q22	515	482	395	395
Total cold run time: 57192 ms
Total hot run time: 52021 ms

@hello-stephen

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

query5	4310	647	484	484
query6	459	216	210	210
query7	4881	609	344	344
query8	342	188	168	168
query9	8780	4000	4011	4000
query10	455	355	292	292
query11	5946	2380	2190	2190
query12	157	104	101	101
query13	1249	572	468	468
query14	6292	5286	4958	4958
query14_1	4293	4281	4291	4281
query15	214	207	189	189
query16	1027	491	454	454
query17	958	729	612	612
query18	2447	484	346	346
query19	213	189	153	153
query20	109	112	112	112
query21	235	161	130	130
query22	13597	13625	13532	13532
query23	17417	16469	16059	16059
query23_1	16281	16292	16360	16292
query24	7496	1783	1263	1263
query24_1	1319	1296	1305	1296
query25	571	467	409	409
query26	1323	356	226	226
query27	2598	609	383	383
query28	4501	1996	2014	1996
query29	1122	606	476	476
query30	337	262	222	222
query31	1125	1093	976	976
query32	110	60	60	60
query33	514	320	245	245
query34	1194	1167	654	654
query35	758	788	651	651
query36	1410	1384	1228	1228
query37	166	110	92	92
query38	1887	1707	1646	1646
query39	924	911	880	880
query39_1	878	888	872	872
query40	254	161	143	143
query41	65	63	63	63
query42	95	89	90	89
query43	317	329	281	281
query44	1413	767	769	767
query45	211	185	185	185
query46	1085	1198	714	714
query47	2383	2315	2247	2247
query48	388	422	291	291
query49	586	429	333	333
query50	1011	402	319	319
query51	10779	10444	10730	10444
query52	84	88	81	81
query53	272	270	197	197
query54	286	246	230	230
query55	74	71	66	66
query56	299	278	267	267
query57	1437	1418	1327	1327
query58	320	264	257	257
query59	1556	1649	1438	1438
query60	311	271	247	247
query61	152	147	150	147
query62	702	646	586	586
query63	245	204	200	200
query64	2545	768	581	581
query65	4890	4771	4782	4771
query66	1835	496	386	386
query67	29512	29374	29323	29323
query68	3189	1531	945	945
query69	405	298	260	260
query70	1084	964	996	964
query71	366	323	293	293
query72	2930	2206	2370	2206
query73	792	814	451	451
query74	5114	4964	4769	4769
query75	2610	2603	2243	2243
query76	2340	1180	815	815
query77	351	384	282	282
query78	12345	12450	11715	11715
query79	1366	1168	732	732
query80	667	541	453	453
query81	466	326	281	281
query82	565	161	126	126
query83	394	330	291	291
query84	326	160	130	130
query85	927	582	509	509
query86	366	287	278	278
query87	1828	1823	1758	1758
query88	3699	2769	2756	2756
query89	464	400	362	362
query90	1955	205	192	192
query91	196	184	165	165
query92	63	59	59	59
query93	1626	1530	977	977
query94	558	366	328	328
query95	801	513	460	460
query96	1063	786	341	341
query97	2742	2666	2557	2557
query98	226	205	196	196
query99	1166	1186	981	981
Total cold run time: 264428 ms
Total hot run time: 179078 ms

@hello-stephen

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

query1	0.00	0.01	0.01
query2	0.09	0.06	0.05
query3	0.26	0.14	0.14
query4	1.61	0.17	0.14
query5	0.25	0.22	0.22
query6	1.29	1.12	1.07
query7	0.03	0.01	0.00
query8	0.06	0.04	0.04
query9	0.38	0.31	0.32
query10	0.54	0.55	0.56
query11	0.19	0.14	0.14
query12	0.18	0.14	0.14
query13	0.47	0.46	0.47
query14	1.01	1.01	1.00
query15	0.63	0.60	0.61
query16	0.32	0.34	0.31
query17	1.12	1.21	1.15
query18	0.23	0.22	0.21
query19	2.11	1.97	1.94
query20	0.02	0.02	0.01
query21	15.44	0.20	0.13
query22	4.95	0.05	0.06
query23	16.15	0.30	0.12
query24	3.08	0.44	0.34
query25	0.12	0.06	0.03
query26	0.73	0.21	0.14
query27	0.05	0.04	0.03
query28	3.54	0.96	0.54
query29	12.50	4.08	3.22
query30	0.27	0.14	0.16
query31	2.77	0.58	0.31
query32	3.23	0.59	0.49
query33	3.20	3.19	3.30
query34	15.56	4.23	3.53
query35	3.56	3.56	3.57
query36	0.56	0.44	0.43
query37	0.08	0.07	0.06
query38	0.05	0.05	0.03
query39	0.04	0.03	0.03
query40	0.17	0.16	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.05	0.04	0.03
Total cold run time: 97.01 s
Total hot run time: 25.1 s

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: LineageUtilsSkipTest enabled the background internal schema initializer before starting the mocked FE cluster, then manually initialized the internal schema in the test method. On slow FE UT runs this could race with other DDL and make createDatabase fail to acquire the catalog lock within the 5 second tryLock timeout. This change keeps the background initializer disabled for the UT and synchronously creates the internal schema in runBeforeAll, matching existing internal schema test setup.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - ./run-fe-ut.sh --run org.apache.doris.nereids.lineage.LineageUtilsSkipTest#testSkipInternalSchemaInsert
- Behavior changed: No
- Does this need documentation: No
@seawinde seawinde force-pushed the fix-doris-24770-lineage-skip branch from 22ed91d to c027671 Compare July 9, 2026 03:16
@seawinde

seawinde commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17782	4069	4035	4035
q2	2040	329	201	201
q3	10342	1381	851	851
q4	4683	470	345	345
q5	7534	850	574	574
q6	188	173	137	137
q7	857	833	654	654
q8	9323	1633	1539	1539
q9	5638	4378	4422	4378
q10	6844	1778	1532	1532
q11	498	338	328	328
q12	716	555	430	430
q13	18078	3405	2763	2763
q14	268	259	249	249
q15	q16	798	789	715	715
q17	954	881	982	881
q18	6930	5688	5597	5597
q19	1166	1266	1071	1071
q20	764	664	599	599
q21	5612	2623	2323	2323
q22	433	367	295	295
Total cold run time: 101448 ms
Total hot run time: 29497 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4432	4322	4322	4322
q2	284	316	215	215
q3	4565	4944	4435	4435
q4	2060	2160	1385	1385
q5	4404	4332	4317	4317
q6	230	171	130	130
q7	1731	1720	1971	1720
q8	2606	2146	2334	2146
q9	8085	8117	7882	7882
q10	4728	4686	4309	4309
q11	553	404	408	404
q12	767	778	555	555
q13	3346	3604	2962	2962
q14	314	307	278	278
q15	q16	718	725	635	635
q17	1331	1334	1280	1280
q18	7990	7260	7215	7215
q19	1155	1124	1145	1124
q20	2227	2217	1930	1930
q21	5287	4614	4462	4462
q22	518	471	421	421
Total cold run time: 57331 ms
Total hot run time: 52127 ms

@hello-stephen

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

query5	4323	676	526	526
query6	463	239	213	213
query7	4880	592	359	359
query8	342	196	177	177
query9	8748	4082	4067	4067
query10	476	344	294	294
query11	5964	2388	2186	2186
query12	157	104	97	97
query13	1251	585	423	423
query14	6177	5575	5145	5145
query14_1	4516	4478	4476	4476
query15	223	219	186	186
query16	1011	470	466	466
query17	920	734	590	590
query18	2441	480	338	338
query19	208	191	148	148
query20	108	108	120	108
query21	228	156	134	134
query22	13636	13719	13540	13540
query23	17658	16543	16368	16368
query23_1	16415	16288	16260	16260
query24	7453	1821	1317	1317
query24_1	1331	1326	1297	1297
query25	542	451	365	365
query26	1343	385	211	211
query27	2588	629	390	390
query28	4497	2001	2011	2001
query29	1055	610	497	497
query30	338	273	231	231
query31	1127	1127	1002	1002
query32	103	61	58	58
query33	525	335	249	249
query34	1174	1212	650	650
query35	798	811	687	687
query36	1355	1335	1239	1239
query37	160	113	91	91
query38	1890	1713	1665	1665
query39	925	912	889	889
query39_1	896	880	883	880
query40	252	167	143	143
query41	75	70	70	70
query42	97	101	96	96
query43	337	342	292	292
query44	1490	792	793	792
query45	211	194	181	181
query46	1073	1242	779	779
query47	2294	2323	2149	2149
query48	396	445	292	292
query49	604	453	338	338
query50	1133	439	344	344
query51	10658	10759	10715	10715
query52	94	94	79	79
query53	258	284	212	212
query54	297	268	245	245
query55	78	78	71	71
query56	346	307	304	304
query57	1425	1412	1293	1293
query58	300	284	283	283
query59	1612	1681	1454	1454
query60	336	290	282	282
query61	177	175	177	175
query62	711	670	601	601
query63	264	209	228	209
query64	2972	1161	994	994
query65	4924	4834	4795	4795
query66	1870	607	401	401
query67	29505	28865	29355	28865
query68	3135	1536	955	955
query69	435	303	287	287
query70	1090	974	1002	974
query71	325	312	299	299
query72	3340	2550	2496	2496
query73	833	736	413	413
query74	5157	4999	4758	4758
query75	2750	2678	2255	2255
query76	2341	1258	806	806
query77	371	412	300	300
query78	12447	12400	11764	11764
query79	1471	1157	787	787
query80	1297	582	499	499
query81	533	326	287	287
query82	633	163	125	125
query83	378	316	305	305
query84	326	160	131	131
query85	971	609	507	507
query86	433	307	298	298
query87	1840	1845	1769	1769
query88	3797	2833	2771	2771
query89	468	405	358	358
query90	1919	216	205	205
query91	203	193	160	160
query92	67	65	60	60
query93	1703	1581	1061	1061
query94	736	360	325	325
query95	780	492	471	471
query96	1131	856	387	387
query97	2691	2673	2602	2602
query98	221	218	213	213
query99	1133	1171	1014	1014
Total cold run time: 267505 ms
Total hot run time: 181269 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.26	0.15	0.14
query4	1.61	0.14	0.14
query5	0.29	0.23	0.23
query6	1.23	1.03	1.07
query7	0.04	0.02	0.01
query8	0.05	0.03	0.04
query9	0.38	0.32	0.32
query10	0.57	0.57	0.55
query11	0.19	0.14	0.14
query12	0.19	0.15	0.15
query13	0.47	0.48	0.48
query14	1.03	1.00	1.01
query15	0.63	0.60	0.61
query16	0.33	0.34	0.32
query17	1.14	1.11	1.09
query18	0.23	0.21	0.22
query19	2.05	1.95	1.96
query20	0.02	0.02	0.01
query21	15.49	0.21	0.15
query22	4.90	0.05	0.06
query23	16.09	0.32	0.12
query24	2.96	0.42	0.32
query25	0.11	0.06	0.04
query26	0.74	0.20	0.14
query27	0.04	0.04	0.04
query28	3.51	0.92	0.53
query29	12.49	4.08	3.22
query30	0.27	0.15	0.17
query31	2.78	0.60	0.31
query32	3.22	0.59	0.49
query33	3.28	3.15	3.21
query34	15.41	4.25	3.55
query35	3.51	3.51	3.52
query36	0.55	0.46	0.44
query37	0.08	0.07	0.06
query38	0.06	0.04	0.04
query39	0.04	0.02	0.02
query40	0.18	0.16	0.16
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.69 s
Total hot run time: 25.04 s

@morrySnow

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@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.

Automated review completed for PR 65235 at head c0276717ba482eb26bb240deece5842a5b576b43.

No inline issues found.

Critical checkpoint conclusions:

  • Goal and scope: The change is narrowly scoped to LineageUtilsSkipTest fixture setup. It keeps the background InternalSchemaInitializer disabled during mocked FE startup and creates the internal schema synchronously in runBeforeAll(), which matches the stated stabilization goal.
  • Test evidence: The PR reports ./run-fe-ut.sh --run org.apache.doris.nereids.lineage.LineageUtilsSkipTest#testSkipInternalSchemaInsert; GitHub FE UT and CheckStyle are passing for this head. I did not run the FE UT locally because this checkout lacks .worktree_initialized and thirdparty/installed/bin/protoc, and fe/AGENTS.md says to stop when protoc is missing.
  • Concurrency and lifecycle: The previous race came from re-enabling FeConstants.enableInternalSchemaDb before MockedFrontend.start(), allowing the background initializer to compete with test DDL. TestWithFeService.beforeAll() now leaves that flag false before cluster creation, and the schema setup runs synchronously after the cluster exists.
  • Session/config state: Config.activate_lineage_plugin is still restored after each test. The new FeConstants.runningUnitTest = true follows existing internal-schema FE UT patterns, and FE surefire uses reuseForks=false, so I did not find a cross-test static leak issue.
  • Compatibility, persistence, data correctness, observability, and performance: This is test-only code; no production protocol, storage, transaction, persistence, or runtime behavior changes were found.
  • Parallel paths: Existing internal-schema setup patterns in InternalSchemaAlterTest and StmtExecutorTest align with this approach; no missing parallel production path was identified.
  • CI note: One External Regression status is failing, but the changed file is a single FE unit test and I found no evidence tying that external-suite failure to this patch.
  • User focus: No additional user-provided review focus was present.

Subagent conclusions:

  • optimizer-rewrite: No candidates. It reviewed the changed test plus lineage/insert planning paths and reported NO_NEW_VALUABLE_FINDINGS.
  • tests-session-config: No candidates. It reviewed test lifecycle, session/config state, style/CI context, and reported no actionable issue.
  • Convergence round 1: Both live subagents reviewed the same current ledger and empty proposed inline-comment set and replied NO_NEW_VALUABLE_FINDINGS.

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/4.0.x dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants