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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java:
##########
@@ -1095,6 +1095,13 @@ public void recoverPartition(long dbId, OlapTable table, 
String partitionName,
                 partitionInfo.setInvertedIndexFileStorageFormat(partitionId,
                         
recoverPartitionInfo.getInvertedIndexFileStorageFormat());
             }
+            if (recoverPartitionInfo.getStoragePolicy() != null) {
+                partitionInfo.setStoragePolicy(partitionId, 
recoverPartitionInfo.getStoragePolicy());
+                DataProperty dataProperty = 
partitionInfo.getDataProperty(partitionId);
+                if (dataProperty != null) {
+                    
dataProperty.setStoragePolicy(recoverPartitionInfo.getStoragePolicy());

Review Comment:
   [P2] Reconcile the saved policy before overwriting `DataProperty`. With no 
table-level policy, assign policy A to a partition, then run an unrelated 
`ALTER TABLE ... SET ("disable_auto_compaction"="true")`. 
`Env.modifyTableProperties` overwrites the partition's map entry with the 
table's empty policy while leaving `DataProperty.storagePolicy=A`. A soft DROP 
saves that empty value, and this setter changes the recovered property from A 
to empty. With table policy A and a per-partition override B on the same 
resource, the same path changes recovered B to A. `replayAddPartition` can also 
leave the two values inconsistent. Before this change, recovery retained the 
saved `DataProperty` policy. This needs no truncate or shared object, unlike 
the existing thread. Please keep both representations aligned before recycling 
and cover real ALTER -> DROP -> RECOVER and replay paths.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -2290,6 +2296,7 @@ public Partition replacePartition(Partition newPartition,
             partitionInfo.addPartition(newPartition.getId(), dataProperty, 
replicaAlloc, isInMemory, isMutable);
         }
 
+        partitionInfo.setStoragePolicy(newPartition.getId(), storagePolicy);

Review Comment:
   [P2] Preserve an explicit storage-policy cancellation during replay before 
copying this value. Start with policy A on an empty partition, then run `ALTER 
TABLE ... MODIFY PARTITION ... SET ("storage_policy"="")` and a non-force 
TRUNCATE. `ModifyPartitionInfo` logs the empty policy, but 
`Alter.replayModifyPartition` installs the empty `DataProperty` while filtering 
out the empty update to `idToStoragePolicy`, leaving A on a replayed FE. 
`replayTruncateTable` now copies that stale A into the replacement ID here, 
although the master and the new tablets have no policy. A later soft 
drop/recover can also use A to re-enable the canceled policy. This requires 
replay of a cancellation, unlike the existing truncate aliasing thread. Please 
distinguish an explicit empty policy from an absent policy in journal replay, 
or reconcile the values before propagation, and test replay followed by 
truncate and recovery.



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