Can't change the state of index from INSTALLED to ENABLED or DISABLED #3195
-
Hello everyone, We are using cassandra and ElasticSearch for our mixed storage back-ends. We want to disable an old index that will be replaced with a new index. However, whatever I did, the status of the index doesn't change from INSTALLED to DISABLED. In the docs, it says that the index state can go from INSTALLED to DISABLED, but I couldn't manage it. Here is the code that I'm using to disable the index: JanusGraphManagement m = graph.openManagement();
JanusGraphIndex oldIndex = m.getGraphIndex(oldIndexName);
m.updateIndex(oldIndex, SchemaAction.DISABLE_INDEX).get();
m.commit();
graph.tx().commit();
GraphIndexStatusReport call = awaitGraphIndexStatus(graph, oldIndexName).status(SchemaStatus.DISABLED).call();
System.out.println(call); It waits of https://gist.github.com/fatihdogmus/fc0eae8f2eae7d9c973b4ff76f219064 (Since it is too long, I pasted it into a gist) I don't know what the problem is. I followed the documentation to the minute, but the index can't be DISABLED or ENABLED and the output doesn't give any information about why. Would appreciate a lot if anyone can help. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@fatihdogmus await waits for all current nodes to receive an index updates. Sometimes there could be ghost nodes (previous JanusGraph nodes which are now dead). If that happens you need to force clean those nodes. Moreover, you need to ensure that your management transaction is the only opened management transaction for the current JanusGraph instance. In short, what you need to do is:
Most likely you have ghost instances which you need to cleanup.
In case you are deploying JanusGraph nodes in a system where their hostnames may change from time to time (due to re-deploys. Let's say you configured Kubernetes which may assign JanusGraph to a new pod during any redeployment), then it's better to ensure that your instance id doesn't change (use stateful set or some fixed identifiers). Otherwise you may end up with new ghost instances after such redeployments.
When you are sure you don't have ghost instances and ghost management transactions, you can try to disable your index again. |
Beta Was this translation helpful? Give feedback.
-
Hello @porunov Thank you very much for your response! It was open management transactions. When I commit all of them, it can change the index state, but in a broken way, since right now I can't detect which are stale management transactions. Can you give me some pointers what I should do to detect if a transaction is stale? I looked through the documentation and the class code and properties, but there doesn't seem be a way to detect if it is still. Would love some pointers. Just some place to start or a documentation would be more than enough to get me started. |
Beta Was this translation helpful? Give feedback.
-
Hello there, Based on @porunov's response on this thread we tried below steps:
This actually moved index to INSTALLED state instead of DISABLED (from ENABLED) Please note that I am working on a Mixed Index Here is bit about our overall goal: We are currently trying to create new Mixed index & Disable the existing one |
Beta Was this translation helpful? Give feedback.
@fatihdogmus await waits for all current nodes to receive an index updates. Sometimes there could be ghost nodes (previous JanusGraph nodes which are now dead). If that happens you need to force clean those nodes. Moreover, you need to ensure that your management transaction is the only opened management transaction for the current JanusGraph instance.
We should probably add that into documentation but for now you can check out this post: https://developer.ibm.com/articles/janusgraph-tips-and-tricks-pt-2/
In short, what you need to do is: