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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java:
##########
@@ -258,6 +265,53 @@ public List<MaterializedIndex> 
getMaterializedIndices(IndexExtState extState) {
         return indices;
     }
 
+    public String getMetaChecksum() {
+        MessageDigest digest = DigestUtils.getSha256Digest();
+        List<MaterializedIndex> indexes = 
getMaterializedIndices(IndexExtState.VISIBLE);
+        indexes.sort(Comparator.comparingLong(MaterializedIndex::getId));
+        for (MaterializedIndex index : indexes) {
+            updateMetaChecksum(digest, (byte) 1, index.getId());

Review Comment:
   `getMetaChecksum()` is now the gate for reusing the old serialized 
`Partition`, but it only hashes indexes/tablets/replicas and omits other 
serialized partition fields. A concrete stale-cache path is `ALTER TABLE ... 
RENAME PARTITION`: `Env.renamePartition()` calls `OlapTable.renamePartition()`, 
which only mutates `Partition.name`/`nameToPartition` and does not change the 
partition visible version or visible version time. On the next remote refresh, 
this checksum remains equal, `collectPartitionChanges()` removes the partition 
from `updatedPartitionIds`, and `RemoteOlapTable.rebuildPartitions()` reuses 
the old `Partition`, rebuilding `nameToPartition` with the old name. Queries or 
metadata operations that reference the new partition name can then fail or see 
stale partition metadata even though the source FE has renamed it. Please 
include all serialized `Partition` fields whose changes should invalidate the 
reused partition payload (at least the partition name/state/distribution i
 nfo, or derive the checksum from a stable serialization of the partition 
metadata) and add a rename-partition test that forces a checksum change without 
a visible-version change.



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