Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update action [REINDEX] cannot be invoked for index with status [INSTALLED]

I am following this blog: https://developer.ibm.com/dwblog/2018/janusgraph-composite-mixed-indexes-traversals/

code:

gremlin> graph.tx().rollback()
==>null
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@19472803
gremlin> code = mgmt.getPropertyKey('code')
==>code
gremlin> mgmt.buildIndex('byCodeComposite', Vertex.class).addKey(code).buildCompositeIndex()
==>byCodeComposite
gremlin> mgmt.commit()
==>null
gremlin> mgmt.awaitGraphIndexStatus(graph, 'byCodeComposite').call()
==>GraphIndexStatusReport[success=False, indexName='byCodeComposite', targetStatus=[REGISTERED], notConverged={}, converged={code=REGISTERED}, elapsed=PT0.012S]

ERROR:

But i am getting this: ==>GraphIndexStatusReport[success=false, indexName='byCodeComposite', targetStatus=[REGISTERED], notConverged={code=INSTALLED}, converged={}, elapsed=PT1M0.413S]

Versions: Cassandra: 3.11.3 elasticsearch: 6.5.4 janusgraph: 0.3.1-hadoop2

I am trying to solve this but it is not working for me.

like image 222
Arayan Singh Avatar asked Jan 21 '19 09:01

Arayan Singh


People also ask

What happens when I update my index?

This operation takes your index offline for at least a few seconds, causing your indexing and query requests to fail. Performance and write availability of the index can be impaired for several minutes after the index is updated, or longer for indexes. Required. Set this to the unique, user-defined name of your search service.

What happens if I rebuild the content index?

Note that rebuilding the content index may cause high CPU utilization on the server. If you have any concerns about performance impact you should perform this work at an off-peak time for your customer. First, stop the search services on the server.

Where can I find the API key for indexing in azure?

You can find the API key in your search service dashboard in the Azure portal. The request body syntax is the same as for Create Index. When updating an existing index, the body must include the original schema definition, plus the new fields you are adding, as well as the modified scoring profiles and CORS options, if any.

How do I make an Azure service update Index request?

The Update Index request must include an api-key header set to your admin key (as opposed to a query key). You will also need the service name to construct the request URL. You can get the service name and api-key from your service dashboard in the Azure portal.


1 Answers

Sorry you're having trouble following along with the blog.

One thing I'm noticing that probably isn't causing this error, but might cause other issues is that the versions of Cassandra and ES you're using aren't in the compatibility matrix for 0.3.1.

Outside of that here are some troubleshooting tips for indexes I wrote up last year and never got around to publishing. Hopefully it helps solve your issue. Maybe I'll get around to posting the rest of the article in the near future.

Troubleshooting Indexes:

When creating an index if there are any stale management sessions or open transactions they index might get stuck in the INSTALLED state. If you are unfamiliar with the lifecycle of a JanusGraph index there is a JanusGraph wiki pages that diagrams the index states and lifecycle

gremlin> graph.getOpenTransactions()
==>standardjanusgraphtx[0x14ba9376]
==>standardjanusgraphtx[0x477aaf55]

To rollback all the transactions you can ran the command below until they're all rolled back or you could write a loop to run it the correct number of times. I personally prefer pressing up and enter a few times over the extra typing.

graph.getOpenTransactions().getAt(0).rollback()

To see if there are any stale management instances you can run the getOpenInstances() method. This is also documented in the failure and recovery section of the JanusGraph docs. If you see multiple management instances open, you can use the forceCloseInstance method as shown below.

gremlin> mgmt = graph.openManagement()
gremlin> mgmt.getOpenInstances()
==>0934f2eb69223-Chriss-MacBook-Pro-2-local2
==>0729845962091-remoteMachine1
gremlin> mgmt.forceCloseInstance('0729845962091-remoteMachine1') 
gremlin> mgmt.commit()
like image 182
Chris Hupman Avatar answered Sep 25 '22 17:09

Chris Hupman