Copilot commented on code in PR #60064:
URL: https://github.com/apache/doris/pull/60064#discussion_r2707484590


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudPartition.java:
##########
@@ -251,16 +262,16 @@ public static List<Long> getSnapshotVisibleVersionFromMs(
     // Return the visible version in order of the specified partition ids, -1 
means version NOT FOUND.
     public static List<Long> getSnapshotVisibleVersion(List<CloudPartition> 
partitions) throws RpcException {
         if (partitions.isEmpty()) {
-            return new ArrayList<>();
+            return Collections.emptyList();
         }
 
         if (SessionVariable.cloudPartitionVersionCacheTtlMs <= 0) { // No 
cached versions will be used

Review Comment:
   Inconsistent access to cloudPartitionVersionCacheTtlMs. This line uses 
static access to SessionVariable.cloudPartitionVersionCacheTtlMs, but the 
isCachedVersionExpired() method (line 129) now uses instance access via 
ctx.getSessionVariable().cloudPartitionVersionCacheTtlMs. This creates 
inconsistent behavior. Either the field should be changed from static to 
instance in SessionVariable.java, or this access should be consistent with the 
other usage. Consider obtaining the session variable from ConnectContext like 
done in isCachedVersionExpired().



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