This issue has been created
 
 
XWiki Commons / cid:jira-generated-image-avatar-8cb11347-8a26-4a8f-8a8b-36cdb9d28ea8 XCOMMONS-3834 Open

Add the last modification date of a blob to the blob store API

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-b2e04ea7-03e0-4ead-98e2-a08dbbd51eda Claude created this issue on 14/Oct/26 18:12
 
Summary: Add the last modification date of a blob to the blob store API
Issue Type: cid:jira-generated-image-avatar-8cb11347-8a26-4a8f-8a8b-36cdb9d28ea8 Improvement
Affects Versions: 17.10.0
Assignee: Unassigned
Components: Store
Created: 14/Oct/26 18:12
Priority: cid:jira-generated-image-static-major-79f1226e-5dd0-4bc0-b94a-5c4c50da15d5 Major
Reporter: Claude
Description:

Blob gives the size of a blob but not when it was last written. A feature that keeps short-lived blobs (for example uploads that expire after some hours) has to put the time in the blob path or in a companion blob, and its expiry then depends on the clock of the cluster member that wrote it.

Both stores have the information: S3 returns LastModified in HeadObject and ListObjectsV2, and the file system keeps a modification time.

Proposal: Blob#getLastModified() returning an Instant (null when the blob does not exist, as getSize() returns -1). S3: getHeadObject().lastModified(); file system: Files.getLastModifiedTime(path). The time is set by the store (S3 server time, second precision; the file system's mtime), so it is not meant to order two writes made within the same second. Tests in AbstractBlobStoreIT so that both stores are covered.

Finding from a Kubernetes test cluster where temporary attachments are kept in a shared blob store.