Skip to content

[enhance](cloud) Increase get version timeout to 30 seconds#65625

Merged
sollhui merged 1 commit into
apache:masterfrom
sollhui:agent/increase-get-version-timeout
Jul 17, 2026
Merged

[enhance](cloud) Increase get version timeout to 30 seconds#65625
sollhui merged 1 commit into
apache:masterfrom
sollhui:agent/increase-get-version-timeout

Conversation

@sollhui

@sollhui sollhui commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

The default timeout for FE get_version requests to MetaService is 3 seconds, which is too short when MetaService responds slowly. Increase the default timeout to 30 seconds to reduce premature request failures.

Release note

Increase the default FE get_version timeout from 3 seconds to 30 seconds.

Check List (For Author)

  • Test: Manual test (fe-common compilation and Checkstyle passed during FE build)
  • Behavior changed: Yes (the default get_version timeout increases to 30 seconds)
  • Does this need documentation: No

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

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

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

@sollhui

sollhui commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@sollhui

sollhui commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

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

I found two blocking issues with raising the default cloud get-version timeout to 30 seconds. Both are availability/lifecycle problems where this retrying MetaService call is used inside existing critical sections.

Critical checkpoints: the stated goal is clear, but the implementation is not safe in all affected call paths; the change is small but broad in effect; config compatibility is restart/default-only and not the primary blocker; no storage/wire compatibility issue was found; tests were not run in this review environment per instructions, and I did not find coverage for these timeout/critical-section interactions. No additional user focus was provided.

Comment thread fe/fe-common/src/main/java/org/apache/doris/common/Config.java
Comment thread fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@sollhui
sollhui force-pushed the agent/increase-get-version-timeout branch from bd1e485 to bf5f448 Compare July 15, 2026 07:03
@sollhui

sollhui commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

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

Copy link
Copy Markdown
Contributor

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

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17680	4122	4061	4061
q2	2046	326	202	202
q3	10315	1467	827	827
q4	4706	468	340	340
q5	7612	851	568	568
q6	201	170	137	137
q7	778	818	612	612
q8	10192	1654	1551	1551
q9	6182	4372	4403	4372
q10	6839	1741	1453	1453
q11	517	349	330	330
q12	801	569	457	457
q13	18151	3392	2764	2764
q14	271	272	245	245
q15	q16	790	777	708	708
q17	1206	1034	889	889
q18	6879	5798	5490	5490
q19	1448	1218	1110	1110
q20	794	668	567	567
q21	5872	2592	2394	2394
q22	437	367	287	287
Total cold run time: 103717 ms
Total hot run time: 29364 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4481	4469	4369	4369
q2	308	320	215	215
q3	4656	4968	4419	4419
q4	2079	2169	1391	1391
q5	4443	4277	4295	4277
q6	227	175	128	128
q7	2254	1949	1612	1612
q8	2514	2103	2133	2103
q9	7905	7709	7831	7709
q10	4684	4630	4163	4163
q11	638	404	384	384
q12	765	800	541	541
q13	3324	3696	2922	2922
q14	299	311	289	289
q15	q16	715	725	623	623
q17	1381	1408	1368	1368
q18	8186	7242	6831	6831
q19	1122	1069	1116	1069
q20	2216	2213	1933	1933
q21	5255	4582	4392	4392
q22	531	476	401	401
Total cold run time: 57983 ms
Total hot run time: 51139 ms

@hello-stephen

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

query5	4317	641	495	495
query6	468	212	201	201
query7	4952	622	338	338
query8	353	200	175	175
query9	8754	4008	4036	4008
query10	505	359	304	304
query11	5878	2326	2169	2169
query12	162	103	104	103
query13	1261	606	423	423
query14	6335	5185	4876	4876
query14_1	4252	4230	4244	4230
query15	210	206	176	176
query16	1028	464	359	359
query17	1108	676	553	553
query18	2478	473	336	336
query19	204	184	147	147
query20	111	107	102	102
query21	233	158	138	138
query22	13681	13469	13225	13225
query23	17168	16415	16171	16171
query23_1	16307	16194	16261	16194
query24	7665	1734	1299	1299
query24_1	1297	1300	1252	1252
query25	531	460	347	347
query26	1343	345	212	212
query27	2586	608	394	394
query28	4450	2011	1983	1983
query29	1083	629	462	462
query30	341	262	227	227
query31	1114	1090	966	966
query32	101	61	59	59
query33	518	306	249	249
query34	1174	1154	627	627
query35	759	782	661	661
query36	1181	1181	1059	1059
query37	152	104	87	87
query38	1874	1691	1671	1671
query39	876	880	860	860
query39_1	834	845	843	843
query40	246	164	138	138
query41	65	62	63	62
query42	95	95	96	95
query43	327	325	282	282
query44	1462	766	778	766
query45	194	184	177	177
query46	1053	1178	732	732
query47	2129	2142	1971	1971
query48	388	425	282	282
query49	579	418	295	295
query50	1073	427	329	329
query51	10764	10578	10650	10578
query52	87	91	77	77
query53	270	278	204	204
query54	299	251	244	244
query55	75	78	69	69
query56	308	317	299	299
query57	1347	1289	1209	1209
query58	314	284	268	268
query59	1609	1657	1432	1432
query60	332	300	270	270
query61	185	170	175	170
query62	545	493	445	445
query63	248	202	201	201
query64	2940	1184	991	991
query65	4733	4638	4587	4587
query66	1816	525	398	398
query67	29252	29145	29163	29145
query68	3688	1589	967	967
query69	401	319	289	289
query70	1110	979	964	964
query71	364	345	326	326
query72	3075	2650	2425	2425
query73	850	773	422	422
query74	5079	4922	4710	4710
query75	2520	2498	2136	2136
query76	2328	1204	814	814
query77	350	375	275	275
query78	11762	11883	11344	11344
query79	1410	1118	722	722
query80	1298	574	477	477
query81	535	331	294	294
query82	612	154	120	120
query83	384	322	294	294
query84	282	158	128	128
query85	956	606	516	516
query86	443	290	271	271
query87	1814	1824	1732	1732
query88	3698	2775	2791	2775
query89	446	384	330	330
query90	1950	202	200	200
query91	201	191	165	165
query92	64	60	56	56
query93	1710	1599	955	955
query94	743	357	309	309
query95	811	497	475	475
query96	1093	795	349	349
query97	2610	2639	2508	2508
query98	215	208	202	202
query99	1069	1116	986	986
Total cold run time: 264676 ms
Total hot run time: 177353 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.11	0.04	0.04
query3	0.24	0.13	0.14
query4	1.61	0.14	0.14
query5	0.23	0.23	0.23
query6	1.26	1.11	1.09
query7	0.04	0.01	0.01
query8	0.05	0.04	0.04
query9	0.38	0.32	0.34
query10	0.54	0.57	0.54
query11	0.19	0.13	0.13
query12	0.18	0.14	0.14
query13	0.47	0.47	0.47
query14	1.03	1.03	1.00
query15	0.63	0.59	0.59
query16	0.32	0.32	0.30
query17	1.12	1.10	1.08
query18	0.23	0.22	0.21
query19	2.02	1.99	1.92
query20	0.01	0.02	0.01
query21	15.43	0.24	0.13
query22	4.84	0.05	0.06
query23	16.14	0.30	0.12
query24	3.00	0.41	0.33
query25	0.12	0.05	0.05
query26	0.74	0.20	0.15
query27	0.07	0.04	0.03
query28	3.54	0.94	0.58
query29	12.52	4.12	3.28
query30	0.27	0.16	0.15
query31	2.77	0.59	0.31
query32	3.22	0.58	0.48
query33	3.18	3.23	3.20
query34	15.53	4.18	3.51
query35	3.51	3.54	3.51
query36	0.54	0.44	0.40
query37	0.10	0.07	0.06
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.15	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.04
Total cold run time: 96.61 s
Total hot run time: 25.03 s

@sollhui

sollhui commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

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.

Request changes.

Critical-checkpoint conclusions:

  • Goal, scope, and correctness: the one-line change lets one default MetaService get-version RPC wait up to 30 seconds, but VersionHelper applies it per attempt across up to 200 retries and every caller shares it. The PR therefore does not safely achieve its stated slow-response goal. Version decoding, cloud visible-version normalization, and data-visibility semantics themselves are unchanged; I found no separate committed/uncommitted-data or version-consistency corruption.
  • Concurrency and lifecycle: no new data race, deadlock cycle, static-initialization dependency, or ownership leak was introduced. The material regression is lock/request occupancy: in addition to the already-reported delete-bitmap lease and SHOW metadata read lock, foreground cancellation is ineffective, cloud export serializes RPCs under a read lock, and cloud DDL/restore paths can RPC under exclusive table locks. Background sync uses dedicated finite workers and gates table-cache advancement on successful partition batches, so no separate partial-state bug was substantiated there.
  • Configuration, compatibility, persistence, and parallel paths: no new config key, FE-BE field, wire/storage-format change, or rolling-upgrade incompatibility is introduced. This restart-only global default affects single and batch version fetches across query, export, DDL, restore, proc, transaction, and daemon paths rather than a caller-specific budget. Any fix must preserve DROP PARTITION versionTime logging and restore/alter state revalidation.
  • Performance and observability: the default worst-case wait becomes about 6,000 seconds plus retry sleeps, and serial partition/tablet callers amplify successful slow waits. Existing logs, RPC metrics, and query summary timing observe the latency but do not bound it or make cancellation effective.
  • Tests: the PR reports compilation/checkstyle only and adds no functional test for a slow/never-completing MetaService Future, caller deadline/cancellation, cold-cache table-lock release, export fan-out, or restore-after-failover. No result files changed. Per the review-runner instruction, this was a static review; no build or test was run here.
  • User focus: no additional focus was provided; the complete one-line change and all discovered caller families were reviewed.

Three new inline findings are attached. The two existing Config.java threads (SHOW metadata lock and cloud MoW delete-bitmap lock) were treated as known context and not duplicated. The PR is not ready until the get-version wait is bounded per operation/caller and MetaService RPCs are removed from the identified lock-held regions.


@ConfField
public static int default_get_version_from_ms_timeout_second = 3;
public static int default_get_version_from_ms_timeout_second = 30;

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.

This is a per-attempt timeout, so foreground version fetches can now escape their caller deadlines. VersionHelper.getVisibleVersion() applies it up to the default 200 times (about 100 minutes of waits). On a cold/expired cache, cloud Nereids planning synchronously reaches ScanNode.setVisibleVersionForOlapScanNodes() before a coordinator exists; after query_timeout, ConnectContext.checkTimeout() calls StmtExecutor.cancel(), but coord is null and the Future/retry loop keeps running. With cloud_partition_version_cache_ttl_ms <= 0 (or an expired cache), the short-circuit path can also call updateCloudPartitionVersions() before PointQueryExecutor creates its 10-second timeoutTs, and cancel(Status) is a no-op. Thus a 5-second query timeout can spend 30 seconds on one attempt and continue retrying. This is distinct from the existing lock-lifetime threads. Please pass one absolute caller deadline/cancellation signal into the version retry loop (and stop swallowing interruption), and add a never-completing-Future test proving foreground requests terminate within that deadline.


@ConfField
public static int default_get_version_from_ms_timeout_second = 3;
public static int default_get_version_from_ms_timeout_second = 30;

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.

Cloud EXPORT can serially multiply this enlarged wait while holding a table read lock, which is a distinct path from the existing batched SHOW PARTITIONS thread. ExportJob.generateOutfileLogicalPlans() keeps exportTable.readLock() across splitTablets(): for each of up to 2,000 partitions whose local version does not already prove it nonempty, CloudPartition.hasData() can issue a single-partition get-version RPC. With data_consistency=none, the initial consistency snapshot also calls getVisibleVersion() for every selected partition in that lock scope. ExportTaskExecutor later checks versions per tablet under the read lock as well (a nonpositive TTL can make those calls RPC too). One failed lookup alone can spend 30 seconds on each of 200 attempts, while slow successes repeat serially and exclude DDL writers. Please snapshot partition/tablet identities under the lock, batch the unique version fetches outside it under an export-level deadline, then reacquire and revalidate the identities/versions needed for consistency. Add a cold-cache/slow-MetaService cloud export test proving the write lock remains obtainable during the RPC.


@ConfField
public static int default_get_version_from_ms_timeout_second = 3;
public static int default_get_version_from_ms_timeout_second = 30;

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.

Exclusive cloud DDL/restore paths also inherit this 30-second-per-attempt policy. DROP PARTITION holds olapTable.writeLock() through InternalCatalog.dropPartitionWithoutCheck(), where partition.hasData() can fetch a cold cloud version before the drop log is written. CloudSchemaChangeJobV2 and CloudRollupJobV2 inherit running phases that take the table write lock and then call partition.getVisibleVersion() per partition before committing. When cloud restore is enabled, a resumed/replayed CloudRestoreJob inherits RestoreJob.allTabletCommitted(), which holds tbl.writeLockIfExist() while a no-op cloud updateVersionForRestore() is followed by getVisibleVersion() and replica updates; after restart/failover its nonserialized cache timestamp is cold. These paths can enter 30 seconds x 200 retries while all readers/writers are excluded. Please fetch/batch the required cloud version/has-data state outside the write lock under the operation deadline, then reacquire and revalidate table/partition/job state before mutating or logging (preserving drop versionTime semantics).

@sollhui
sollhui merged commit 14331e4 into apache:master Jul 17, 2026
36 of 37 checks passed
@sollhui
sollhui deleted the agent/increase-get-version-timeout branch July 17, 2026 04:57
github-actions Bot pushed a commit that referenced this pull request Jul 17, 2026
### What problem does this PR solve?

The default timeout for FE get_version requests to MetaService is 3
seconds, which is too short when MetaService responds slowly. Increase
the default timeout to 30 seconds to reduce premature request failures.
github-actions Bot pushed a commit that referenced this pull request Jul 17, 2026
### What problem does this PR solve?

The default timeout for FE get_version requests to MetaService is 3
seconds, which is too short when MetaService responds slowly. Increase
the default timeout to 30 seconds to reduce premature request failures.
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/3.1.x dev/4.0.x dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants