Skip to content

[fix](regression) Select compaction profile BE by tablet replica - #65552

Merged
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/fix-compaction-profile-be-routing
Jul 16, 2026
Merged

[fix](regression) Select compaction profile BE by tablet replica#65552
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/fix-compaction-profile-be-routing

Conversation

@shuke987

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: #63886

Problem Summary:

test_compaction_profile_action queried /api/compaction/profile on the first backend returned by SHOW BACKENDS, independently of the target tablet placement. The profile API reads the selected BE's process-local compaction tracker, so the tablet filter returned an empty list whenever that backend was the one BE outside the target tablet's three-replica set.

The branch-4.1 P0 history shows 13 failures in 32 runs. In every failure, the queried first backend was outside the target replica set; in every passing run, it hosted a target replica.

This change derives the profile endpoint from the BackendId in the same SHOW TABLETS row as the selected TabletId. The case therefore queries a replica that participates in trigger_and_wait_compaction while preserving all existing API assertions.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • mvn package -DskipTests -Dmaven.javadoc.skip=true in regression-test/framework.
      • Verified the shaded regression-test jar with ZipFile.testzip().
      • Parsed the updated suite with GroovyShell.parse().
      • Runtime single-case validation is pending because the authorized test host timed out on SSH twice; no runtime pass is claimed here.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No. The product API behavior is unchanged; this only routes the regression assertion to a target-tablet replica.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#63886

Problem Summary: The compaction profile regression case queried the first backend returned by SHOW BACKENDS, while the target tablet could be placed on the other three backends. Because the compaction profile API reads a BE-local tracker, the tablet filter returned an empty profile list whenever the selected backend did not host the target tablet. Select the backend from the same SHOW TABLETS row as the target tablet so the query reaches a replica that executed the compaction.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - Built the regression framework with Maven and parsed the updated Groovy suite with GroovyShell.
- Behavior changed: No. This only stabilizes regression-test BE routing.
- 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?

@shuke987

Copy link
Copy Markdown
Contributor Author

run buildall

@shuke987

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Jul 20th, 2026 12:23 AM.
Workflow run: https://github.com/apache/doris/actions/runs/29248839159

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

@shuke987

Copy link
Copy Markdown
Contributor Author

/review

@shuke987
shuke987 marked this pull request as ready for review July 15, 2026 12:49
@shuke987
shuke987 requested a review from Yukang-Lian July 15, 2026 12:49

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

I found no blocking issues in this PR.

Critical checkpoint conclusions:

  • Goal and correctness: the change makes the compaction profile test query the BE that owns the selected tablet, which matches the local nature of /api/compaction/profile and the helper's per-tablet compaction routing.
  • Scope: the patch is small and focused on the flaky backend selection in one regression test.
  • Concurrency/lifecycle/config/compatibility/persistence/data-write paths: no production code or runtime contract is changed; the reviewed behavior is test-side BE selection.
  • Parallel paths: compaction helpers and nearby tests already route tablet-specific HTTP calls through tablet.BackendId; this patch aligns the profile query with that pattern.
  • Test coverage: the PR adjusts an existing p0 regression test. I did not run tests in this review environment, per the prompt's no-build/no-test-modification review scope.
  • User focus: no additional user-provided review focus was supplied.

Subagent convergence: Round 1 completed. The normal full-review subagent and the R1 risk-focused subagent both returned NO_NEW_VALUABLE_FINDINGS; the main-agent risk item was dismissed with code evidence, and no unresolved candidates remain.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@hello-stephen
hello-stephen merged commit fd16ebd into apache:master Jul 16, 2026
36 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 16, 2026
)

Related PR: #63886

Problem Summary:

`test_compaction_profile_action` queried `/api/compaction/profile` on
the first backend returned by `SHOW BACKENDS`, independently of the
target tablet placement. The profile API reads the selected BE's
process-local compaction tracker, so the tablet filter returned an empty
list whenever that backend was the one BE outside the target tablet's
three-replica set.

The branch-4.1 P0 history shows 13 failures in 32 runs. In every
failure, the queried first backend was outside the target replica set;
in every passing run, it hosted a target replica.

This change derives the profile endpoint from the `BackendId` in the
same `SHOW TABLETS` row as the selected `TabletId`. The case therefore
queries a replica that participates in `trigger_and_wait_compaction`
while preserving all existing API assertions.
yiguolei pushed a commit that referenced this pull request Jul 17, 2026
…replica #65552 (#65720)

Cherry-picked from #65552

Co-authored-by: shuke <shuke@selectdb.com>
morningman added a commit to morningman/doris that referenced this pull request Aug 5, 2026
…lect compaction profile BE by tablet replica apache#62178 apache#65552

Backport two upstream regression-test fixes that never reached branch-4.0.
Both cause recurring failures in the daily branch-4.0 P0 pipeline.

1. ann_index_basic vs ivf_index_test table-name collision (apache#62178)

ann_index_basic and ivf_index_test run in the same regression database
(ann_index_p0) and both used tbl_ann_l2 / tbl_ann_ip. With suiteParallel=10
they can run concurrently: FE logs of the failing run show ivf_index_test
dropping and recreating tbl_ann_ip 230ms after ann_index_basic created it,
then inserting 6 rows. ann_index_basic then reads the neighbor's table by
name and fails. This also explains the historical intermittent empty result
of sql_ip_asc (query landing between the neighbor's create and publish);
the insert itself publishes in ~80ms, so the visibility-window theory
behind the waitRowsVisible gate (apache#65942) was wrong, and the 30s gate now
times out against the neighbor's 6-row table instead.

Rename the shared tables with basic_/ivf_ prefixes as upstream did in
9c226f5 (apache#62178) and drop the gate. ann_index_basic.groovy becomes
byte-identical to the upstream post-fix file. ivf_index_test takes only
the renames because the upstream file also carries the apache#60358 behavior
change (insufficient train rows no longer throws) which branch-4.0 BE
does not have. No .out changes needed.

2. test_compaction_profile_action queries an arbitrary BE (apache#65552)

The suite built the /api/compaction/profile URL from
backendId_to_backendIP.keySet()[0]. On a multi-BE pipeline (4 BEs,
replication forced to 3) the chosen BE has ~1/4 chance of not hosting the
tablet replica, so the tablet_id filter returns an empty list (observed
5/26 failures; the case is currently muted as DORIS-26131). Derive the
endpoint from the BackendId of the selected tablet row as upstream did in
fd16ebd (apache#65552); the file becomes byte-identical to the upstream
post-fix version.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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