Skip to content

[fix](case) test_admin_compact_table: count distinct tablets for multi-replica clusters#64509

Open
shuke987 wants to merge 1 commit into
apache:branch-4.1from
shuke987:fix-test-admin-compact-table-multireplica
Open

[fix](case) test_admin_compact_table: count distinct tablets for multi-replica clusters#64509
shuke987 wants to merge 1 commit into
apache:branch-4.1from
shuke987:fix-test-admin-compact-table-multireplica

Conversation

@shuke987

Copy link
Copy Markdown
Collaborator

Problem

On a multi-replica test cluster (e.g. force_olap_table_replication_num=3), SHOW TABLETS returns one row per (tablet, replica). A table created with BUCKETS 1 therefore yields 3 rows, so assertEquals(1, tablets.size()) fails (expected 1, got 3). The assertion implicitly assumes a single replica.

Fix

Assert on the distinct tablet count: tablets.collect { it.TabletId }.unique().size(). The subsequent code already picks one replica via tablets[0].

Verification

Ran the suite on a branch-4.1 local cluster (3 FE + 4 BE, force-3 replicas) — passes.

🤖 Generated with Claude Code

…i-replica clusters

SHOW TABLETS returns one row per (tablet, replica). On a multi-replica test cluster
(e.g. force_olap_table_replication_num=3) a table with BUCKETS 1 yields 3 rows, so
assertEquals(1, tablets.size()) fails (expected 1, got 3) -- the assertion implicitly
assumes a single replica. Assert on the distinct tablet count instead.

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 06:53
@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