Reported by Rouben:
Start an anzo instance w/ hsql node centric backend.
Add some new triples (foaf data works well)
Run a text index query, the triples should show up.
Cycle the anzo instance
Search for the triples again
Here an error occurs:
ERROR [http://openanzo.org/service/CombusQueryServiceListener] (BaseServiceListener.java:332) - Exception while ServiceListener [http://openanzo.org/serviceContainer/component/CombusQueryServiceListener] was precessing request.
org.openanzo.glitter.exception.GlitterException: ErrorCode[4096:524289] [GLITTER_ERROR]
at org.openanzo.server.repository.query.predicates.TextMatchPredicate.generateSolutions(TextMatchPredicate.java:155)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveFP(SerialInMemoryNodeSolver.java:291)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveBGP(SerialInMemoryNodeSolver.java:276)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveNode(SerialInMemoryNodeSolver.java:69)
at org.openanzo.glitter.query.SerialQueryExecutor.solveNode(SerialQueryExecutor.java:119)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.conjoinAnswers(SerialInMemoryNodeSolver.java:337)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveGroup(SerialInMemoryNodeSolver.java:257)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveNode(SerialInMemoryNodeSolver.java:72)
at org.openanzo.glitter.query.SerialQueryExecutor.solveNode(SerialQueryExecutor.java:119)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveGraph(SerialInMemoryNodeSolver.java:114)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveNode(SerialInMemoryNodeSolver.java:81)
at org.openanzo.glitter.query.SerialQueryExecutor.solveNode(SerialQueryExecutor.java:119)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.conjoinAnswers(SerialInMemoryNodeSolver.java:337)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveGroup(SerialInMemoryNodeSolver.java:257)
at org.openanzo.glitter.query.SerialInMemoryNodeSolver.solveNode(SerialInMemoryNodeSolver.java:72)
at org.openanzo.glitter.query.SerialQueryExecutor.solveNode(SerialQueryExecutor.java:119)
at org.openanzo.glitter.query.SerialQueryExecutor.executeQuery(SerialQueryExecutor.java:71)
at org.openanzo.glitter.Engine.executeQuery(Engine.java:688)
at org.openanzo.glitter.Engine._query(Engine.java:595)
at org.openanzo.glitter.Engine.executeQuery(Engine.java:452)
at org.openanzo.server.repository.rdb.services.NodeCentricQueryService.executeQueryInternal(NodeCentricQueryService.java:218)
at org.openanzo.server.services.impl.BaseQueryService.query(BaseQueryService.java:79)
at org.openanzo.server.services.impl.BaseQueryService.query(BaseQueryService.java:61)
at org.openanzo.server.endpoint.combus.CombusQueryServiceListener.handleMessage(CombusQueryServiceListener.java:161)
at org.openanzo.server.endpoint.combus.BaseServiceListener$ProcessThread.run(BaseServiceListener.java:277)
Caused by: org.openanzo.common.exceptions.AnzoException: ErrorCode[96:4097] [SERVICE_CONTAINER] [BACKEND_ERROR] NamedGraph [http://cambridgesemantics.com/mojo/1.0/Action] not found
at org.openanzo.server.repository.rdb.services.NodeCentricAuthorizationService.getRolesForGraphInternal(NodeCentricAuthorizationService.java:137)
at org.openanzo.server.services.impl.BaseAuthorizationService.getRolesForGraph(BaseAuthorizationService.java:102)
at org.openanzo.server.services.impl.BaseAuthorizationService.getRolesForGraph(BaseAuthorizationService.java:115)
at org.openanzo.servicecontainer.services.proxy.cache.CachedAuthorizationService.getRolesForGraph(CachedAuthorizationService.java:105)
at org.openanzo.server.repository.rdb.services.NodeCentricIndexService.processResultToWrapper(NodeCentricIndexService.java:306)
at org.openanzo.server.repository.rdb.services.NodeCentricIndexService.executeIndexQueryInternal(NodeCentricIndexService.java:246)
at org.openanzo.server.repository.query.predicates.TextMatchPredicate.generateSolutions(TextMatchPredicate.java:153)
... 24 more
This is because when the anzo instance is cycled, it does not reset in the same way a reset occurs when called from an anzo client. Instead, the node centric backend calls resetDatabase, which repopulates the backend with the reset files specified in the service config, but does not call any of the normal service container reset methods.
I've found a fix that is based on the idea that there are two kinds of reset within the system:
explicit global reset
implicit initialization of a backend
The second type happens when a backend starts up and realizes it is not initialized. At this point is reads its 'reset' files and resets all it's data according to these files.
The fix is to also reset the index for that backend when the backend performs an implicit initialization.