-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[fix](azure) Fix incorrect modification timestamps in AzureObjStorage #61790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()); | ||
| result.add(remoteFile); | ||
|
|
||
| blobPath = blobPath.getParent(); | ||
|
|
@@ -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 | ||
| ); | ||
|
Comment on lines
503
to
505
|
||
| result.add(remoteFile); | ||
|
|
||
|
|
@@ -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); | ||
|
Comment on lines
563
to
566
|
||
| result.add(file); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.