Concurrent MergeV gremlingo - Vertex Id exists

If I use more than one go routine to update the gremlin server, so each has its own connection and traversal, then use MergeV using the gremlingo.T.Id as the merge match property set, I can occasionally get an error that "A vertex with id xxx-ssss-ssss-sss already exists". I have both Merge options specified. This makes me think that the server cannot support more than one concurrent MergeV to the same VertexId. Is that correct, or is there some configuration I should be doing to make them lock? A single threaded run works as expected.
5 Replies
spmallette
spmallette12mo ago
I think that the answer might be graph dependent. what graph database are you using with Gremlin Server?
Jim Idle
Jim Idle12mo ago
Sorry - should have been more specific, just the Tinkerpop Java gremlin server. I have yet to try that code on Neptune, which is the real target. This seems to come from the MergeV creating the actual vertex while a MergeV to create a place holder for a MergeE is also creating it. One of them wins then the other says that it already exists because I am specifying the vertex id. Probably the easiest solution might be for me to create all the vertices that will be targets of edges first. I can do that because I know what I am importing and can then avoid teh MergeV to create the edges.
spmallette
spmallette12mo ago
So for Gremlin Server with TinkerGraph I could see you having this problem. TinkerGraph isn't really good for multi-threaded writes right now so if two mergeV() hit at the same time, you can get some odd behavior and i think that goes for any mutation at all like addV(). We generally don't recommend that you write to TinkerGraph with multiple threads. This doesn't leave TinkerGraph without many production use cases, but this one isn't one of them. @valentyn_kahamlyk will there be any changes in behavior with respect to this scenario given that you are currently adding transactions to TinkerGraph?
Valentyn Kahamlyk
there is a change, but in the other direction. There should be an error for any attempt to change the same element in different transactions
Jim Idle
Jim Idle12mo ago
OK - no problem. I just needed to know that this was the case and not my code having some race condition that I was not detecting. I belive that Neptune is OK with this as it does seem to lock the vertices. This is part of a batch import program, which will move to generating batch import files for Neptune anyway. The TinkerGraph is just used to make local development a bit easier. Thanks for the information.
Want results from more Discord servers?
Add your server
More Posts
Help Needed with Sample Method in Gremlin-GoHello Apache TinkerPop Community, I'm currently working on a Go project using the Apache TinkerPop Is it possible to extract the requestId of an Amazon Neptune Gremlin query via gremlin-driver?Is there any way via gremlin-driver to extract the requestId of a completed query submitted to AmazoAggregating vertices with set-cardinality propertiesI am aggregating traversed vertices that have both single and set-cardinality properties. When captuAre the developers of TinkerPop interested in the Performance difference on the equivalent queries?Hi all! I was recently working on generating equivalent Gremlin queries to test TinkerGraph and thenGremlingo with Neptune - Read loop errorCode that works perfectly on my local TinkerPop Gremlin server, fails in a (to me right now anyway ;3.6.2 gremlin-server possible memory leakHas there been any memory leak reports in versions >=3.6.2? I just tracked down a memory leak that gremlin-go, MergeE, and NeptuneI couldn't find a good example for using the MergeE step without having the IDs of the vertices. I'vNo logs getting getting logged in log file for gremlin serverHello , This query is regarding the logs that I am not able to get while the janusgraph server starQuestion on macth stepI am wondering why the following queries return the different results: > gremlin> graph = TinkerFactWhat's the status amazon-neptune-sigv4-signer?amazon-neptune-sigv4-signer hasn't had a new release in 2 years, is it still part of the recommended