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

eZDFS cleanup: Allow detection of NFS and DB availability to prevent accidental removal of files.

    Details

      Description

      The DFS cleanup script dfscleanup.php has options to check both the database and NFS share for existing files, and remove "stale" data in its counterpart.

      However, in case of failure of either, files/records will be (incorrectly) removed as they are not found.

      Steps to reproduce:
      • Run dfscleanup.php script
      • Disconnect the NFS mount point

      Files will be removed from the database.

      Suggested enhancement:
      • Either by default, or using a parameter/flag, check for general availability of the mount point (as well as database) if a file is not found.
      • On the NFS share, this could be done, for example, by checking for the existence of an existing file or directory (var dir?) when a file is not found.
      • If the NFS or DB are not available, the script could then terminate without further processing.

        Issue Links

          Activity

          Hide
          Joao Pingo (Inactive) added a comment - - edited

          If the database stops when the script is running i'm getting the same result as you...
          My older result is present if the database is stoped before the script is run's, with -d i get

          An unexpected error has occurred. Please contact the webmaster.
          Error 2003: Can't connect to MySQL server on '192.168.2.220' (111) in /var/www/apache2php53/ezp5/ezpublish_testsystem/.run/kernel/private/classes/clusterfilehandlers/dfsbackends/mysqli.php on line 158
          

          Show
          Joao Pingo (Inactive) added a comment - - edited If the database stops when the script is running i'm getting the same result as you... My older result is present if the database is stoped before the script is run's, with -d i get An unexpected error has occurred. Please contact the webmaster. Error 2003: Can't connect to MySQL server on '192.168.2.220' (111) in /var/www/apache2php53/ezp5/ezpublish_testsystem/.run/kernel/private/classes/clusterfilehandlers/dfsbackends/mysqli.php on line 158
          Hide
          Joaquim Cavalleri (Inactive) added a comment -

          @Joao Pingo Could your unexpected error result of the database that died not being the DFS database but the main DB instead? Did you ran the test with two separate DB instances and killed DFS only?

          Show
          Joaquim Cavalleri (Inactive) added a comment - @ Joao Pingo Could your unexpected error result of the database that died not being the DFS database but the main DB instead? Did you ran the test with two separate DB instances and killed DFS only?
          Hide
          Bertrand Dunogier added a comment -

          Note that the error happens in dfshandlers/mysqli.php, it can't be an error from the eZ DB.

          Show
          Bertrand Dunogier added a comment - Note that the error happens in dfshandlers/mysqli.php , it can't be an error from the eZ DB.
          Show
          Yannick Roger (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/766ee0022fc93e3499aa44ebf329ff7a79cb0bad
          Hide
          Joao Pingo (Inactive) added a comment -

          QA Approved

          Show
          Joao Pingo (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Joao Inacio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 3 days, 4 hours, 15 minutes
                1w 3d 4h 15m