Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-16676

Hard links used for image aliases can lead to severe data loss in image storage

    XMLWordPrintable

Details

    Description

      On Linux file system image aliases are optimized and stored as hard links:

      $ ls -il
      total 112
      36340323 -rw-rw-r-- 2 apache apache 26808 2009-08-31 21:48 Foto-1.jpg
      36340323 -rw-rw-r-- 2 apache apache 26808 2009-08-31 21:48 Foto-1_article-full.jpg
      30098943 -rw-rw-r-- 1 apache apache 23627 2010-03-12 07:28 Foto-1_full.jpg
      30098601 -rw-rw-r-- 1 apache apache 23564 2009-11-19 19:04 Foto-1_medium.jpg
      30083556 -rw-rw-r-- 1 apache apache  7732 2009-11-19 18:43 Foto-1_small.jpg
      

      We can see, that ‘article-full’ and ‘original’ file is hardlinked together, because there is no additional filters for ‘article-full’ in configuration.

      image.ini.append.php
      
      [article-full]
      Reference=original
      Filters[] 
      

      If one change configuration, and add some filters to ‘article-full’, existing hard-linked files *will not* be removed, and any regeneration of alias cache will also overwrite *original* file!
      So if we want to add, for example, watermarked logo while site is in production stage, logo will be added over and over again because alias and original file points to the same object in the file system.

      As a workaround, after changing configuration in image.ini.append.php we can remove all aliased files manually. But it is not so easy, because there is no simple way to specify filename of original image.
      Probably it would be better, if original images also contain some suffix e.g. ‘_original’. Separate storage of original and aliased images also could make such emergency cache removal easier.

      Attachments

        Activity

          People

            unknown unknown
            ply ply
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: