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


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/alter/CloudSchemaChangeHandler.java:
##########
@@ -393,7 +449,13 @@ public void updateTableProperties(Database db, String 
tableName, Map<String, Str
 
         olapTable.writeLockOrDdlException();
         try {
-            Env.getCurrentEnv().modifyTableProperties(db, olapTable, 
properties);
+            Map<Long, Integer> indexIdToSchemaVersion = new HashMap<>();
+            if (needSchemaVersionUpdate) {
+                for (MaterializedIndexMeta indexMeta : 
olapTable.getIndexIdToMeta().values()) {
+                    indexIdToSchemaVersion.put(indexMeta.getIndexId(), 
indexMeta.getSchemaVersion() + 1);

Review Comment:
   [blocking] This bumps the table-level schema versions without first 
materializing each existing partition's pre-bump version. A legacy partition 
loaded from metadata without `indexIdToSchemaVersion` falls back through 
`Partition.getSchemaVersion(indexId, defaultSchemaVersion)` to the mutable 
table-level version. After this update changes version N to N+1, that old V2 
partition will also resolve to N+1, while newly created V3 partitions record 
N+1 explicitly. Because Cloud Meta Service identifies a schema by `(index_id, 
schema_version)`, rebuilding/truncating/repairing the old partition can then 
reuse the V3 schema under the same key.
   
   Please snapshot version N into every existing partition that lacks an entry 
before changing the table-level versions, and persist/replay that partition 
backfill atomically with this property update. A compatibility test should 
deserialize a legacy partition with no `isv`, perform the V2→V3 rollout, and 
verify both the live catalog and edit-log replay keep the old partition on N 
while new partitions use N+1.



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