github-actions[bot] commented on code in PR #68541:
URL: https://github.com/apache/doris/pull/68541#discussion_r4119615491
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionInfo.java:
##########
@@ -405,6 +407,22 @@ public void addPartition(long partitionId, DataProperty
dataProperty,
idToInMemory.put(partitionId, isInMemory);
}
+ @Override
+ public void gsonPostProcess() throws IOException {
+ // Every live partition has a data property, so storage policy entries
without one
+ // belong to dropped partitions.
+ if (idToStoragePolicy == null || idToDataProperty == null) {
+ return;
+ }
+ int before = idToStoragePolicy.size();
+ idToStoragePolicy.keySet().retainAll(idToDataProperty.keySet());
Review Comment:
[P2] Preserve recycled partitions' storage policy during image cleanup. In
an image written before #64650, a soft-dropped partition in `CatalogRecycleBin`
has no `idToDataProperty` entry but can still have a nonempty
`idToStoragePolicy` entry. This `retainAll` deletes it. `recoverPartition` and
`replayRecoverPartition` restore `DataProperty` but never restore the policy
map, so recovery after upgrade makes `SHOW CREATE TABLE` and partition metadata
omit the partition's policy. Please preserve the policy needed by recoverable
partitions through image loading and recovery; the two policy fields can
differ, so copying `DataProperty` alone may not preserve the previous metadata.
Add an old-image load and recovery 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]