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

one bug and many problems with mysql db cluster file handler and delete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Obsolete
    • Affects Version/s: 3.10.0, 4.0.0
    • Fix Version/s: None
    • Component/s: Legacy > Clustering
    • Labels:
      None

      Description

      when calling eZClusterFileHandler::delete() and the mysql db backend is in use, no files are really deleted, only their timestamps are set to a negative value.

      Problems:

      • there is a bug in function eZDBFileHandlerMysqlBackend->_exists(): it checks if $row[0][1] is positive, but it should check $row[1] instead
      • all the file content fetching functions will happily return contents of a deleted file
      • the same is true for getfilelist
      • a deleted file cannot be recreated (dup val on unique index)

      a possible solution would involve using the 'expired' column as a counter:

      • PK is (name_hash, expired)
      • every time a file is deleted, its expired column is set to max(expired)+1
      • purge deletes all files where expired > 0
      • most (all?) functions that operate on the rows in the db use for selecting the combination name_hash, 0 so queries are not slower
        it makes deletions a bit slower (since it has to recover last expired vals)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              unknown unknown
              Reporter:
              gg Gaetano Giunta
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated: