[fix](sync) Treat empty cancel alter job list as all rollup jobs#62712
Open
seawinde wants to merge 1 commit intoapache:masterfrom
Open
[fix](sync) Treat empty cancel alter job list as all rollup jobs#62712seawinde wants to merge 1 commit intoapache:masterfrom
seawinde wants to merge 1 commit intoapache:masterfrom
Conversation
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Nereids always constructs a non-null alter job id list for CANCEL ALTER TABLE, using an empty list when the SQL omits explicit job ids. SchemaChangeHandler already treats an empty list as "cancel all unfinished jobs on the table", but MaterializedViewHandler only checked for null. As a result, `CANCEL ALTER TABLE ... ROLLUP FROM db.tbl` could incorrectly search by explicit job ids, find nothing, and throw `Table[...] is not under ROLLUP` even when the table had unfinished rollup jobs.
### Release note
None
### Check List (For Author)
- Test: Attempted FE unit test
- Unit Test: `./run-fe-ut.sh --run org.apache.doris.alter.RollupJobV2Test#testCancelRollupWithEmptyJobIdList` (blocked by local FE build failure in pattern generation: `PatternDescribableProcessor` missing `org.apache.doris.nereids.pattern.generator.javaast.TypeBound` during `generate-patterns`)
- Behavior changed: Yes (CANCEL ALTER TABLE ROLLUP/MATERIALIZED VIEW without explicit job ids now treats an empty job-id list the same as an omitted list)
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
|
/review |
Contributor
FE Regression Coverage ReportIncrement line coverage |
morrySnow
approved these changes
Apr 22, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
There was a problem hiding this comment.
No blocking issues found.
Critical checkpoints:
- Goal / correctness:
LogicalPlanBuilder.visitCancelAlterTable()always builds a non-nullalterJobIdList, so changingMaterializedViewHandler.cancel()to treat an empty list as "all unfinished jobs on this table" correctly aligns the rollup/MV path with the existing FE behavior for omitted job ids. The new tests cover both the parser shape and the handler behavior. - Scope: Minimal and focused. One handler condition changed plus targeted tests.
- Concurrency / locking: The touched path still collects candidate jobs under the table write lock and performs
cancel()outside the lock, matching the existing locking pattern. I did not find a new deadlock or lock-expansion risk in this change. - Lifecycle / static init: Not involved.
- Config / compatibility / FE-BE protocol / persistence / data writes: Not involved.
- Parallel paths: This change makes the rollup/MV cancel path consistent with the existing empty-list handling used in the other cancel-job paths.
- Special condition: The new emptiness check is necessary because the Nereids parser uses an empty list, not
null, when SQL omits explicit job ids. - Test coverage: Good targeted unit coverage was added for the parser and rollup handler. Residual gap: there is still no end-to-end regression test for the user-visible SQL statement.
- Test results in this runner: I could not execute the targeted FE unit test here because
thirdparty/installed/bin/protocis missing, so this review is based on static analysis only. - Observability / performance: No concerns for a change this small.
Non-blocking nit:
- The PR title is
[fix](sync) ..., but the code change is in FE;[fix](fe) ...would match the repository's usual module naming better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
Nereids always constructs a non-null alter job id list for
CANCEL ALTER TABLE, using an empty list when the SQL omits explicit job ids.SchemaChangeHandleralready treats an empty list as "cancel all unfinished jobs on the table", butMaterializedViewHandleronly checked fornull. As a result,CANCEL ALTER TABLE ... ROLLUP FROM db.tblcould incorrectly search by explicit job ids, find nothing, and throwTable[...] is not under ROLLUPeven when the table still had unfinished rollup jobs.This change aligns
MaterializedViewHandlerwithSchemaChangeHandlerby treating an empty job-id list the same as an omitted list, and adds regression tests for both the handler path and the Nereids parser behavior.Release note
None
Check List (For Author)
Test
Behavior changed:
CANCEL ALTER TABLE ROLLUP/MATERIALIZED VIEWwithout explicit job ids now treats an empty job-id list the same as an omitted list.Does this need documentation?