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

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 3.10.0, 4.0.0
    • Legacy > Clustering
    • 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

        Activity

          People

            unknown unknown
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: