airborne12 opened a new pull request, #71042:
URL: https://github.com/apache/doris/pull/71042

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #71041 (master fix, open; this pick follows any change it gets 
in review), #70357 (brought DROP INDEX ON PARTITION to branch-4.1)
   
   Problem Summary:
   
   Pick of #71041 (commit 83809891202) to branch-4.1.
   
   In cloud mode, `DROP INDEX ... ON PARTITION` and `ALTER TABLE ... DROP INDEX 
... PARTITION` report success and their job reaches FINISHED, but the index 
stays: the cloud index-change task ignores `is_drop_op` and only rewrites 
rowsets older than the table's schema version, and a partition drop keeps that 
version. Cloud mode cannot hold a rowset schema that differs from the table 
schema at the same schema version, so this change rejects both statements in 
cloud mode with "DROP INDEX ON PARTITION is not supported in cloud mode". 
Shared-nothing mode and whole-table `DROP INDEX` are unchanged. See #71041 for 
the end-to-end reproduction on a cloud cluster.
   
   Hunk audit against the source diff:
   
   | File | Source hunk | Result |
   |---|---|---|
   | `DropIndexOp.java` | `@@ -21,6 +21,7 @@ import 
org.apache.doris.alter.AlterOpType;` | Ported |
   | `DropIndexOp.java` | `@@ -101,6 +102,11 @@ public class DropIndexOp 
extends AlterTableOp {` | Ported |
   | `IndexChangeJobTest.java` | `@@ -1058,6 +1058,25 @@ public class 
IndexChangeJobTest {` | Adapted: this branch's file uses JUnit 4 `Assert` and 
did not import `Config`, so the test imports it and uses the 
try/`Assert.fail`/catch form of its neighbours with the same checks |
   | `test_drop_index_on_partition.groovy` | `@@ -51,6 +51,37 @@ 
suite("test_drop_index_on_partition", "inverted_index") {` | Ported, after this 
branch's helpers |
   | `test_cloud_build_index_on_partition.groovy`, `.out` | new files | Ported 
(verbatim) |
   
   ### Release note
   
   In cloud mode, `DROP INDEX ... ON PARTITION` and `ALTER TABLE ... DROP INDEX 
... PARTITION` now fail with "DROP INDEX ON PARTITION is not supported in cloud 
mode". Before, they reported success but kept the index on the named 
partitions. Drop the index from the whole table instead.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test.
   
       Run locally on this branch: `./run-fe-ut.sh --run 
org.apache.doris.alter.IndexChangeJobTest,org.apache.doris.alter.CloudIndexTest,org.apache.doris.alter.SchemaChangeHandlerTest`
 passed (19, 5 and 30 tests). With the `DropIndexOp` check removed, 
`IndexChangeJobTest#testDropIndexOnPartitionRejectedInCloudMode` fails with 
"DROP INDEX ON PARTITION must be rejected in cloud mode". Merge-tree FE 
Checkstyle passed. The regression changes are cloud-only (the cloud branch of 
`test_drop_index_on_partition` and the new 
`test_cloud_build_index_on_partition`); they were run on a master cloud cluster 
in #71041 but not on a branch-4.1 cloud build here, and cloud_p0 runs them on 
this branch.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. In cloud mode the two partition-drop statement forms now fail 
at analysis instead of reporting a drop that did not happen.
   
   - Does this need documentation?
       - [x] No. The DROP INDEX page in apache/doris-website does not document 
the ON PARTITION form.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to