-
Bug
-
Resolution: Done
-
Major
-
None
-
None
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:
- 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)
- some other nodes will never found anymore until you are doing a reindex
Solution:
since it's not very harmful, you could just save permanently the counter while adding new nodes too:
@Override 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
- links to