janusgraph icon indicating copy to clipboard operation
janusgraph copied to clipboard

Cassandra keyspace (storage.cassandra.keyspace) and (titan and titan-version)

Open rafatuita opened this issue 9 years ago • 7 comments

Trying to migrate my graph to JanusGraph, but apparently cassandra keyspace changed from titan to janusgraph, which makes sense, so I just updated the prop storage.cassandra.keyspace to titan so I could access my data as it was before, now it complains about janusgraph-version.. Some debugging indicated me that if I also provide "titan-version" it works, but I don't have that option as of now, so now what to do? Should I migrate (please don't tell me that) to a new janusgraph?

If I replace the following line https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/configuration/GraphDatabaseConfiguration.java#L1384 with:

globalWrite.get(new ConfigOption<String>(GRAPH_NS,"titan-version",
            "The version of JanusGraph with which this database was created. Automatically set on first start. Don't manually set this property.",
            ConfigOption.Type.FIXED, String.class).hide())

This is the error I'm getting with keyspace set to titan.

Caused by: java.lang.IllegalStateException: Need to set configuration value: root.graph.janusgraph-version
	at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
	at org.janusgraph.diskstorage.configuration.ConfigOption.get(ConfigOption.java:230) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
	at org.janusgraph.diskstorage.configuration.BasicConfiguration.get(BasicConfiguration.java:70) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
	at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1384) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
	at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:108) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
	at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:98) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
	at org.janusgraph.core.JanusGraphFactory$Builder.open(JanusGraphFactory.java:153) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]

Without keyspace to titan, it just seems to be an empty graph for obvious reasons.

rafatuita avatar Jan 30 '17 21:01 rafatuita

Thanks for the report and sorry for the trouble! That looks like a bug in JanusGraph.

As part of the migration from the name Titan to JanusGraph, we replaced all code and constances from titan-* to janusgraph-* but we did not set compatible versions, so we need to update GraphDatabaseConfiguration.java as well as JanusGraphConstants.java to do the following:

  • allow titan-version as a valid configuration key for backwards-compatibility with Titan
  • allow janusgraph-version as a valid config key for folks who start with JanusGraph
  • set up compatible versions both for Titan 1.0 as well as JanusGraph 0.1.0-SNAPSHOT

If you're up for making these changes, we'd love to accept your contribution! Otherwise, we'll need someone to pick this up to fix this issue.

mbrukman avatar Jan 30 '17 21:01 mbrukman

Sure, I'll pick it up tomorrow and send a fix

rafatuita avatar Jan 30 '17 23:01 rafatuita

@rafatuita — thanks!

Please note that we'll need you (or an authorized officer of your company) to sign either the ICLA or CCLA, as appropriate, before we can accept any contributions.

mbrukman avatar Jan 31 '17 00:01 mbrukman

got the fix ready, the approach I took was to go first on JanusGraph version, try/catch for the exception and look or a compatibility with titan and their versions, so it always tries janus first, if fails, go compatible check.

janusgraph.compatible.versions are stored on main pom.xmlfile, so I just added titan.backward.compatible.versions with those IDs 1.0.0,1.1.0-SNAPSHOT.

Since this is just a compatibility issue, didn't see a reason to work on this https://github.com/JanusGraph/janusgraph/blob/ec441ac6d87f3359c9740075786ec6de3651745e/janusgraph-dist/src/release/release.sh

let me know your thoughts.

rafatuita avatar Jan 31 '17 17:01 rafatuita

@rafatuita good work on this one, can we close it out at this point?

twilmes avatar Mar 26 '17 16:03 twilmes

@twilmes sure, you can close it by now.

rafatuita avatar Mar 27 '17 13:03 rafatuita

Thanks @rafatuita. Closing as fixed by #80.

twilmes avatar Mar 31 '17 19:03 twilmes