Skip to content

[improvement](cloud) Remove pre-rowset delete bitmaps by key - #66598

Open
mymeiyi wants to merge 1 commit into
apache:masterfrom
mymeiyi:delete-dmb-key
Open

[improvement](cloud) Remove pre-rowset delete bitmaps by key#66598
mymeiyi wants to merge 1 commit into
apache:masterfrom
mymeiyi:delete-dmb-key

Conversation

@mymeiyi

@mymeiyi mymeiyi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Problem Summary: Cloud cumulative compaction previously removed aggregated pre-rowset delete bitmaps with a Meta Service range clear, which may cause pressure to FDB.

Solution: This pr change to range remove to point remove to FDB with a be.conf: enable_remove_pre_rowsets_delete_bitmap_by_keys=true

  1. Collect each original bitmap within the aggregation version range, including <rowset ID, segment ID, version, serialized size>, then encode those statistics in UpdateDeleteBitmapRequest.
  2. Meta Service reconstructs the split blob keys and removes them individually in bounded transactions using the established transaction-size.
  3. Since the blob key num is estimated, if the estimated num is small, may leave some tail delete_bitmap keys, such as {delete_bitmap_key}_10. Reads skip obsolete incomplete blob tails, and they can later be recycled with the rowset.

if enable_remove_pre_rowsets_delete_bitmap_by_keys=false:

  1. Requests has no statistics, and ms retain range remove

Copilot AI lite review requested due to automatic review settings August 10, 2026 03:39

Copilot AI 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.

Pull request overview

This PR improves Cloud cumulative compaction’s cleanup of pre-rowset delete bitmaps by switching from broad range clears to an (optionally) key-based removal path that reports per-(rowset, segment, version) bitmap sizes to Meta Service, enabling bounded, transaction-size-aware deletes while maintaining backward compatibility.

Changes:

  • Extend UpdateDeleteBitmapRequest with per-rowset delete-bitmap statistics (PreRowsetDeleteBitmapStatsPB) to drive key-based cleanup.
  • Add blob_remove_keys() and reuse a shared DEFAULT_BLOB_SPLIT_SIZE to deterministically reconstruct legacy + split blob keys for removal.
  • Implement Meta Service key-based pre-rowset delete-bitmap removal (with batching) and add tests covering batching, underestimated sizes, and request encoding.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gensrc/proto/cloud.proto Adds PreRowsetDeleteBitmapStatsPB and wires it into UpdateDeleteBitmapRequest.
cloud/test/meta_service_test.cpp Adds tests for key-based removal behavior, batching, and underestimated-size tail handling.
cloud/test/blob_message_test.cpp Adds test ensuring legacy (unsuffixed) blob values can be removed via reconstructed key lists.
cloud/src/meta-store/blob_message.h Introduces DEFAULT_BLOB_SPLIT_SIZE and declares blob_remove_keys().
cloud/src/meta-store/blob_message.cpp Implements blob_remove_keys() and refactors split key construction via blob_key().
cloud/src/meta-service/meta_service.cpp Adds key-based pre-rowset delete-bitmap removal and stricter delete-bitmap key decoding in reads.
be/test/cloud/cloud_tablet_test.cpp Adds unit test ensuring compaction aggregation returns expected pre-rowset stats.
be/test/cloud/cloud_meta_mgr_test.cpp Adds unit test verifying request encoding for pre-rowset delete-bitmap stats.
be/src/common/config.h Declares enable_remove_pre_rowsets_delete_bitmap_by_keys.
be/src/common/config.cpp Defines the new config flag (default enabled) and documents intent.
be/src/cloud/cloud_tablet.h Adds PreRowsetDeleteBitmapStats type and extends aggregation API signature.
be/src/cloud/cloud_tablet.cpp Collects serialized-size stats for original bitmaps within the aggregation version range.
be/src/cloud/cloud_meta_mgr.h Extends MetaMgr RPC helper signature to accept pre-rowset stats.
be/src/cloud/cloud_meta_mgr.cpp Encodes pre-rowset stats into UpdateDeleteBitmapRequest when provided.
be/src/cloud/cloud_cumulative_compaction.cpp Enables collection/sending of pre-rowset stats behind the new config flag.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cloud/src/meta-service/meta_service.cpp
@mymeiyi

mymeiyi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/review

@mymeiyi

mymeiyi commented Aug 10, 2026

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.

Review summary

Requesting changes for two P1 reader-safety regressions in the new point-delete cleanup path:

  1. A new Meta-Service can persist a nonzero-first split tail that only the new reader skips. During a rolling deployment, an old MS sharing the same FDB can return that fragment as a complete bitmap; the default-enabled BE switch has no fleet capability or rollout fence.
  2. After TXN_TOO_OLD replaces a paginated read transaction, the handler keeps its partially assembled bitmap state. A point-cleanup commit between snapshots can remove unseen suffixes while leaving later ones, and the same-group branch appends across that sequence gap.

Checkpoint conclusions:

  • Goal and scope: Reviewed the full 15-file change and the BE producer, Meta-Service writer/reader, blob-key, proto, retry, and test paths. Point-delete batching addresses the FDB transaction-size goal, and aggregate-before-delete ordering is sound, but the two reader-safety blockers remain.
  • Concurrency and transactions: Atomic commits and deterministic retries keep replacement aggregates durable across partial cleanup. The accepted homogeneous-version failure is instead the fresh-snapshot pagination interleaving described inline; no additional lock-order or producer-snapshot defect survived review.
  • Lifecycle, configuration, and compatibility: Ownership and request lifetimes are scoped correctly, with no new static-initialization or reference-cycle issue. The mutable BE kill switch preserves legacy range cleanup when disabled, and ordinary old-BE/new-MS plus new-BE/old-MS request handling is additive; mixed old/new MS readers are not safe because there is no fleet gate.
  • Data and parallel paths: Store versions 1 and 3 use the affected v1 path; version 2 bypasses it. Recycler/checker and other adjacent consumers did not expose a third deserialization path. The missing proto2 nested-field validation issue is already covered by the existing inline thread and was suppressed as a duplicate.
  • Tests: Added tests cover request encoding, [start,end) statistics, legacy/empty behavior, exact batching, and underestimated retained tails. Missing coverage is a pre-change reader over retained state and a pagination + TXN_TOO_OLD + concurrent cleanup interleaving. I did not run builds or tests because the supplied review bundle explicitly prohibits them.
  • Performance and observability: The P*S*V stats materialization remains a worthwhile stress concern, but no distinct correctness or severe bounded regression was substantiated. Existing logs identify cleanup failures and skipped tails.

The review converged in three rounds: all three final-round reviewers returned NO_NEW_VALUABLE_FINDINGS, and no issue beyond the two inline comments survived validation and live duplicate suppression.

Comment thread cloud/src/meta-service/meta_service.cpp
Comment thread cloud/src/meta-service/meta_service.cpp
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 80.00% (40/50) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.93% (26173/43670)
Line Coverage 44.28% (265803/600260)
Region Coverage 40.03% (211737/528908)
Branch Coverage 41.47% (97066/234059)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (50/50) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.95% (32335/42574)
Line Coverage 60.80% (362473/596163)
Region Coverage 57.54% (305271/530575)
Branch Coverage 58.86% (137754/234041)

mymeiyi added a commit to mymeiyi/doris that referenced this pull request Aug 10, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66598

Problem Summary: Cloud cumulative compaction previously removed aggregated pre-rowset delete bitmaps with a Meta Service range clear. This could create a large FoundationDB transaction and remove keys outside the exact reported bitmap set. Collect each original bitmap by segment within the aggregation version range and let Meta Service remove the reported legacy and split blob keys individually in bounded transactions. Requests without statistics retain range deletion for compatibility.

A paginated delete bitmap read could also retain fragments from an expired transaction and append fragments from a replacement transaction after concurrent point cleanup, returning a gapped or truncated bitmap. Track the first blob key for the active bitmap, verify it in the replacement transaction, discard obsolete partial entries when it no longer exists, and validate blob sequence continuity. Suppress removal logs when no key is deleted.

### Release note

Enable bounded, key-based removal of pre-rowset delete bitmap blobs by default during Cloud cumulative compaction. Prevent incomplete delete bitmaps from being returned when an FDB read transaction is replaced during concurrent point cleanup. Set enable_remove_pre_rowsets_delete_bitmap_by_keys=false to retain range deletion.

### Check List (For Author)

- Test: Not run (per request); added BE and Meta Service unit coverage, including retained-tail and complete-removal snapshot retry interleavings
- Behavior changed: Yes. Pre-rowset delete bitmap removal uses reported keys and bounded transactions by default; incomplete obsolete bitmap fragments are discarded after transaction replacement; empty removal logs are suppressed.
- Does this need documentation: No
@mymeiyi

mymeiyi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

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

Review summary

Requesting changes for two distinct issues on the current head:

  1. The Meta-Service point-cleanup endpoint does not enforce that every supplied stat version is in the source interval. A fully populated request can therefore clear the replacement at end_version after writing it.
  2. V2-only delete-bitmap storage still performs the new full source-stat scan and materialization even though the callee discards it before issuing any v1 request.

Critical-checkpoint conclusions

  • Goal and proof: The change generally achieves transaction-batched point cleanup for valid v1/dual-write compaction requests. The destructive RPC range invariant and the v2-only no-op cost remain. Added unit tests cover stat collection/encoding, legacy and split blob keys, transaction batching, underestimated tails, and pagination interleavings, but not an end-version stat or the v2-only skip.
  • Scope and focus: The 15-file change is focused on the BE producer, protobuf contract, Meta-Service writer/reader, blob-key helper, configuration, and their tests. There was no additional user-provided review focus.
  • Concurrency and locks: BE bitmap enumeration and aggregation use DeleteBitmap's shared lock; no new lock-order or deadlock issue survived review. FDB readers can overlap cleanup and replace transactions. The residual same-key, fresh-snapshot assembly concern has the same root cause and remedy as the existing discussion_r3746653971 thread, so it was not duplicated. The v2-only scan unnecessarily lengthens shared-lock work.
  • Lifecycle and initialization: Request-owned stats and transaction objects have bounded lifetimes, every transaction replacement is checked, and no new reference cycle, ownership leak, or cross-TU static-initialization dependency was found.
  • Configuration: The new kill switch is mutable and sampled per compaction, with the legacy range-removal fallback when stats are absent. Store mode 2 is independently supported, but still pays the unused stats cost described inline.
  • Compatibility: Protobuf field 19 is additive. Old BE to new MS falls back to range cleanup, new BE to old MS has the unknown field ignored, and modes 1/3 retain a v1 consumer. The author-stated all-MS-before-BE rollout fence addresses the old-reader retained-tail discussion; no duplicate compatibility comment was added.
  • Parallel and conditional paths: Cumulative compaction is the only producer of these stats; base/full compaction do not need the post-commit v1 helper. Valid BE construction uses [start,end), rowset-nonexistence and empty-stats cases were traced, and the missing server-side enforcement of that same interval is the data-correctness issue inline.
  • Error handling and memory safety: Changed TxnErrorCode results are checked and include useful tablet/rowset context. No unchecked Status, exception-boundary, ownership, nullable-column, or valid-input allocation defect survived review.
  • Tests and results: The new unit tests exercise the principal positive and retry paths, but the two inline cases need negative/config-specific coverage. No regression result file is applicable. I did not run builds or tests because the supplied review bundle explicitly prohibits them.
  • Observability: Per-batch logs, transaction statistics, failure counters, and identifiers are sufficient for the new cleanup path; no additional metric blocker was identified.
  • Transactions, persistence, and data writes: Aggregate writes precede every source clear, the first cleanup commit carries any buffered aggregate, later commits are clear-only, and whole-handler retries are same-key idempotent. There is no FE EditLog path. The unchecked end-version stat breaks the logical aggregate-before-delete guarantee despite a successful atomic commit.
  • Cross-process values: The new BE-to-MS protobuf data is populated and consumed on all v1-writing paths with an absent-field fallback; FE is not involved. The endpoint must still validate the transmitted cross-field range before destructive reconstruction.
  • Performance and remaining issues: The distinct performance regression is the O(K) v2-only stats scan/allocation. A final sweep found no other substantiated issue beyond the two inline comments and the three already-existing validation/reader threads.

No builds or tests were run, as required by the review bundle.

Comment thread be/src/cloud/cloud_cumulative_compaction.cpp
Comment thread cloud/src/meta-service/meta_service.cpp
mymeiyi added a commit to mymeiyi/doris that referenced this pull request Aug 10, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66598

Problem Summary: Cloud cumulative compaction previously removed aggregated pre-rowset delete bitmaps with a Meta Service range clear. This could create a large FoundationDB transaction and remove keys outside the exact reported bitmap set. Collect each original bitmap by segment within the aggregation version range and let Meta Service remove the reported legacy and split blob keys individually in bounded transactions. Requests without statistics retain range deletion for compatibility.

A paginated delete bitmap read could also retain fragments from an expired transaction and append fragments from a replacement transaction after concurrent point cleanup, returning a gapped or truncated bitmap. Track the first blob key for the active bitmap, verify it in the replacement transaction, discard obsolete partial entries when it no longer exists, and validate blob sequence continuity. Suppress removal logs when no key is deleted.

V2-only cumulative compaction skips the unused V1 pre-rowset aggregation before collecting source statistics. Meta Service also asserts that BE-produced cleanup statistic versions remain inside the compaction source interval.

### Release note

Enable bounded, key-based removal of pre-rowset delete bitmap blobs by default during Cloud cumulative compaction. Prevent incomplete delete bitmaps from being returned when an FDB read transaction is replaced during concurrent point cleanup. V2-only writes skip unused V1 pre-rowset aggregation. Set enable_remove_pre_rowsets_delete_bitmap_by_keys=false to retain range deletion.

### Check List (For Author)

- Test: Not run (per request); added BE and Meta Service unit coverage, including retained-tail and complete-removal snapshot retry interleavings
- Behavior changed: Yes. Pre-rowset delete bitmap removal uses reported keys and bounded transactions by default; incomplete obsolete bitmap fragments are discarded after transaction replacement; V2-only writes skip unused V1 aggregation; empty removal logs are suppressed.
- Does this need documentation: No
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17684	3900	3826	3826
q2	1963	364	202	202
q3	10247	1492	841	841
q4	4699	546	401	401
q5	7417	801	449	449
q6	195	183	155	155
q7	767	791	571	571
q8	9838	1925	1847	1847
q9	6709	5628	5584	5584
q10	8334	3498	3095	3095
q11	511	376	330	330
q12	776	662	495	495
q13	17765	4114	3456	3456
q14	465	397	369	369
q15	q16	498	476	407	407
q17	1033	1142	630	630
q18	6748	5563	5493	5493
q19	1184	1234	1120	1120
q20	1389	889	806	806
q21	6076	3482	3255	3255
q22	439	368	315	315
Total cold run time: 104737 ms
Total hot run time: 33647 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4145	4070	4074	4070
q2	349	394	259	259
q3	2282	2728	2205	2205
q4	2146	2228	1446	1446
q5	4354	4179	5071	4179
q6	322	243	196	196
q7	7659	7060	7058	7058
q8	3418	2797	2675	2675
q9	27476	27274	26838	26838
q10	4393	4601	4240	4240
q11	887	623	631	623
q12	727	735	510	510
q13	3910	4304	3805	3805
q14	407	398	350	350
q15	q16	486	492	459	459
q17	3026	3000	2876	2876
q18	7572	6927	6971	6927
q19	1162	1134	1114	1114
q20	2321	2279	1982	1982
q21	12059	11176	11051	11051
q22	545	497	429	429
Total cold run time: 89646 ms
Total hot run time: 83292 ms

@mymeiyi

mymeiyi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.05	0.05
query3	0.25	0.13	0.13
query4	1.61	0.14	0.14
query5	0.23	0.22	0.21
query6	1.16	0.80	0.80
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.38	0.32	0.31
query10	0.59	0.54	0.58
query11	0.20	0.14	0.13
query12	0.18	0.14	0.15
query13	0.46	0.48	0.46
query14	1.01	1.00	0.99
query15	0.60	0.58	0.57
query16	0.33	0.32	0.31
query17	1.08	1.11	1.09
query18	0.21	0.21	0.20
query19	2.02	1.91	1.89
query20	0.02	0.01	0.01
query21	15.44	0.23	0.15
query22	4.81	0.05	0.05
query23	16.15	0.30	0.12
query24	3.01	0.43	0.35
query25	0.11	0.06	0.04
query26	0.74	0.20	0.16
query27	0.05	0.03	0.04
query28	3.55	0.83	0.35
query29	12.49	4.14	3.27
query30	0.27	0.16	0.15
query31	2.77	0.58	0.32
query32	3.23	0.59	0.49
query33	3.15	3.24	3.14
query34	15.57	4.02	3.29
query35	3.28	3.21	3.22
query36	0.55	0.44	0.42
query37	0.08	0.07	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.18	0.16	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.21 s
Total hot run time: 23.9 s

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

Review status: complete after two full rounds; changes requested.

The point-delete design is focused and the valid-request transaction/read state machine now looks consistent, but two new blocking RPC-boundary issues remain in addition to the already-open validation threads.

Critical checkpoints:

  • Goal and tests: BE collection, protobuf encoding, point batching, tail handling, and TXN_TOO_OLD behavior are positively covered, but hostile negative cases for replacement ownership and bounded expansion are missing.
  • Data correctness and transactions: for producer-valid requests, aggregate puts commit no later than source deletes and retries are idempotent. However, cleanup stats are not bound to a verified end-version replacement, so a fully populated request can delete live marks with no preserved aggregate.
  • Error handling and resource bounds: claimed bitmap sizes are expanded into key vectors without storable-size or cumulative-work bounds, permitting Meta-Service memory or CPU exhaustion before batching.
  • Concurrency and lifecycle: no new lock-order, race, static-initialization, or ownership issue was found.
  • Configuration and compatibility: v2 work is gated; v1 and v3 use the path; field 19 is additive. The old-reader retained-tail concern remains governed by the stated all-MS-before-BE rollout and its existing thread.
  • Parallel paths and performance: cumulative-only placement is appropriate; base and full compaction have no equivalent retained pre-rowsets. The intended v1/v3 O(K) scan is necessary for point cleanup.
  • Observability: existing contextual logs and RPC metrics are sufficient.
  • Review execution: static review only, as required by the review runner; no builds or tests were run.

User focus: no additional user-provided focus was supplied, so the full PR was reviewed.

return true;
}

for (const auto& rowset_stats : request->pre_rowset_delete_bitmap_stats()) {

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] Bind every cleanup stat to its replacement

The stats list is independent of the aggregate-output arrays, so a fully populated request can name (rowset B, segment 0, version V) while only writing an aggregate for rowset A—or provide no output tuples at all. The latter is exactly the shape used by RemovePreDeleteBitmapBatchesEachBlobKey: this loop removes the only source bitmap and returns OK. With a real bitmap that drops delete marks and can expose deleted rows. This is distinct from missing optional fields and out-of-range versions. Before any transaction can commit, validate the aligned output shape and require each destructive (rowset_id, segment_id) to bind to an eligible output at pre_rowset_agg_end_version; omit or explicitly handle empty-source stats, and add stats-only plus A/B negative tests.

Comment thread cloud/src/meta-service/meta_service.cpp Outdated
mymeiyi added a commit to mymeiyi/doris that referenced this pull request Aug 10, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66598

Problem Summary: Cloud cumulative compaction previously removed aggregated pre-rowset delete bitmaps with a Meta Service range clear. This could create a large FoundationDB transaction and remove keys outside the exact reported bitmap set. Collect each original bitmap by segment within the aggregation version range and let Meta Service remove the reported legacy and split blob keys individually in bounded transactions. Generate each split key on demand through blob_key so cleanup uses constant additional key memory instead of materializing every key in a vector. Requests without statistics retain range deletion for compatibility.

A paginated delete bitmap read could also retain fragments from an expired transaction and append fragments from a replacement transaction after concurrent point cleanup, returning a gapped or truncated bitmap. Track the first blob key for the active bitmap, verify it in the replacement transaction, discard obsolete partial entries when it no longer exists, and validate blob sequence continuity. Suppress removal logs when no key is deleted.

V2-only cumulative compaction skips the unused V1 pre-rowset aggregation before collecting source statistics. Meta Service also asserts that BE-produced cleanup statistic versions remain inside the compaction source interval.

### Release note

Enable bounded, key-based removal of pre-rowset delete bitmap blobs by default during Cloud cumulative compaction. Prevent incomplete delete bitmaps from being returned when an FDB read transaction is replaced during concurrent point cleanup. V2-only writes skip unused V1 aggregation. Set enable_remove_pre_rowsets_delete_bitmap_by_keys=false to retain range deletion.

### Check List (For Author)

- Test: Not run (per request); added BE and Meta Service unit coverage, including retained-tail and complete-removal snapshot retry interleavings
- Behavior changed: Yes. Pre-rowset delete bitmap removal uses reported keys and bounded transactions by default; incomplete obsolete bitmap fragments are discarded after transaction replacement; V2-only writes skip unused V1 aggregation; empty removal logs are suppressed.
- Does this need documentation: No
@mymeiyi

mymeiyi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17705	3976	3969	3969
q2	2006	321	202	202
q3	10304	1453	801	801
q4	4682	473	344	344
q5	7517	837	561	561
q6	185	165	137	137
q7	756	843	613	613
q8	9361	1678	1566	1566
q9	5334	4071	4037	4037
q10	6678	1626	1344	1344
q11	492	351	340	340
q12	715	573	457	457
q13	18102	3257	2747	2747
q14	258	266	242	242
q15	q16	734	730	651	651
q17	1031	1115	1076	1076
q18	6461	5632	5547	5547
q19	1173	1289	1074	1074
q20	793	686	588	588
q21	5436	2864	2757	2757
q22	465	379	325	325
Total cold run time: 100188 ms
Total hot run time: 29378 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5015	4668	4678	4668
q2	284	334	220	220
q3	4848	5339	4695	4695
q4	2180	2279	1428	1428
q5	4518	4638	4369	4369
q6	233	177	132	132
q7	1843	1780	1507	1507
q8	2347	2019	2026	2019
q9	7214	6897	6667	6667
q10	4269	4199	3798	3798
q11	510	371	344	344
q12	693	711	495	495
q13	2990	3243	2715	2715
q14	271	273	252	252
q15	q16	657	679	600	600
q17	1248	1218	1211	1211
q18	12236	10986	11713	10986
q19	1147	1055	1111	1055
q20	2210	2189	1895	1895
q21	5270	4542	4583	4542
q22	549	443	418	418
Total cold run time: 60532 ms
Total hot run time: 54016 ms

@hello-stephen

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

query5	4312	578	463	463
query6	452	213	210	210
query7	4849	613	350	350
query8	322	162	148	148
query9	8778	4093	4045	4045
query10	467	381	312	312
query11	5730	2167	1999	1999
query12	162	103	99	99
query13	1265	602	452	452
query14	6103	4305	4002	4002
query14_1	3837	3835	3816	3816
query15	205	193	179	179
query16	997	446	434	434
query17	944	698	547	547
query18	2458	460	349	349
query19	210	194	154	154
query20	103	103	102	102
query21	235	161	141	141
query22	12978	13052	12820	12820
query23	15691	15119	14521	14521
query23_1	14830	14809	14695	14695
query24	7748	1712	1252	1252
query24_1	1275	1257	1261	1257
query25	571	449	390	390
query26	1344	377	217	217
query27	2560	572	382	382
query28	4613	2067	2073	2067
query29	1038	618	466	466
query30	347	275	231	231
query31	1191	1106	1051	1051
query32	113	60	60	60
query33	518	308	246	246
query34	1163	1110	640	640
query35	727	776	648	648
query36	786	810	702	702
query37	154	104	91	91
query38	1856	1772	1696	1696
query39	811	816	803	803
query39_1	775	799	785	785
query40	255	165	141	141
query41	66	65	61	61
query42	96	93	97	93
query43	333	321	277	277
query44	1451	790	787	787
query45	185	174	179	174
query46	1026	1218	748	748
query47	1565	1502	1421	1421
query48	412	416	304	304
query49	585	415	305	305
query50	1009	444	337	337
query51	10463	10521	10387	10387
query52	88	87	80	80
query53	265	318	196	196
query54	289	228	226	226
query55	74	71	72	71
query56	295	283	305	283
query57	1020	994	935	935
query58	286	270	254	254
query59	1537	1599	1368	1368
query60	309	271	253	253
query61	145	149	144	144
query62	399	318	267	267
query63	229	192	202	192
query64	2822	1017	826	826
query65	3830	3811	3825	3811
query66	1836	475	347	347
query67	20051	20082	20009	20009
query68	3006	1553	987	987
query69	404	302	255	255
query70	891	816	737	737
query71	376	328	314	314
query72	3005	2685	2552	2552
query73	900	788	445	445
query74	4629	4512	4321	4321
query75	2370	2351	1993	1993
query76	2316	1156	785	785
query77	349	381	289	289
query78	11263	11199	10548	10548
query79	1387	1112	775	775
query80	1266	552	465	465
query81	539	327	283	283
query82	661	174	143	143
query83	368	324	297	297
query84	316	165	136	136
query85	964	608	509	509
query86	412	243	229	229
query87	2012	1966	1832	1832
query88	3734	2823	2796	2796
query89	383	330	290	290
query90	1954	196	191	191
query91	200	186	161	161
query92	62	58	79	58
query93	1701	1543	1017	1017
query94	708	358	321	321
query95	765	499	561	499
query96	1037	819	370	370
query97	2455	2423	2321	2321
query98	196	188	180	180
query99	752	737	618	618
Total cold run time: 244916 ms
Total hot run time: 158905 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.08	0.05	0.04
query3	0.25	0.13	0.13
query4	1.61	0.14	0.13
query5	0.23	0.22	0.24
query6	1.16	0.80	0.83
query7	0.04	0.01	0.01
query8	0.05	0.04	0.03
query9	0.37	0.31	0.31
query10	0.57	0.58	0.53
query11	0.19	0.13	0.13
query12	0.18	0.14	0.14
query13	0.45	0.47	0.48
query14	1.00	1.00	1.00
query15	0.60	0.59	0.57
query16	0.33	0.32	0.32
query17	1.06	1.07	1.06
query18	0.21	0.20	0.20
query19	2.03	1.92	1.94
query20	0.02	0.01	0.01
query21	15.44	0.21	0.13
query22	4.79	0.06	0.06
query23	16.16	0.30	0.11
query24	3.13	0.42	0.33
query25	0.12	0.05	0.04
query26	0.73	0.22	0.14
query27	0.06	0.04	0.04
query28	3.52	0.81	0.36
query29	12.45	4.13	3.27
query30	0.28	0.15	0.17
query31	2.78	0.56	0.32
query32	3.22	0.58	0.49
query33	3.15	3.20	3.21
query34	15.66	3.95	3.26
query35	3.23	3.21	3.22
query36	0.54	0.42	0.44
query37	0.09	0.07	0.06
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.18	0.15	0.16
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.2 s
Total hot run time: 23.91 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100% (0/0) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66598

Problem Summary: Cloud cumulative compaction previously removed aggregated pre-rowset delete bitmaps with a Meta Service range clear. This could create a large FoundationDB transaction and remove keys outside the exact reported bitmap set. Collect each original bitmap by segment within the aggregation version range and let Meta Service remove the reported legacy and split blob keys individually in bounded transactions. Generate each split key on demand through blob_key so cleanup uses constant additional key memory instead of materializing every key in a vector. Requests without statistics retain range deletion for compatibility.

A paginated delete bitmap read could also retain fragments from an expired transaction and append fragments from a replacement transaction after concurrent point cleanup, returning a gapped or truncated bitmap. Track the first blob key for the active bitmap, verify it in the replacement transaction, discard obsolete partial entries when it no longer exists, and validate blob sequence continuity. Suppress removal logs when no key is deleted.

V2-only cumulative compaction skips the unused V1 pre-rowset aggregation before collecting source statistics. Meta Service also asserts that BE-produced cleanup statistic versions remain inside the compaction source interval.

The automatic-versionstamp blob writer also passed the value version and fragment sequence to blob_key in reverse order. This encoded the first fragment with version zero and made multi-fragment blobs invalid during range iteration. Pass the fragment sequence before the value version, consistent with the blob_key interface and the non-versioned writer.

### Release note

Enable bounded, key-based removal of pre-rowset delete bitmap blobs by default during Cloud cumulative compaction. Prevent incomplete delete bitmaps from being returned when an FDB read transaction is replaced during concurrent point cleanup. V2-only writes skip unused V1 aggregation. Set enable_remove_pre_rowsets_delete_bitmap_by_keys=false to retain range deletion.

### Check List (For Author)

- Test: Not run (per request); added BE and Meta Service unit coverage, including retained-tail and complete-removal snapshot retry interleavings. The blob argument-order fix was statically reviewed and git diff --check passed.
- Behavior changed: Yes. Pre-rowset delete bitmap removal uses reported keys and bounded transactions by default; incomplete obsolete bitmap fragments are discarded after transaction replacement; V2-only writes skip unused V1 aggregation; empty removal logs are suppressed; automatic-versionstamp blobs encode the requested value version and increasing fragment sequence.
- Does this need documentation: No
@mymeiyi

mymeiyi commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 79.62% (168/211) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.40% (2000/2551)
Line Coverage 65.50% (36501/55723)
Region Coverage 65.55% (18534/28273)
Branch Coverage 55.17% (10086/18282)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17635	4212	4240	4212
q2	2020	324	199	199
q3	10464	1448	830	830
q4	4756	477	345	345
q5	8217	851	548	548
q6	310	174	139	139
q7	864	808	606	606
q8	10460	1682	1670	1670
q9	5563	4117	4077	4077
q10	6810	1672	1379	1379
q11	499	361	333	333
q12	744	596	455	455
q13	18205	3359	2831	2831
q14	263	258	237	237
q15	q16	738	730	665	665
q17	950	964	883	883
q18	6697	5665	5591	5591
q19	1164	1228	1116	1116
q20	833	698	584	584
q21	5713	2636	2420	2420
q22	428	362	310	310
Total cold run time: 103333 ms
Total hot run time: 29430 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4486	4383	4283	4283
q2	271	321	214	214
q3	4600	4933	4412	4412
q4	2190	2331	1423	1423
q5	4225	4191	4164	4164
q6	232	178	132	132
q7	1851	2012	1580	1580
q8	2575	2232	2251	2232
q9	7560	7656	7264	7264
q10	4283	4311	3965	3965
q11	575	434	405	405
q12	714	741	505	505
q13	3202	3587	2860	2860
q14	294	309	283	283
q15	q16	745	723	643	643
q17	1324	1348	1342	1342
q18	12220	11100	11843	11100
q19	1188	1181	1142	1142
q20	2244	2222	2013	2013
q21	5737	4915	4938	4915
q22	555	457	406	406
Total cold run time: 61071 ms
Total hot run time: 55283 ms

@hello-stephen

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

query5	4309	596	439	439
query6	480	222	214	214
query7	4856	614	336	336
query8	319	166	146	146
query9	8766	4047	4027	4027
query10	464	380	299	299
query11	5814	2155	1996	1996
query12	155	95	95	95
query13	1270	547	436	436
query14	6072	4341	4021	4021
query14_1	3792	3843	3793	3793
query15	202	191	176	176
query16	1010	490	470	470
query17	902	693	541	541
query18	2445	470	325	325
query19	205	191	146	146
query20	102	104	101	101
query21	232	154	131	131
query22	12990	13108	12851	12851
query23	15837	14943	14587	14587
query23_1	14720	14561	14558	14558
query24	7630	1698	1213	1213
query24_1	1245	1262	1244	1244
query25	548	466	388	388
query26	1338	373	215	215
query27	2599	569	376	376
query28	4620	2001	2000	2000
query29	1044	588	464	464
query30	337	267	228	228
query31	1182	1125	1046	1046
query32	118	61	63	61
query33	502	327	235	235
query34	1189	1133	629	629
query35	743	745	628	628
query36	788	772	707	707
query37	152	107	92	92
query38	1812	1794	1668	1668
query39	817	826	780	780
query39_1	810	786	777	777
query40	253	163	146	146
query41	70	66	62	62
query42	95	93	92	92
query43	317	332	271	271
query44	1428	750	758	750
query45	184	180	167	167
query46	1047	1157	728	728
query47	1552	1556	1430	1430
query48	404	418	304	304
query49	577	401	295	295
query50	1066	439	322	322
query51	10588	10355	10469	10355
query52	92	94	74	74
query53	271	281	201	201
query54	290	234	229	229
query55	77	71	70	70
query56	333	293	321	293
query57	1035	1007	937	937
query58	292	270	272	270
query59	1531	1601	1380	1380
query60	327	296	285	285
query61	190	184	181	181
query62	409	331	272	272
query63	252	209	203	203
query64	2995	1168	997	997
query65	3892	3845	3789	3789
query66	1873	510	373	373
query67	20155	20207	20183	20183
query68	3453	1553	974	974
query69	439	327	286	286
query70	887	799	776	776
query71	398	364	323	323
query72	3260	2661	2317	2317
query73	865	765	408	408
query74	4637	4471	4284	4284
query75	2499	2343	1983	1983
query76	2458	1139	711	711
query77	345	361	272	272
query78	11163	11123	10658	10658
query79	1364	1133	759	759
query80	837	542	462	462
query81	506	331	290	290
query82	616	176	142	142
query83	409	332	300	300
query84	328	162	135	135
query85	955	612	502	502
query86	371	236	210	210
query87	1983	1949	1848	1848
query88	3727	2812	2747	2747
query89	391	330	277	277
query90	1842	204	193	193
query91	207	190	161	161
query92	62	59	53	53
query93	1563	1552	1076	1076
query94	622	343	305	305
query95	776	597	462	462
query96	1071	818	358	358
query97	2466	2452	2327	2327
query98	200	187	182	182
query99	757	755	618	618
Total cold run time: 245614 ms
Total hot run time: 158442 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.09	0.05	0.05
query3	0.25	0.14	0.14
query4	1.60	0.14	0.14
query5	0.26	0.22	0.22
query6	1.16	0.83	0.80
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.32	0.31
query10	0.56	0.58	0.57
query11	0.20	0.15	0.14
query12	0.18	0.14	0.14
query13	0.49	0.47	0.48
query14	1.01	1.00	1.01
query15	0.60	0.58	0.62
query16	0.33	0.32	0.34
query17	1.07	1.08	1.11
query18	0.22	0.20	0.20
query19	2.06	1.91	1.94
query20	0.02	0.02	0.01
query21	15.43	0.20	0.14
query22	4.83	0.05	0.05
query23	16.15	0.31	0.14
query24	2.92	0.42	0.31
query25	0.11	0.04	0.04
query26	0.73	0.21	0.15
query27	0.04	0.04	0.02
query28	3.52	0.74	0.35
query29	12.51	3.97	3.19
query30	0.28	0.15	0.15
query31	2.77	0.54	0.32
query32	3.23	0.59	0.48
query33	3.25	3.22	3.24
query34	15.64	3.94	3.29
query35	3.23	3.22	3.22
query36	0.56	0.44	0.42
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.31 s
Total hot run time: 23.98 s

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