Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Index state never change to ENABLED on Titan with Amazon DynamoDB backend

I'm trying to use composite index on DynamoDB and the index never switches from from INSTALLED to REGISTERED state.

Here is the code I used to create it

        graph.tx().rollback(); //Never create new indexes while a transaction is active
        TitanManagement mgmt=graph.openManagement();
        PropertyKey propertyKey=getOrCreateIfNotExist(mgmt, "propertyKeyName");
        String indexName = makePropertyKeyIndexName(propertyKey);

        if (mgmt.getGraphIndex(indexName)==null) {
            mgmt.buildIndex(indexName, Vertex.class).addKey(propertyKey).buildCompositeIndex();
            mgmt.commit();
            graph.tx().commit();
            ManagementSystem.awaitGraphIndexStatus(graph, indexName).status(SchemaStatus.REGISTERED).call(); 
        }else {
            mgmt.rollback();
        }

A sample of the log is:

... ...

612775 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Some key(s) on index myIndex do not currently have status REGISTERED: type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Some key(s) on index typeIndex do not currently have status REGISTERED: type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Timed out (PT1M) while waiting for index typeIndex to converge on status REGISTERED

like image 624
Mohamed Taher Alrefaie Avatar asked Dec 05 '25 05:12

Mohamed Taher Alrefaie


1 Answers

Waiting for a longer time does the trick. Example:

ManagementSystem.awaitGraphIndexStatus(graph, propertyKeyIndexName)
                    .status(SchemaStatus.ENABLED)
                    .timeout(10, ChronoUnit.MINUTES) // set timeout to 10 min
                    .call();
like image 133
Mohamed Taher Alrefaie Avatar answered Dec 07 '25 21:12

Mohamed Taher Alrefaie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!