1 Reply Latest reply on Jul 6, 2015 10:28 AM by Horia Chiorean

    Why is deleted nt:file is not moved to trash directory?

    Jochen Kraushaar Newbie

      Hi there,

       

      we are using ModeShape 4.2.0 to store files and folders with versioning. We use the FileSystemBinaryStore to store the binaries of the files.

       

      When I delete a nt:file node, the associated binary is not moved to the trash directory and hence not removed by the garbage collection thread.

       

      Is it because of the active versioning on the parent folder node?

       

      Thanks

      Jochen

        • 1. Re: Why is deleted nt:file is not moved to trash directory?
          Horia Chiorean Master

          When you delete a node from the repository which references a binary value, the only thing that happens immediately is that the reference count for that binary value is decremented. If that reference count reaches 0, the binary is marked as unused. This means creating a 0 sized file with the same name and key as the binary in the /trash folder.

          The actual deletion of the binary content however, happens only when the binary garbage collection thread runs and only *if that binary has been unused for more than the configured time amount*.  You can read more about binary values here: Binary values - ModeShape 4 - Project Documentation Editor

          Is it because of the active versioning on the parent folder node?

          If you're versioning nodes which have binary properties, it's very likely that you have multiple references from all the different versions towards the same binary, meaning that even if you delete a node/version there will be others in the system area (other older versions) which refer to the same binary. You can try to remove all the versions of a node to see if that helps. You should also remember that depending on you node structure, when versioning a parent node you will actually version *the entire hierarchy under that parent*, unless you've explicitly configured your node types not to.