airborne12 commented on code in PR #68674:
URL: https://github.com/apache/doris/pull/68674#discussion_r4335560070


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -3529,6 +3529,11 @@ public void modifyTableLightSchemaChange(String rawSql, 
Database db, OlapTable o
                     currentIndexMeta.getSchemaHash(), 
currentIndexMeta.getShortKeyColumnCount(), entry.getValue());
         }
 
+        // Reject the drop before touching metadata, so a failed DROP INDEX 
leaves the table unchanged.
+        if (alterIndexes != null && isDropIndex && !isReplay) {

Review Comment:
   Addressed in 6a5dae92: the light DROP INDEX pre-check now rejects a light 
ADD INDEX and a light DROP INDEX in one ALTER statement before any clause is 
processed ("Can not add and drop indexes in one ALTER statement, please run 
them in separate statements."). The light path cannot express both directions 
in one set of delete jobs. A statement whose ADD or DROP is not light keeps its 
behavior.



##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -3529,6 +3529,11 @@ public void modifyTableLightSchemaChange(String rawSql, 
Database db, OlapTable o
                     currentIndexMeta.getSchemaHash(), 
currentIndexMeta.getShortKeyColumnCount(), entry.getValue());
         }
 
+        // Reject the drop before touching metadata, so a failed DROP INDEX 
leaves the table unchanged.
+        if (alterIndexes != null && isDropIndex && !isReplay) {
+            checkNoIndexChangeJobOnPartitions(db, olapTable, alterIndexes, 
olapTable.getPartitionNames());

Review Comment:
   Out of scope for this PR. This is pre-existing behavior on master and 
unrelated to what this PR fixes (a rejected light DROP INDEX must not have 
dropped the index metadata); the PR does not change the dispatch between the 
light and heavy paths. Whether a column change needs a heavy schema change is 
only known after its clause is processed, so a correct fix needs to collect 
what every clause requires and then choose one execution path, which is a 
separate design change.



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