Skip to content

branch-4.1: [fix](case) fix mow compaction cases on multi-replica cluster#64538

Open
shuke987 wants to merge 1 commit into
apache:branch-4.1from
shuke987:fix-branch41-mow-compaction-multireplica
Open

branch-4.1: [fix](case) fix mow compaction cases on multi-replica cluster#64538
shuke987 wants to merge 1 commit into
apache:branch-4.1from
shuke987:fix-branch41-mow-compaction-multireplica

Conversation

@shuke987

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

The three nonConcurrent MOW compaction regression cases

  • test_mow_compaction_and_read_stale
  • test_mow_compaction_and_schema_change
  • test_mow_compaction_agg_and_remove_pre_delete_bitmap

asserted assertEquals(1, tablets.size()) right after show tablets.
show tablets returns one row per replica, so on a cluster that
materializes multiple replicas for the single bucket (the branch-4.1
NonConcurrent pipeline creates 3 replicas even when the table requests 1),
the assertion fails at table setup:

expected: <1> but was: <3>

The 3 rows share the same TabletId (one bucket, three replicas), e.g.:

TabletId:1781362443532 ReplicaId:...533 BackendId:...351
TabletId:1781362443532 ReplicaId:...534 BackendId:...348
TabletId:1781362443532 ReplicaId:...535 BackendId:...349

What does this PR do?

Assert the real invariant instead — exactly one distinct tablet (BUCKETS 1) —
by de-duplicating on TabletId, which is independent of replica count:

assertEquals(1, tablets.collect { it.TabletId }.unique().size())

The cases already operate on a single replica via tablets[0], so the
downstream compaction / delete-bitmap inspection is unaffected.

Related to #58662, which relaxed the same check to
tablets.size() >= 1; this uses a stricter distinct-tablet assertion. The
same improvement will be proposed on master so the branches reconverge.

Release note

None

Check List

  • Test
    • Regression test (test-only change)

…ster

The three nonConcurrent MOW compaction regression cases
(test_mow_compaction_and_read_stale, test_mow_compaction_and_schema_change,
test_mow_compaction_agg_and_remove_pre_delete_bitmap) asserted
`assertEquals(1, tablets.size())`. `show tablets` returns one row per
replica, so on clusters that materialize multiple replicas for the single
bucket the assertion fails at table setup (expected: <1> but was: <3>) on
the branch-4.1 NonConcurrent pipeline.

Assert the real invariant instead -- exactly one distinct tablet (BUCKETS 1)
-- by de-duplicating on TabletId, which is independent of replica count. The
cases already operate on a single replica via tablets[0], so the downstream
compaction / delete-bitmap inspection is unaffected.

Related to apache#58662, which relaxed the same check to
`tablets.size() >= 1`; this uses a stricter distinct-tablet assertion. The
same improvement will be proposed upstream so the branches reconverge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shuke987 shuke987 requested a review from yiguolei as a code owner June 15, 2026 12:58
@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?

@shuke987

Copy link
Copy Markdown
Collaborator Author

run buildall

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.

2 participants