1

I'm trying to use Gremlin sessions with Amazon Neptune. I can execute bytecode queries fine outside of a session, and I can run string queries on a sessioned client, but attempting to run a bytecode query with a sessioned client results in this error:

"code":"MalformedQueryException",
"detailedMessage":"Message with op code [bytecode] is not recognized."

I've followed the AWS documentation exactly.

Cluster cluster = Cluster.build().with {
    addContactPoint('host')
    port(8182)
    enableSsl(true)
    serializer(Serializers.GRAPHBINARY_V1D0)
    create()
}

def client = cluster.connect('session ID')

println client.submit('g.V()').all().get() // works

println traversal().withRemote(DriverRemoteConnection.using(client))
    .V().iterate() // returns the error above

println traversal().withRemote(DriverRemoteConnection.using(cluster))
    .V().iterate() // works, without a session

I'm using Gremlin 3.4.8. How do I get this working?

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152

1 Answers1

1

Bytecode based requests are simply not supported in Neptune (or even Gremlin Server itself as the reference implementation). The primary reason for this disparity is that TinkerPop has not wanted to promote the use of sessions any further than it was already in use. TinkerPop largely constructed sessions for the narrow use case of tool support - e.g. Gremlin Console remote connectivity, visualization toolkits and graph analysis tools. However, given the weak support for remote multi-request transactional use cases in Gremlin, users have expanded on session usage as a way to work around that weakness.

I sense that this expansion will perhaps force TinkerPop to provide bytecode support in sessions, but nothing is decided as of this time. The alternative would be to improve support for transactions, but that may be impossible within the scope of TinkerPop 3.x given the nature of such a change.

For now, if you wish to use sessions, you can only submit scripts.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • So... TinkerPop is actively pushing users toward the less safe and less efficient model because the PMC has decided that transactional semantics aren't important for databases? – chrylis -cautiouslyoptimistic- Dec 09 '20 at 17:52
  • ha - well, that's a dark way to frame it and that's not the right way to take what i said. first, it typically isn't less efficient than sessionless calls (perhaps the opposite is even true). second, no one declared transactional semantics unimportant - there are actually quite strong (though simple) transactional semantics for sessionless calls (one request is simply one transaction). – stephen mallette Dec 09 '20 at 18:23
  • 1
    like any mature software, there is a history of decisions and i'd say that this particular issue has a lot of factors to examine in understanding how we got to where we are. little of that matters to users today i suspect so i won't try to explain it all. the important thing to know is that we realize the inconsistency and hope to come up with a better handling of it going forward. i hope that helps clarify things. – stephen mallette Dec 09 '20 at 18:28
  • edited my answer slightly to confine my "weak" wording a bit to the specific case where it is a problem so that it not be taken as a reflection of the whole. – stephen mallette Dec 09 '20 at 18:35