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


##########
fe/fe-core/src/main/java/org/apache/doris/fs/obj/AzureObjStorage.java:
##########
@@ -425,7 +425,8 @@ public Status globList(String remotePath, List<RemoteFile> 
result, boolean fileN
                                 !isPrefix,
                                 isPrefix ? -1 : 
blobItem.getProperties().getContentLength(),
                                 isPrefix ? -1 : 
blobItem.getProperties().getContentLength(),
-                                isPrefix ? 0 : 
blobItem.getProperties().getLastModified().getSecond());
+                                isPrefix ? 0 : 
blobItem.getProperties().getLastModified()
+                                        .toInstant().toEpochMilli());

Review Comment:
   Add/extend unit tests (e.g., AzureObjStorageTest’s mocked paged listing) to 
assert RemoteFile.modificationTime is an epoch-millisecond value derived from 
BlobItemProperties.getLastModified().toInstant().toEpochMilli(), so regressions 
back to second-of-minute/epoch-seconds are caught.



##########
fe/fe-core/src/main/java/org/apache/doris/fs/obj/AzureObjStorage.java:
##########
@@ -500,7 +501,7 @@ private Status globListByGetProperties(String bucket, 
String keyPattern,
                             props.getBlobSize(),
                             props.getBlobSize(),
                             props.getLastModified() != null
-                                    ? props.getLastModified().toEpochSecond() 
: 0
+                                    ? 
props.getLastModified().toInstant().toEpochMilli() : 0
                     );

Review Comment:
   Add test coverage for the deterministic-path getProperties/HEAD flow to 
validate the modification time unit is epoch milliseconds (not epoch seconds). 
Using a fixed OffsetDateTime in mocks will make the assertion deterministic.



##########
fe/fe-core/src/main/java/org/apache/doris/fs/obj/AzureObjStorage.java:
##########
@@ -561,7 +562,7 @@ public Status listFiles(String remotePath, boolean 
recursive, List<RemoteFile> r
                             false,
                             props.getContentLength(),
                             props.getContentLength(),
-                            props.getLastModified().getSecond(),
+                            props.getLastModified().toInstant().toEpochMilli(),
                             null);

Review Comment:
   Consider adding a unit test around listFiles() (or a small isolated helper) 
to assert BlobItemProperties.getLastModified is converted to epoch 
milliseconds, since this path previously returned an incorrect value and is 
easy to regress.



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