Registering/deleting relation index fails

44 views
Skip to first unread message

Benoit George

unread,
Feb 10, 2020, 1:35:12 PM2/10/20
to JanusGraph users
Hello everyone,

I am currently trying to add a new relation index to a janusgraph instance (~1M nodes / edges)
This relation index is created with the following commands

graph.tx().rollback()

mgmt = graph.openManagement()
timestamp = mgmt.getPropertyKey('timestamp') // property timestamp already exist and some vertices already have this property
edgeLabel = mgmt.getEdgeLabel('edgeLabel') // edge label edgeLabel already exist and some edges already have this label
idx_edge=mgmt.buildEdgeIndex(edgeLabel, 'indexEdge', Direction.BOTH, Order.decr, timestamp)
mgmt.commit()

ManagementSystem.awaitRelationIndexStatus(graph, 'indexEdge', 'edgeLabel').call()

And this is where the troubles come. The index is stuck on INSTALLED. The last command gives me this error:

> RelationIndexStatusReport[succeeded=false, indexName='indexEdge', relationTypeName='edgeLabel', actualStatus=INSTALLED, targetStatus=[REGISTERED], elapsed=PT1M0.085S]

I made sure to rollback every open transaction and close any open instances before executing this query.

Do you know how this problem could be solved? 
If I'm not mistaken, the number of already existing edges having the label 'edgeLabel' and the timestamp property should not impact the passage of the index from INSTALLED to REGISTERED, no?

Then, I figured that I should try deleting this index to try to install it fresh. Other problems appeared!
I wanted to first disable it then remove it.
I disabled it with 

mgmt = graph.openManagement()
rindex = mgmt.getRelationIndex(mgmt.getRelationType('edgeLabel'), 'indexEdge')
mgmt.updateIndex(rindex, SchemaAction.DISABLE_INDEX).get()
mgmt.commit()

ManagementSystem.awaitRelationIndexStatus(graph, 'indexEdgeSlaveUpp', 'SLAVE_TREE->UPP').status(SchemaStatus.DISABLED).call()

which worked fine.

However, the actual delete step

mgmt = graph.openManagement()
i = mgmt.getRelationIndex(mgmt.getRelationType('SLAVE_TREE->UPP'), 'indexEdgeSlaveUpp')
mgmt.updateIndex(i, SchemaAction.REMOVE_INDEX)
mgmt.commit()
graph.tx().commit()

is executed without error nor exception

810160 [Thread-17] INFO  org.janusgraph.graphdb.olap.job.IndexRepairJob  - Found index indexEdge
810335 [Thread-19] INFO  org.janusgraph.graphdb.olap.job.IndexRepairJob  - Found index indexEdge
810445 [Thread-17] INFO  org.janusgraph.graphdb.database.management.ManagementSystem  - Index update job successful for [indexEdge[edgeLabel]]

but 

mgmt.printSchema()

shows that the index is still here and in the DISABLED state

Do you know what could be the cause of this?

Thanks in advance.

# Janusgraph 0.3.2 on Cassandra

Benoit George

unread,
Feb 18, 2020, 8:50:18 AM2/18/20
to JanusGraph users
Sorry for the spam, I did not correctly closed the JanusGraph instance other than the one I was working on!

Running

graph.getOpenTransactions().forEach { tx -> tx.rollback() }

mgmt = graph.openManagement()
mgmt.getOpenInstances() 
mgmt.getOpenInstances().forEach {
  if (it.reverse().take(1) != ")") {
mgmt.forceCloseInstance(it)
  }
}
mgmt.commit()

before messing with the indices did the trick.
Reply all
Reply to author
Forward
0 new messages