Skip to content

[fix](cloud) Skip global packed index probe when opening files of committed rowsets - #69980

Merged
liaoxin01 merged 1 commit into
apache:masterfrom
liaoxin01:fix-packed-fs-skip-global-probe
Nov 5, 2026
Merged

liaoxin01 merged 1 commit into
apache:masterfrom
liaoxin01:fix-packed-fs-skip-global-probe

Conversation

@liaoxin01

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #64995

Problem Summary:

A cloud BE logs a burst of WARN lines with a full stack trace like

meet error status: [NOT_FOUND]File not found in global packed index: data/<tablet>/<rowset>_0.idx

while compaction reads its input rowsets. In one instance a 4-hour BE log had 42k
such lines over 21k paths in 158 tablets, yet every compaction succeeded.

Reproduce: write a rowset whose segment file is smaller than
small_file_threshold_bytes (so it is packed) but whose inverted index file is
larger (so it is uploaded as a regular object), then compact or query it. Each
open of the regular .idx file prints the WARN with a stack, twice per compaction
(eligibility check and the merge itself).

Root cause: #64995 made PackedFileSystem::open_file_impl fall back to
PackedFileManager::get_packed_slice_location when a path is not in _index_map,
so that the file cache preload can read back a segment of the rowset being
written, whose rowset meta does not exist yet. The fallback was added
unconditionally, so it also runs for a PackedFileSystem built from a rowset
meta. That index map already holds every packed slice of the rowset, so a miss
means a regular file, and the probe can only fail. The failure is a
Status::NotFound, and NOT_FOUND records a stack trace and logs a WARN as soon as
it is constructed, before the caller falls back to opening the regular file.

Fix:

  • Only consult the manager when the index map is not initialized, i.e. on the
    write path, the same split exists_impl and file_size_impl already make.
  • Return NOT_FOUND without a stack trace from get_packed_slice_location: on the
    write path a miss is also expected, for files too large to be packed.

After the fix, reading committed rowsets no longer takes the global index lock
or logs anything for regular files; the write-path preload still finds packed
slices through the manager.

Release note

Fix noisy "File not found in global packed index" WARN logs with stack traces
when reading rowsets that mix packed and regular files in cloud mode.

Check List (For Author)

  • Test: Unit Test
    • Added PackedFileSystemTest.OpenFileOfRowsetBeingWrittenUsesManagerLocation
      and PackedFileSystemTest.OpenRegularFileOfOpenedRowsetIgnoresManager;
      PackedFileSystemTest.* (24 tests) pass on an ASAN UT build.
    • PackedFileManagerTest.GetMergeFileIndexForUnknownPathReturnsNotFound passes.
      PackedFileManagerTest.AppendSmallFileSuccess crashes in
      FileCacheFactory::get_by_path when the suite is run on its own; it crashes
      the same way without this change.
  • Behavior changed: Yes. A PackedFileSystem built from rowset meta no longer
    looks paths up in the in-memory global packed index.
  • Does this need documentation: No

…mitted rowsets

### What problem does this PR solve?

Issue Number: None

Related PR: apache#64995

Problem Summary:

A cloud BE logs a burst of WARN lines with a full stack trace like

    meet error status: [NOT_FOUND]File not found in global packed index: data/<tablet>/<rowset>_0.idx

while compaction reads its input rowsets. In one instance a 4-hour BE log had 42k
such lines over 21k paths in 158 tablets, yet every compaction succeeded.

Reproduce: write a rowset whose segment file is smaller than
small_file_threshold_bytes (so it is packed) but whose inverted index file is
larger (so it is uploaded as a regular object), then compact or query it. Each
open of the regular .idx file prints the WARN with a stack, twice per compaction
(eligibility check and the merge itself).

Root cause: apache#64995 made PackedFileSystem::open_file_impl fall back to
PackedFileManager::get_packed_slice_location when a path is not in _index_map,
so that the file cache preload can read back a segment of the rowset being
written, whose rowset meta does not exist yet. The fallback was added
unconditionally, so it also runs for a PackedFileSystem built from a rowset
meta. That index map already holds every packed slice of the rowset, so a miss
means a regular file, and the probe can only fail. The failure is a
Status::NotFound, and NOT_FOUND records a stack trace and logs a WARN as soon as
it is constructed, before the caller falls back to opening the regular file.

Fix:
- Only consult the manager when the index map is not initialized, i.e. on the
  write path, the same split exists_impl and file_size_impl already make.
- Return NOT_FOUND without a stack trace from get_packed_slice_location: on the
  write path a miss is also expected, for files too large to be packed.

After the fix, reading committed rowsets no longer takes the global index lock
or logs anything for regular files; the write-path preload still finds packed
slices through the manager.

### Release note

Fix noisy "File not found in global packed index" WARN logs with stack traces
when reading rowsets that mix packed and regular files in cloud mode.

### Check List (For Author)

- Test: Unit Test
    - Added PackedFileSystemTest.OpenFileOfRowsetBeingWrittenUsesManagerLocation
      and PackedFileSystemTest.OpenRegularFileOfOpenedRowsetIgnoresManager;
      PackedFileSystemTest.* (24 tests) pass on an ASAN UT build.
    - PackedFileManagerTest.GetMergeFileIndexForUnknownPathReturnsNotFound passes.
      PackedFileManagerTest.AppendSmallFileSuccess crashes in
      FileCacheFactory::get_by_path when the suite is run on its own; it crashes
      the same way without this change.
- Behavior changed: Yes. A PackedFileSystem built from rowset meta no longer
  looks paths up in the in-memory global packed index.
- 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 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41417402039

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17580	5232	5098	5098
q2	2136	322	267	267
q3	10219	1435	829	829
q4	4672	467	352	352
q5	7444	795	519	519
q6	180	185	156	156
q7	746	793	608	608
q8	9254	1353	1054	1054
q9	5501	4233	4406	4233
q10	6839	1314	1024	1024
q11	446	247	230	230
q12	632	402	284	284
q13	18100	3943	3015	3015
q14	275	261	253	253
q15	q16	735	738	660	660
q17	1209	754	581	581
q18	7049	6176	6129	6129
q19	1088	952	590	590
q20	385	356	232	232
q21	5745	2474	2485	2474
q22	392	337	274	274
Total cold run time: 100627 ms
Total hot run time: 28862 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6031	5918	6094	5918
q2	743	626	555	555
q3	5673	5749	5421	5421
q4	2012	2213	1655	1655
q5	5803	5905	5598	5598
q6	240	185	141	141
q7	2301	1995	1795	1795
q8	3028	2654	2758	2654
q9	7818	7470	7493	7470
q10	3681	3604	3166	3166
q11	580	419	392	392
q12	681	681	519	519
q13	3293	3718	3021	3021
q14	297	288	260	260
q15	q16	649	684	611	611
q17	7853	7029	6976	6976
q18	13021	12192	12999	12192
q19	932	817	811	811
q20	2146	2135	1925	1925
q21	5697	4651	4715	4651
q22	495	447	404	404
Total cold run time: 72974 ms
Total hot run time: 66135 ms

@hello-stephen

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

query5	4321	591	460	460
query6	430	210	192	192
query7	4800	463	222	222
query8	332	167	169	167
query9	8799	3202	3204	3202
query10	483	310	254	254
query11	5960	3866	3575	3575
query12	149	91	88	88
query13	1257	438	328	328
query14	6195	3979	3666	3666
query14_1	3449	3447	3469	3447
query15	213	207	189	189
query16	949	435	422	422
query17	879	668	552	552
query18	2438	431	314	314
query19	231	162	127	127
query20	82	81	90	81
query21	209	129	102	102
query22	12972	13004	12930	12930
query23	13503	13035	12493	12493
query23_1	12698	12664	12523	12523
query24	7362	859	479	479
query24_1	478	467	483	467
query25	513	390	337	337
query26	1255	258	142	142
query27	2773	439	270	270
query28	4660	2062	2052	2052
query29	1563	572	430	430
query30	309	220	181	181
query31	1006	925	825	825
query32	157	90	90	90
query33	516	289	239	239
query34	991	848	502	502
query35	725	748	639	639
query36	854	839	718	718
query37	120	92	78	78
query38	1765	1718	1654	1654
query39	793	797	746	746
query39_1	732	711	737	711
query40	216	113	92	92
query41	67	65	63	63
query42	89	84	82	82
query43	350	357	311	311
query44	1313	705	713	705
query45	174	174	164	164
query46	851	970	572	572
query47	2995	2932	2749	2749
query48	297	314	219	219
query49	577	404	300	300
query50	673	273	210	210
query51	10597	10743	10527	10527
query52	82	81	73	73
query53	191	206	153	153
query54	251	220	193	193
query55	73	68	65	65
query56	246	217	223	217
query57	1687	1631	1566	1566
query58	298	280	272	272
query59	2239	2202	1963	1963
query60	321	257	243	243
query61	170	172	164	164
query62	435	336	278	278
query63	188	168	168	168
query64	2784	935	777	777
query65	3332	3287	3295	3287
query66	1779	423	299	299
query67	20149	20212	19918	19918
query68	2956	1028	635	635
query69	371	308	249	249
query70	875	777	784	777
query71	312	230	204	204
query72	2778	2620	2443	2443
query73	517	523	297	297
query74	4662	4516	4347	4347
query75	2339	2256	1928	1928
query76	2331	1009	589	589
query77	339	365	268	268
query78	9597	9785	9154	9154
query79	1012	856	530	530
query80	519	414	354	354
query81	525	329	271	271
query82	832	130	103	103
query83	293	193	178	178
query84	316	132	101	101
query85	815	434	366	366
query86	323	236	233	233
query87	2030	1988	1818	1818
query88	3781	2778	2804	2778
query89	330	280	238	238
query90	1907	170	168	168
query91	161	155	128	128
query92	100	87	90	87
query93	1016	1012	578	578
query94	447	312	269	269
query95	584	337	310	310
query96	699	503	239	239
query97	2471	2454	2309	2309
query98	167	156	143	143
query99	770	764	660	660
Total cold run time: 235306 ms
Total hot run time: 151683 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.04
query3	0.26	0.08	0.08
query4	1.62	0.11	0.12
query5	0.23	0.25	0.24
query6	1.16	0.68	0.69
query7	0.04	0.00	0.00
query8	0.06	0.03	0.04
query9	0.40	0.36	0.36
query10	0.60	0.57	0.60
query11	0.20	0.15	0.15
query12	0.18	0.14	0.15
query13	0.48	0.50	0.49
query14	1.01	1.02	1.01
query15	0.63	0.59	0.62
query16	0.35	0.35	0.35
query17	1.13	1.12	1.16
query18	0.21	0.18	0.18
query19	2.15	2.02	2.02
query20	0.02	0.02	0.01
query21	15.49	0.20	0.14
query22	4.86	0.06	0.05
query23	16.29	0.33	0.13
query24	3.20	0.49	0.38
query25	0.10	0.07	0.04
query26	0.98	0.21	0.15
query27	0.04	0.05	0.03
query28	2.96	0.75	0.35
query29	12.48	4.04	3.23
query30	0.28	0.14	0.10
query31	2.77	0.55	0.32
query32	3.23	0.59	0.51
query33	3.27	3.18	3.23
query34	15.44	3.95	3.32
query35	3.34	3.32	3.29
query36	0.54	0.44	0.43
query37	0.10	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.04	0.03
query40	0.18	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 96.66 s
Total hot run time: 24.19 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.69% (35885/46191)
Line Coverage 63.04% (403633/640303)
Region Coverage 59.69% (341878/572796)
Branch Coverage 60.74% (158083/260263)

@gavinchou

Copy link
Copy Markdown
Contributor

/review

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41635516615

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@gavinchou

Copy link
Copy Markdown
Contributor

Local pipeline review — ✅ PASS

schema: doris-repo-review/v1
status: PASS
pr: apache/doris#69980
commit: 9f29cdb4295e4be94cc3178a6a9e778642c357b4
base: 49bfbdecffb5b37aeadb0982700533e8daf7768d
reviewed_at: 2026-11-04T16:07+08:00
reviewer: gavinchou
model: gpt-6-astra
effort: xhigh
findings: {blocker: 0, major: 0, minor: 1, nit: 0}
rounds: 1
converged: true

Notes for maintainers

  • be/src/io/fs/packed_file_manager.cpp:528 — F-01 (test-coverage, Minor; not an undeclared production regression): expected manager-miss stack/WARN suppression lacks a direct assertion with enable_stacktrace enabled. The routing tests do not guard this separate part of the fix.
  • Static review only: no builds, tests, or live-cluster execution were performed in this review.

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.

@liaoxin01
liaoxin01 merged commit 28eb75d into apache:master Nov 5, 2026
40 of 41 checks passed
@liaoxin01
liaoxin01 deleted the fix-packed-fs-skip-global-probe branch November 5, 2026 02:02
github-actions Bot pushed a commit that referenced this pull request Nov 5, 2026
…mitted rowsets (#69980)

### What problem does this PR solve?

Issue Number: None

Related PR: #64995

Problem Summary:

A cloud BE logs a burst of WARN lines with a full stack trace like

meet error status: [NOT_FOUND]File not found in global packed index:
data/<tablet>/<rowset>_0.idx

while compaction reads its input rowsets. In one instance a 4-hour BE
log had 42k
such lines over 21k paths in 158 tablets, yet every compaction
succeeded.

Reproduce: write a rowset whose segment file is smaller than
small_file_threshold_bytes (so it is packed) but whose inverted index
file is
larger (so it is uploaded as a regular object), then compact or query
it. Each
open of the regular .idx file prints the WARN with a stack, twice per
compaction
(eligibility check and the merge itself).

Root cause: #64995 made PackedFileSystem::open_file_impl fall back to
PackedFileManager::get_packed_slice_location when a path is not in
_index_map,
so that the file cache preload can read back a segment of the rowset
being
written, whose rowset meta does not exist yet. The fallback was added
unconditionally, so it also runs for a PackedFileSystem built from a
rowset
meta. That index map already holds every packed slice of the rowset, so
a miss
means a regular file, and the probe can only fail. The failure is a
Status::NotFound, and NOT_FOUND records a stack trace and logs a WARN as
soon as
it is constructed, before the caller falls back to opening the regular
file.

Fix:
- Only consult the manager when the index map is not initialized, i.e.
on the
write path, the same split exists_impl and file_size_impl already make.
- Return NOT_FOUND without a stack trace from get_packed_slice_location:
on the
  write path a miss is also expected, for files too large to be packed.

After the fix, reading committed rowsets no longer takes the global
index lock
or logs anything for regular files; the write-path preload still finds
packed
slices through the manager.

### Release note

Fix noisy "File not found in global packed index" WARN logs with stack
traces
when reading rowsets that mix packed and regular files in cloud mode.
yiguolei pushed a commit that referenced this pull request Nov 6, 2026
…files of committed rowsets #69980 (#70235)

Cherry-picked from #69980

Co-authored-by: Xin Liao <[email protected]>
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.

4 participants