Skip to content

[fix](doris-catalog) avoid metadata refresh lock contention - #68042

Open
re20052 wants to merge 2 commits into
apache:masterfrom
re20052:fix/remote-doris-catalog-metadata-lock-contention
Open

re20052 wants to merge 2 commits into
apache:masterfrom
re20052:fix/remote-doris-catalog-metadata-lock-contention

Conversation

@re20052

@re20052 re20052 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary:

Concurrent queries against the same Remote Doris Catalog table with use_arrow_flight=false can stall during FE planning.

Two factors compound the problem:

  1. Lock design: makeSureInitialized() and metadata refresh share the same table monitor, which the refresh holds throughout RPC, deserialization, partition reconstruction, and cache updates. Arriving requests block at initialization before reaching the reuse branch. After a refresh completes, a thread leaving initialization may immediately reacquire the monitor for another refresh while others remain blocked, limiting result reuse.
  2. Large partition counts: More partitions increase metadata processing work and extend the monitor hold time, amplifying contention and request buildup.

This PR uses a FutureTask<RemoteOlapTable> to represent one metadata refresh:

  • Refresh coordination holds the monitor only to create or select a task; initialization remains synchronized.
  • The initiating request runs the refresh outside the monitor, without an executor or background thread.
  • Requests selecting an unfinished task on the same table instance share it. Each caller keeps its task reference, so a later refresh cannot replace the result it awaits.
  • If the current task has completed, successfully or exceptionally, the next task selection creates a new refresh. No TTL cache is added.
  • Refresh failures are wrapped in AnalysisException with the original cause. An interrupted waiter restores its interrupt status without cancelling the shared task.

The scope is one RemoteDorisExternalTable instance within one FE process. The metadata RPC parameters, partition synchronization, and cache update logic remain unchanged.

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

Manual test:

Concurrent-query validation was performed on a downstream build with the same refresh-coordination change, using temporary diagnostic logs excluded from this PR. It has not been rerun on this upstream branch.

Steps to reproduce the validation:

  1. Create a Remote Doris Catalog with use_arrow_flight=false.

  2. Disable SQL Cache in every query connection:

    SET enable_sql_cache = false;
  3. Run concurrent queries against the same remote table.

  4. With temporary instrumentation around task selection and execution, group logs by FE and table instance. Verify that requests selecting an unfinished task share its task identifier and only its creator runs the refresh.

  • Behavior changed:

    • No.

    • Yes.

      Requests selecting an in-progress refresh now share that task. After completion, the next task selection starts a new refresh. Refresh failures are consistently wrapped in AnalysisException, and interrupted waiters restore their interrupt status.

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

@re20052

re20052 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

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

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 13.38% (19/142) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17582	3038	3003	3003
q2	2094	272	223	223
q3	10230	902	523	523
q4	4668	268	207	207
q5	7653	583	385	385
q6	134	118	100	100
q7	541	525	396	396
q8	9247	892	903	892
q9	3524	2469	2448	2448
q10	6534	923	724	724
q11	388	204	181	181
q12	615	270	202	202
q13	18111	1566	1183	1183
q14	160	153	140	140
q15	q16	448	415	374	374
q17	1477	855	763	763
q18	3187	2356	2371	2356
q19	1278	914	730	730
q20	373	292	199	199
q21	5616	1846	1811	1811
q22	331	276	233	233
Total cold run time: 94191 ms
Total hot run time: 17073 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3365	3310	3273	3273
q2	514	412	371	371
q3	2279	2401	2242	2242
q4	1262	1222	923	923
q5	2268	2216	2224	2216
q6	181	127	90	90
q7	1060	993	905	905
q8	1617	1433	1418	1418
q9	3285	3232	3240	3232
q10	2033	1931	1724	1724
q11	360	276	254	254
q12	466	451	349	349
q13	1520	1565	1172	1172
q14	181	174	165	165
q15	q16	411	407	365	365
q17	3743	3340	3302	3302
q18	5082	4609	5243	4609
q19	971	873	884	873
q20	1038	1022	847	847
q21	3953	3267	3270	3267
q22	397	360	318	318
Total cold run time: 35986 ms
Total hot run time: 31915 ms

@hello-stephen

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

query5	4231	415	360	360
query6	374	140	133	133
query7	4934	428	238	238
query8	288	128	113	113
query9	8678	2920	2937	2920
query10	388	226	185	185
query11	5414	1068	940	940
query12	115	74	69	69
query13	1196	469	321	321
query14	6085	2290	2171	2171
query14_1	2017	2044	2067	2044
query15	177	124	117	117
query16	922	368	357	357
query17	793	448	360	360
query18	2331	333	259	259
query19	152	130	102	102
query20	73	69	71	69
query21	196	105	85	85
query22	5550	5572	5571	5571
query23	6821	6519	6387	6387
query23_1	6199	6265	6110	6110
query24	7281	1115	786	786
query24_1	777	767	768	767
query25	425	277	222	222
query26	1211	227	132	132
query27	2777	404	260	260
query28	4709	1523	1460	1460
query29	911	410	326	326
query30	251	157	130	130
query31	816	411	345	345
query32	125	68	68	68
query33	452	232	173	173
query34	1008	788	487	487
query35	405	392	346	346
query36	594	590	547	547
query37	117	81	73	73
query38	1013	870	813	813
query39	502	491	502	491
query39_1	455	481	446	446
query40	203	91	76	76
query41	55	53	52	52
query42	76	72	83	72
query43	241	240	213	213
query44	997	544	548	544
query45	114	109	104	104
query46	790	820	520	520
query47	791	768	724	724
query48	311	298	243	243
query49	549	244	195	195
query50	756	266	207	207
query51	7993	7972	8128	7972
query52	74	71	71	71
query53	251	205	159	159
query54	230	164	151	151
query55	83	61	56	56
query56	231	211	170	170
query57	693	689	661	661
query58	196	174	171	171
query59	1247	1285	1157	1157
query60	250	190	184	184
query61	143	142	164	142
query62	342	207	177	177
query63	173	140	139	139
query64	2632	655	550	550
query65	1675	1714	1657	1657
query66	1768	253	203	203
query67	10045	10047	9906	9906
query68	2992	1121	752	752
query69	341	217	193	193
query70	694	593	595	593
query71	252	192	166	166
query72	2290	1692	1553	1553
query73	617	603	320	320
query74	2005	1259	1175	1175
query75	1218	1146	976	976
query76	2368	730	511	511
query77	257	258	225	225
query78	4159	3946	3362	3362
query79	2302	872	544	544
query80	1543	332	262	262
query81	485	160	137	137
query82	630	123	96	96
query83	278	205	196	196
query84	286	113	88	88
query85	757	326	275	275
query86	394	180	182	180
query87	1039	1009	913	913
query88	2777	2127	2115	2115
query89	280	196	174	174
query90	1995	130	127	127
query91	131	122	96	96
query92	82	75	72	72
query93	1449	1082	658	658
query94	689	211	227	211
query95	508	287	236	236
query96	829	582	267	267
query97	1094	1080	1069	1069
query98	156	136	129	129
query99	419	351	307	307
Total cold run time: 178403 ms
Total hot run time: 83429 ms

@re20052

re20052 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

run nonConcurrent

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.08	0.04	0.04
query3	0.26	0.10	0.09
query4	1.62	0.09	0.10
query5	0.17	0.16	0.16
query6	1.25	0.72	0.68
query7	0.03	0.01	0.01
query8	0.04	0.03	0.03
query9	0.29	0.22	0.22
query10	0.38	0.36	0.35
query11	0.16	0.12	0.12
query12	0.14	0.12	0.12
query13	0.30	0.31	0.33
query14	0.47	0.45	0.45
query15	0.38	0.36	0.37
query16	0.20	0.23	0.23
query17	0.71	0.71	0.75
query18	0.19	0.18	0.17
query19	1.13	1.19	1.20
query20	0.01	0.01	0.01
query21	15.49	0.16	0.11
query22	5.08	0.05	0.04
query23	16.22	0.25	0.10
query24	3.01	0.34	0.27
query25	0.11	0.05	0.03
query26	0.76	0.16	0.12
query27	0.04	0.02	0.03
query28	3.69	0.57	0.26
query29	12.42	3.15	2.56
query30	0.26	0.12	0.12
query31	2.76	0.39	0.18
query32	3.50	0.34	0.24
query33	1.41	1.42	1.44
query34	15.43	2.27	1.83
query35	1.80	1.82	1.76
query36	0.47	0.30	0.30
query37	0.07	0.05	0.04
query38	0.04	0.02	0.02
query39	0.03	0.02	0.03
query40	0.11	0.08	0.07
query41	0.08	0.02	0.03
query42	0.03	0.02	0.03
query43	0.03	0.02	0.03
Total cold run time: 90.65 s
Total hot run time: 14.91 s

@freemandealer

Copy link
Copy Markdown
Member

/review

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

Static review of a33291d. Requesting changes for two correctness regressions in the new refresh coordination, plus the lack of deterministic coverage for the synchronization contract.

Critical checkpoint conclusions:

  • Goal and proof: moving RPC/deserialization out of the table monitor addresses the reported contention, but the widened sharing cohort can return a pre-commit metadata snapshot to a post-commit query. No targeted automated test proves the intended handoff behavior.
  • Scope: the one-file change is focused and otherwise small.
  • Concurrency and locking: task selection/replacement is protected by the table monitor; FutureTask execution is one-shot; completion safely publishes cached state; heavy work is outside the monitor; no ordinary lost wakeup, duplicate same-generation RPC, lock-order issue, or deadlock was found. The blocking issue is the semantic generation boundary, not Java publication.
  • Lifecycle: the transient task starts null after deserialization, retained cycles are collectable, and catalog eviction/reset introduces no separate defect. Explicit table refresh is another trigger for the accepted stale-generation issue.
  • Configuration: no configuration is added or changed.
  • Compatibility: no wire schema, FE-BE variable, storage format, function symbol, EditLog format, or rolling-upgrade issue was found.
  • Parallel paths: non-Arrow query binding, sink binding, remote insert, and insert-overwrite all converge on this method and inherit its task semantics; Arrow Flight is intentionally separate.
  • Conditions and error handling: null/done selection, ordinary exceptional retry, and waiter interrupt restoration are mechanically sound. FutureTask nevertheless captures Error causes, and the new ExecutionException handler incorrectly converts them into ordinary Nereids AnalysisException failures.
  • Tests and results: the diff contains no test; existing command tests mock getOlapTable(), and sequential Remote Doris regressions do not force the changed interleavings. The PR's cited concurrent validation ran on a downstream build and was not rerun on this head. Per the runner contract, this review was static-only and ran no local build or test.
  • Observability: existing warnings are adequate for ordinary refresh failures; no independent metric issue was found. Fatal-cause misclassification is covered by the inline issue.
  • Transactions, persistence, and data correctness: this class does not commit or persist data, but the returned partition visible version is installed in remote scan ranges. Reusing V after V+1 is visible violates subsequent-query visibility.
  • Variable propagation: no new FE-BE or distributed variable is introduced.
  • Performance and memory: removing the long monitor hold is beneficial, and per-generation task allocation/retention is negligible and no worse than the removed retained result/exception fields.
  • Other risks: no additional correctness, lifecycle, compatibility, performance, observability, or coverage defect survived the final sweep.

User focus: no additional user-provided focus was supplied.

Review status: complete static review. Two full convergence rounds finished; both complete-review agents and the separate risk-focused agent returned NO_NEW_VALUABLE_FINDINGS in round 2, and every candidate was accepted, deduplicated, or dismissed with concrete evidence.

// Remove redundant nested synchronized block
tableId = olapTable.getId();
partitions = Lists.newArrayList(olapTable.getPartitions());
tempPartitions = Lists.newArrayList(olapTable.getTempPartitions().getPartitions());

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.

[P1] Preserve the post-commit metadata boundary

isDone() lets a caller that starts after a remote transaction becomes visible join a refresh whose server-side snapshot predates that commit. FrontendServiceImpl.getOlapTableMeta() snapshots table/partition metadata under the remote table read lock; after that lock is released, V+1 can become visible while this task is still transporting or rebuilding a large response. A later query then selects this unfinished task and plans with version V, so committed rows can be invisible to a subsequent query. The removed monitor scope forced that later caller to wait and issue a new post-commit RPC, and the existing Remote Doris regression suite explicitly expects a select after insert to fetch the new partition version. Please preserve a generation/invalidation boundary that prevents post-snapshot callers from reusing earlier metadata.

This coordination protocol also has no deterministic upstream test: existing command tests mock getOlapTable(), and the cited manual concurrency run was not performed on this head. Please add latch/barrier-based FE coverage for one RPC/result within a shareable cohort, a fresh successor after completion or invalidation (including the V-to-V+1 schedule above), retry after exceptional completion, and interruption of one waiter without cancelling the shared task.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review. I do not consider the previous locking behavior a
post-commit consistency boundary.

The old implementation explicitly intended concurrent callers to reuse an
in-flight refresh through isSyncOlapTable, remoteOlapTable, and wait/notifyAll.
The reuse failed because makeSureInitialized() and the refresh section competed
for the same monitor. Although makeSureInitialized() released the monitor before
calling getDorisOlapTable(), the same running thread could immediately reacquire
it before the other awakened threads were scheduled. It then started another
long refresh and blocked those threads again. This monitor barging caused the
repeated serial refreshes observed in production; it was not an intentional
metadata-generation mechanism.

This PR restores the original single-flight intent: the monitor only selects a
FutureTask, while RPC and metadata reconstruction run outside it. Callers that
overlap an unfinished refresh share its result. Completed results are not
cached, so the next non-overlapping request always starts a new refresh.

A normal sequential INSERT followed by SELECT remains correct: the metadata
refresh used during INSERT planning finishes before execution and commit, so the
following SELECT sees a completed task and starts a new refresh. The reported
V-to-V+1 case requires an unrelated refresh and commit to overlap. Remote Doris
Catalog does not currently guarantee linearizable metadata snapshots across
such concurrent operations or remote FE nodes. Such a guarantee would require an
explicit metadata version or invalidation protocol, not reliance on accidental
monitor scheduling.

Therefore, I do not plan to add the proposed generation boundary or encode that
new consistency guarantee in this PR.

olapTable.setDatabase((RemoteDorisExternalDatabase) db);

tableId = olapTable.getId();
partitions = Lists.newArrayList(olapTable.getPartitions());

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.

[P1] Preserve fatal Error propagation

FutureTask.run() captures every Throwable, so an OutOfMemoryError while deserializing/copying the large partition set (or another JVM Error) reaches this branch as the ExecutionException cause. Wrapping it unconditionally in Nereids AnalysisException turns a fatal VM/invariant failure into an ordinary query-analysis error; on the direct query path that materially changes control flow, and the old catch (Exception) implementation did not catch the creator's Error. Please rethrow Error causes unchanged before wrapping expected refresh exceptions, and add a focused test for this boundary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The previous implementation did not explicitly handle Error either, nor did it provide consistent Error propagation across the refreshing and waiting threads.

More importantly, Errors such as OutOfMemoryError or StackOverflowError indicate a JVM-level failure rather than a recoverable metadata-refresh failure. Once such an Error occurs, the health of the entire FE process is already in question; preserving a specific propagation path in this method does not provide a meaningful correctness guarantee for this API.

This PR targets lock contention during normal metadata refreshes. It does not change metadata correctness or recoverable exception handling. Therefore, JVM-fatal Error propagation is outside the scope of this fix and should not be classified as a P1 issue.

@re20052
re20052 force-pushed the fix/remote-doris-catalog-metadata-lock-contention branch from e6fc9e5 to a33291d Compare September 16, 2026 14:03
@re20052

re20052 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 59.38% (19/32) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17573	3052	3007	3007
q2	2104	248	216	216
q3	10246	991	539	539
q4	4672	258	217	217
q5	7657	625	394	394
q6	145	122	102	102
q7	522	517	408	408
q8	9243	875	873	873
q9	3559	2438	2409	2409
q10	6510	895	702	702
q11	385	202	190	190
q12	604	267	203	203
q13	18137	1560	1194	1194
q14	161	152	141	141
q15	q16	445	409	378	378
q17	1369	859	752	752
q18	3169	2330	2312	2312
q19	1124	843	709	709
q20	386	290	210	210
q21	5323	1776	1836	1776
q22	330	271	232	232
Total cold run time: 93664 ms
Total hot run time: 16964 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3370	3313	3273	3273
q2	518	410	396	396
q3	2256	2343	2211	2211
q4	1254	1234	926	926
q5	2251	2181	2189	2181
q6	173	125	90	90
q7	1091	936	868	868
q8	1610	1410	1403	1403
q9	3287	3239	3237	3237
q10	1920	1853	1700	1700
q11	373	278	260	260
q12	471	432	341	341
q13	1493	1540	1173	1173
q14	185	173	169	169
q15	q16	424	415	369	369
q17	3693	3423	3369	3369
q18	4987	4649	5098	4649
q19	968	849	869	849
q20	1039	1021	878	878
q21	3878	3322	3250	3250
q22	406	351	326	326
Total cold run time: 35647 ms
Total hot run time: 31918 ms

@hello-stephen

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

query5	4247	426	343	343
query6	382	146	126	126
query7	4922	426	225	225
query8	288	130	131	130
query9	8694	2936	2933	2933
query10	407	230	187	187
query11	5390	1062	931	931
query12	122	74	72	72
query13	1206	444	313	313
query14	6161	2317	2148	2148
query14_1	2043	2033	2105	2033
query15	182	129	119	119
query16	926	388	363	363
query17	793	450	367	367
query18	2325	336	247	247
query19	184	155	114	114
query20	76	74	70	70
query21	199	104	87	87
query22	5631	5611	5455	5455
query23	7050	6485	6204	6204
query23_1	6386	6363	6167	6167
query24	7282	1126	769	769
query24_1	800	825	786	786
query25	454	302	251	251
query26	1230	241	131	131
query27	2773	407	273	273
query28	4697	1512	1545	1512
query29	935	450	353	353
query30	255	154	133	133
query31	826	415	352	352
query32	136	78	78	78
query33	461	231	185	185
query34	1007	827	472	472
query35	404	410	356	356
query36	572	585	565	565
query37	158	86	69	69
query38	1017	865	833	833
query39	507	491	503	491
query39_1	505	503	447	447
query40	195	95	84	84
query41	57	54	52	52
query42	79	71	77	71
query43	251	241	212	212
query44	1007	549	534	534
query45	117	107	106	106
query46	756	834	534	534
query47	762	774	726	726
query48	303	316	220	220
query49	532	244	184	184
query50	751	262	220	220
query51	7920	8025	7991	7991
query52	72	69	62	62
query53	216	245	149	149
query54	216	172	160	160
query55	73	58	59	58
query56	224	185	176	176
query57	703	680	676	676
query58	215	163	165	163
query59	1274	1281	1158	1158
query60	229	181	173	173
query61	109	105	115	105
query62	334	205	173	173
query63	171	149	137	137
query64	2639	684	554	554
query65	1749	1679	1651	1651
query66	1772	272	195	195
query67	10521	10021	9764	9764
query68	2756	1118	688	688
query69	351	233	201	201
query70	666	618	617	617
query71	249	185	171	171
query72	2504	1659	1483	1483
query73	648	606	341	341
query74	1578	1271	1176	1176
query75	1191	1144	995	995
query76	2286	756	554	554
query77	261	245	211	211
query78	4253	3866	3292	3292
query79	2362	792	577	577
query80	1558	323	278	278
query81	487	157	134	134
query82	603	127	95	95
query83	306	214	196	196
query84	291	108	88	88
query85	780	316	265	265
query86	380	181	171	171
query87	1056	1001	922	922
query88	2793	2111	2126	2111
query89	286	198	176	176
query90	1930	133	134	133
query91	128	113	94	94
query92	77	72	72	72
query93	1493	1148	682	682
query94	637	270	203	203
query95	527	263	240	240
query96	852	626	263	263
query97	1106	1084	1061	1061
query98	137	136	131	131
query99	426	343	311	311
Total cold run time: 179247 ms
Total hot run time: 83140 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.08	0.04	0.04
query3	0.27	0.11	0.11
query4	1.60	0.10	0.09
query5	0.18	0.17	0.16
query6	1.25	0.69	0.70
query7	0.03	0.00	0.01
query8	0.05	0.03	0.03
query9	0.29	0.22	0.21
query10	0.36	0.39	0.36
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.30	0.32	0.31
query14	0.48	0.47	0.46
query15	0.38	0.36	0.36
query16	0.22	0.24	0.23
query17	0.64	0.69	0.74
query18	0.19	0.17	0.16
query19	1.23	1.18	1.15
query20	0.01	0.00	0.00
query21	15.50	0.16	0.13
query22	5.08	0.05	0.04
query23	16.18	0.25	0.10
query24	3.01	0.33	0.24
query25	0.10	0.04	0.04
query26	0.75	0.17	0.12
query27	0.04	0.02	0.03
query28	3.63	0.59	0.27
query29	12.42	3.25	2.59
query30	0.26	0.12	0.12
query31	2.75	0.38	0.17
query32	3.51	0.32	0.23
query33	1.40	1.52	1.47
query34	15.40	2.21	1.82
query35	1.82	1.78	1.78
query36	0.46	0.31	0.30
query37	0.06	0.04	0.04
query38	0.04	0.04	0.03
query39	0.03	0.03	0.02
query40	0.12	0.08	0.08
query41	0.07	0.03	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.02
Total cold run time: 90.57 s
Total hot run time: 14.95 s

@freemandealer

Copy link
Copy Markdown
Member

/review

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

Exact-head static review completed for 6e8c98d4c7cf6e8ae01488fcfe388870d17ae956.

No additional non-duplicate inline findings were found. The two existing inline discussions remain the applicable concerns on this head and were not reposted: the metadata generation/invalidation boundary (discussion_r4024408493) and fatal Error propagation through FutureTask (discussion_r4024408497). This review does not supersede those discussions.

Critical checkpoint conclusions:

  • Goal and proof: the patch narrows the table monitor to task selection and runs remote RPC/deserialization outside it. The added JUnit coverage proves one in-flight task/result is shared, a completed task gets a fresh successor, and an exceptional task can be retried. Per the review-runner instructions, builds and tests were not executed here, so verification is static only.
  • Scope and clarity: the change is focused on one coordination method plus its unit test; no unrelated production behavior was added.
  • Concurrency: FE planning threads are the concurrent callers. currentRefreshTask is accessed under the table monitor, callers retain a stable local task reference, and FutureTask completion publishes the constructed result. Expensive RPC, reconstruction, and backend-cache inspection are outside the monitor. No new lock-order or deadlock issue was found.
  • Lifecycle: successful and exceptional tasks are replaced after terminal completion; an interrupted waiter restores its interrupt status without cancelling the shared task; the task field is transient. The known post-snapshot/post-invalidation reuse schedule is already covered by the existing generation-boundary thread.
  • Configuration and compatibility: no configuration, FE/BE protocol, persisted format, function symbol, or rolling-upgrade contract changes are introduced.
  • Parallel paths: query binding, sink binding, normal remote insert, and insert-overwrite all resolve through the same refresh protocol; no missing parallel implementation was found.
  • Conditions and errors: runtime refresh failures are logged once, shared through the task, wrapped with their cause, and retried by a successor task. The distinct fatal-Error behavior is already covered by the existing thread.
  • Tests and results: the latch-based test is deterministic for the covered cohort and the retry assertion is sound. The existing discussions already fence the missing generation/invalidation, interruption, and fatal-Error boundary cases. No generated result files are involved.
  • Observability: the warning includes database and table identifiers; no new metric or additional INFO logging is warranted for this local coordination change.
  • Transactions, persistence, and data writes: the patch changes metadata-read coordination only; it adds no EditLog state, transaction transition, data-write operation, or new FE-to-BE variable.
  • Performance: the long metadata work is removed from the table monitor without adding an executor, background task, redundant scan, or new steady-state cache. No additional performance defect was found.
  • User focus: no additional focus points were supplied; the complete two-file change was reviewed.

Review convergence: two normal full-review passes and one risk-focused pass all returned NO_NEW_VALUABLE_FINDINGS; the main-agent final changed-file and unresolved-candidate sweep found no new comment to submit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants