hello-stephen commented on code in PR #71130:
URL: https://github.com/apache/doris/pull/71130#discussion_r4746574685


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -3095,6 +3110,7 @@ public void updatePartitionsProperties(Database db, 
String tableName, List<Strin
             }
         }
         String storagePolicy = 
properties.get(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY);
+        checkNoIndexBuildBeforeStoragePolicy(db.getId(), olapTable, 
storagePolicy);

Review Comment:
   [P2] Serialize policy activation with IMMEDIATE job creation
   
   On a local table with historical data and no storage policy, a `MODIFY 
PARTITION ... SET ('storage_policy' = '...')` can pass this check and pause in 
`updatePartitionProperties`' RPC/wait. A second connection can then run `ADD 
INDEX ... BUILD IMMEDIATE`: path resolution still sees the old partition 
policy, selects `LIGHT_AND_BUILD`, and submits jobs. The first ALTER 
subsequently activates/publishes the policy without another check. An earlier 
open load can keep those jobs in `WAITING_TXN` while committed historical 
rowsets cool; the BE lock protects only executing work. 
`Tablet::pick_candidate_rowsets_to_build_inverted_index` skips remote rowsets, 
so the jobs can finish successfully with historical data still unindexed (and 
MATCH fails with fallback disabled). Reserve pending policy state under the 
same table lock used for IMMEDIATE routing/submission before sending BE 
updates, keeping RPCs outside the lock, and cover this interleaving with a 
concurrency test.



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