github-actions[bot] commented on code in PR #68558:
URL: https://github.com/apache/doris/pull/68558#discussion_r4120215840


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -2272,10 +2276,12 @@ public Partition replacePartition(Partition 
newPartition,
         ReplicaAllocation replicaAlloc = 
partitionInfo.getReplicaAllocation(oldPartition.getId());
         boolean isInMemory = partitionInfo.getIsInMemory(oldPartition.getId());
         boolean isMutable = partitionInfo.getIsMutable(oldPartition.getId());
+        String storagePolicy = 
partitionInfo.getStoragePolicy(oldPartition.getId());
         recyclePartitionParam.dataProperty = dataProperty;
         recyclePartitionParam.replicaAlloc = replicaAlloc;
         recyclePartitionParam.isInMemory = isInMemory;
         recyclePartitionParam.isMutable = isMutable;
+        recyclePartitionParam.storagePolicy = storagePolicy;

Review Comment:
   After a non-force `TRUNCATE`, `replacePartition` puts the same 
`DataProperty` object in the replacement partition and `recyclePartitionParam`, 
while this line saves its policy name separately. A later `ALTER TABLE ... SET 
("storage_policy"="B")` is allowed for the empty replacement and mutates that 
shared `DataProperty` to B, but the recycled string remains A. If the 
replacement is dropped and the old partition recovered by ID, recovery installs 
`DataProperty.storagePolicy=B` and `idToStoragePolicy=A`: `SHOW PARTITIONS` and 
policy checks use B, while partition DDL renders A. A checkpoint between 
truncate and ALTER can also make recovery differ by replay timing. Please give 
the recycle entry or replacement its own `DataProperty` snapshot and add a 
truncate → policy change → recover test that checks both fields and replay.



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