Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-98526

S3 cache is not properly cleaned up within the configured time frame

    Details

      Description

      Background
      When using S3, uploaded documents and generated previews are stored as cache in <tomcat_home>/temp/liferay/s3 directory.

      • generated previews are stored in a sub-folder:
        • master/72x: adaptive/
        • 71x: document_thumbnail/

      Cache files are cleaned, based on the "Cache Directory Clean Up Expunge" and "Cache Directory Clean Up Frequency" configuration options, in System Settings.

      See this KB for more details:
      https://help.liferay.com/hc/ja/articles/360017899351-Optimizing-S3Store-Cache-Settings

      Issue
      Cache files that are expected to be expired, are not getting removed.

      Steps to Reproduce

      1. Start Liferay
      2. Configure Liferay to use S3 Store
      3. Configure S3 Store Cache properties in System Settings:
      4. Note that <tomcat_home>/temp/liferay/s3 does not exist
      5. Go to Documents and Media 
        1. Upload a new image
        2. Click Save
      6. Refresh Documents and Media page
      7. Notice that the following folders and files are created, based on the current date (e.g. 07-17-2019)
        1. Cache File:
          • <tomcat_home>/temp/liferay/s3/2019/07/17/07/1021563349685000
        2. Thumbnail Folder:
          • <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/
        3. Thumbnail File:
          • <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
      8. Logout
      9. Change the OS date to fast-forward time to 2 days ahead (e.g. 7/17 to 7/19)
      10. Log back in
      11. Go to Documents and Media page again
      12. Notice the following observations:
        1. New thumbnail cache file is created for the different "day" and with the same name:
          • Thumbnail File:
            <tomcat_home>/temp/liferay/s3/2019/07/19/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
        2. The Old thumbnail cache folder/file(s) from the previous day has been removed:
          • Thumbnail Folder:
            • <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/
          • Thumbnail File:
            • <tomcat_home>/temp/liferay/s3/2019/07/17/07/adaptive/Preview-1000x0/20142/206/30926/30927.png1563349712000
        3. The Old Cache File has not been removed:
          • Cache File:
            • <tomcat_home>/temp/liferay/s3/2019/07/17/07/1021563349685000

      Actual behavior
      The Original Cache File is not removed (only the Original Thumbnail Folder/File(s) have been removed)

      Expected behavior
      Both the Old Cache File and Old Thumbnail Folder/File(s) are removed

       

        Attachments

          Activity

            People

            • Assignee:
              beck.liu Beck Liu
              Reporter:
              eric.yan Eric Yan
              Participants of an Issue:
              Recent user:
              Jason Pince
              Engineering Assignee:
              Eric Yan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                50 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP86
                7.0.X
                7.1.10 DXP FP14
                7.1.X
                7.2.10 DXP FP1
                7.2.X
                7.2.1 CE GA2
                Master