Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2681

When ModeShape get killed the Index-Counter is '0'


    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.4.1.Final
    • Component/s: Indexing
    • Labels:


      We had some issues with our indices. We could find out, that the problems always appears after the ModeShape-Server was killed by someone.

      In the LocalDuplicateIndex-class you are using a counter for the key-map.
      Sadly the counter will only saved permanently, when the server steps into the shutdown-method. If the server gets killed, then the counter won't be saved and after the restart the Server will start counting at '0'.
      This leads to some issues:

      1. familiar nodes will be replaced if the counter matches (e.g. NodeType A on the counter 2 will be replaced by a diffrent NodeType A if the counter ist at 2 after restart)
      2. some other nodes will never found anymore until you are doing a reindex

      since it's not very harmful, you could just save permanently the counter while adding new nodes too:

          public void add( String nodeKey,
                           String propertyName, 
                           T value ) {
              logger.trace("Adding node '{0}' to '{1}' index with value '{2}'", nodeKey, name, value);
              keysByValue.put(new UniqueKey<T>(value, counter.getAndIncrement()), nodeKey);
      // Store the value of the next counter in the options map ...
              options.put(NEXT_COUNTER, counter.get());

      Maybe we can provide a pull request later this day

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  hchiorean Horia Chiorean
                  x-out X-out portal
                • Votes:
                  0 Vote for this issue
                  2 Start watching this issue


                  • Created: