Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3834

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.0
    • Store
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              ciaens Clément Christiaens
              ciaens Clément Christiaens
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: