2 Replies Latest reply on Sep 20, 2016 10:26 AM by Antoine Mischler

    [Modeshape 4.6.0.Final] System node corruption after application crash

    Antoine Mischler Newbie

      Hi,

       

      We are using Modeshape as an embedded database for a desktop application. Our application is configured with a file based Infinispan cache.

       

      Regularly some databases get corrupted after an application crash. Modeshape is still able to read the Infinispan cache, but in most cases the system node is corrupted or inconsistent. We are able to fix the databases by forcing Modeshape to create a backup of this repository and then we manually edit the generated bin file to restore the missing system nodes (usually the { "id" : "e03bade317f1e7mode:namespaces" } node or other system nodes). The rest of the database seems to be fine.

       

      Do you know how this issue might happen and how we could prevent this situation to happen when the application crashes ?

       

      We use Modeshape 4.6.0.Final and the following configuration :

       

      modeshape.json

       

      {

        "name": "dsdk-repository",
        "workspaces": {

         "default": "default",
         "allowCreation": true
        },
        "security": {

         "anonymous": {

         "roles": [

         "readonly",
         "readwrite",
         "admin"
         ],
         "useOnFailedLogin": false
         }

        },
        "storage": {

         "cacheConfiguration": "infinispan-configuration.xml",
         "cacheName": "persisted-repository",
         "binaryStorage": {

         "type": "file",
         "directory": "${application.workspace}/binaries",
         "minimumBinarySizeInBytes": 999
         }

        },
        "node-types": [

         "cnd/dsdk.cnd"
        ],
        "indexProviders": {

         "local": {

         "classname": "org.modeshape.jcr.index.local.LocalIndexProvider",
         "directory": "${application.workspace}/indexes"
         }

        },
        "indexes": {

         "smartTextKeys": {

         "kind": "value",
         "provider": "local",
         "synchronous": "true",
         "nodeType": "dsdk:smarttext",
         "columns": "smartTextKey(STRING)"
         },
         "nodesByName": {

         "kind": "value",
         "provider": "local",
         "synchronous": "true",
         "nodeType": "nt:base",
         "columns": "name(STRING)"
         },
         "nodeTypes": {

         "kind": "nodeType",
         "provider": "local",
         "synchronous": "true",
         "nodeType": "nt:base",
         "columns": "jcr:primaryType(STRING)"
         },
         "nodesByPath": {

         "kind": "value",
         "provider": "local",
         "synchronous": "true",
         "nodeType": "nt:base",
         "columns": "jcr:path(PATH)"
         },
         "deletedNodes": {

         "kind": "nodeType",
         "provider": "local",
         "synchronous": "true",
         "nodeType": "mix:deleted",
         "columns": "jcr:mixinTypes(STRING)"
         }

        },
        "sequencing": {

         "sequencers": {

         "JPEG optimization sequencer": {

         "classname": "com.dooapp.dsdk.core.ui.document.optim.JpegOptimSequencer"
         },
         "Image resizer sequencer": {

         "classname": "com.dooapp.dsdk.core.ui.document.optim.ImageResizerSequencer"
         }

        }

        }

      }

       

      infinispan-configuration.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan xmlns="urn:infinispan:config:7.2">

        <cache-container default-cache="persisted-repository" shutdown-hook="REGISTER">
        <jmx duplicate-domains="true"></jmx>
        <local-cache name="persisted-repository">
        <transaction transaction-manager-lookup="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
         mode="NON_XA"
         locking="PESSIMISTIC"/>
        <persistence passivation="false">
        <file-store shared="false"
         preload="false"
         fetch-state="false"
         purge="false"
         path="${application.workspace}/content">
        </file-store>

        </persistence>
        </local-cache>

        </cache-container>

      </infinispan>

       

      Thanks for your help!