[fix](be) Deduplicate cluster key MOW compaction output#63116
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
run buildall |
There was a problem hiding this comment.
The fix correctly targets cluster-key MoW compaction output in the shared-nothing path, but it is not wired into the cloud compaction path, so the same duplicate-visible-row bug remains in cloud mode.
Critical checkpoints:
- Goal/test: the goal is to delete older duplicate unique-key rows produced by cluster-key MoW compaction. The added unit test covers local vertical compaction only; cloud compaction is not covered.
- Scope/focus: the helper is focused, but the call site is incomplete because cloud has a parallel compaction delete-bitmap path.
- Concurrency/lifecycle: no new shared mutable state or lock-order issue found in the helper itself; it runs before delete-bitmap merge/persistence.
- Config/compatibility: no new config or storage-format compatibility issue found.
- Parallel paths: blocking issue found: CloudTablet::calc_delete_bitmap_for_compaction is not updated.
- Tests: existing added test does not exercise the cloud path, which is where the missing call is.
- Observability/performance: no additional blocking observability issue found; the helper scans output PK indexes as expected for this correctness fix.
User focus: no additional user-provided review focus was supplied.
| // may be non-adjacent in merge order. Scan the output primary key index to delete older | ||
| // duplicate rows inside the output rowset. | ||
| if (!tablet()->tablet_schema()->cluster_key_uids().empty()) { | ||
| RETURN_IF_ERROR(tablet()->calc_compaction_output_rowset_internal_delete_bitmap( |
There was a problem hiding this comment.
This only fixes the shared-nothing CompactionMixin::modify_rowsets() path. Cloud compactions do not call this method; CloudCumulativeCompaction::modify_rowsets() calls CloudTablet::calc_delete_bitmap_for_compaction() instead, and that function still only converts input-rowset delete bitmaps before/after the meta-service lock. For a cloud cluster-key MoW table with the same shape as the new test (older (uk=1, ck=30) and newer (uk=1, ck=20) sorted by cluster key into the same output rowset), the output rowset is committed without any internal delete bitmap entry, so both duplicates can remain visible. Please apply calc_compaction_output_rowset_internal_delete_bitmap() in the cloud delete-bitmap calculation path as well and add coverage for that path.
TPC-H: Total hot run time: 29455 ms |
TPC-DS: Total hot run time: 170799 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Issue Number: None
Related PR: None
Problem Summary: Cluster-key MOW compaction sorts rows by cluster key, so duplicate unique keys may be non-adjacent and can remain visible in the output rowset. Scan the output rowset primary key index after compaction and add output-rowset internal delete bitmap entries for older duplicate unique-key rows.
None
- Test: Unit Test
- Ran ./run-be-ut.sh --run --filter=VerticalCompactionTest.ClusterKeyMowCompactionNeedsOutputRowsetInternalDedup -j 8
- Behavior changed: No
- Does this need documentation: No
Issue Number: None
Related PR: None
Problem Summary: Cluster-key MOW compaction sorts rows by cluster key, so duplicate unique keys may be non-adjacent and can remain visible in the output rowset. Scan the output rowset primary key index after compaction and add output-rowset internal delete bitmap entries for older duplicate unique-key rows.
None
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)