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

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #71043 (master fix, open; this pick follows any change it gets 
in review), #70357 (brought partition DROP INDEX and the light DROP pre-check 
to branch-4.1)
   
   Problem Summary:
   
   Pick of #71043 (commit 5c5d807d234) to branch-4.1.
   
   BUILD INDEX and DROP INDEX on partitions, and the whole-table light DROP 
INDEX pre-check, look for an unfinished index change job of the same index by 
the partition name stored in the job, which is the name at job creation. 
`RENAME PARTITION` is allowed while such jobs run, so after a rename a 
statement on the new name finds no conflict: a DROP can run while a BUILD of 
the same index is pending, and the BUILD restores the index afterwards. The 
checks now match jobs by partition ID, which a rename does not change.
   
   Hunk audit against the source diff:
   
   | File | Source hunk | Result |
   |---|---|---|
   | `IndexChangeJob.java` | `@@ -202,6 +202,10 @@ public class IndexChangeJob 
implements Writable {` | Ported |
   | `SchemaChangeHandler.java` | `@@ -3975,7 +3975,7 @@ public class 
SchemaChangeHandler extends AlterHandler {` | Ported |
   | `SchemaChangeHandler.java` | `@@ -4041,29 +4041,32 @@ public class 
SchemaChangeHandler extends AlterHandler {` | Adapted: kept this branch's light 
DROP pre-check, which has no add-and-drop or cluster checks; only the partition 
matching changes |
   | `SchemaChangeHandler.java` | (this branch only) partition DROP pre-check | 
Adapted: passes the selected partitions as IDs |
   | `SchemaChangeHandlerTest.java` | `@@ -1403,7 +1403,9 @@ public class 
SchemaChangeHandlerTest extends TestWithFeService {` | N-A: 
`testDropIndexRejectedByIndexChangeJobKeepsMetadata` does not exist on this 
branch |
   | `SchemaChangeHandlerTest.java` | `@@ -1493,6 +1495,7 @@ public class 
SchemaChangeHandlerTest extends TestWithFeService {` | Ported to this branch's 
`testDropIndexRejectedByPendingBuildOfSameIndex` |
   | `SchemaChangeHandlerTest.java` | `@@ -1516,6 +1519,54 @@ public class 
SchemaChangeHandlerTest extends TestWithFeService {` | Adapted: the partition 
DROP is rejected by this branch's pre-check, so the test expects "has an 
unfinished index change job" for both statements |
   
   ### Release note
   
   Fix BUILD INDEX and DROP INDEX on partitions missing a conflict with an 
unfinished index change job when the partition was renamed after the job was 
created.
   
   ### Check List (For Author)
   
   - Test
       - [ ] 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.SchemaChangeHandlerTest,org.apache.doris.alter.IndexChangeJobTest,org.apache.doris.alter.CloudIndexTest`
 passed (31, 18 and 5 tests), including the new 
`testIndexChangeConflictFollowsRenamedPartition`; it failed on master without 
the fix (#71043). Merge-tree FE Checkstyle passed. No regression case: holding 
an index change job unfinished in a real cluster needs a delay hook that does 
not exist, so a SQL case would depend on timing.
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### 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