The Open Anzo Project

Semantic Application Middleware

Ticket #277 (closed defect: fixed)

Opened 9 months ago

Last modified 8 months ago

clear indexer when node centric backend clears it's database

Reported by: jpbetz Assigned to: mroy
Priority: minor Milestone: 3.0 milestone2
Component: openanzo Version: 3.0
Keywords: index lucene reset initialize Cc: rouben

Description (Last modified by mroy)

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.

Change History

04/11/08 15:44:27 changed by jpbetz

(In [2079]) re #277 reviewer: mroy

Add index reset to implicit initialization of node centric backend. Improve ldap solution generator performance by avoiding unneeded ldap query.

04/11/08 15:50:02 changed by jpbetz

  • owner changed from jpbetz to mroy.

reassigning to Matt for review and closure.

04/29/08 13:24:26 changed by mroy

  • status changed from new to closed.
  • resolution set to fixed.
  • description changed.
Copyright © 2007 - 2008 OpenAnzo.org