Kennh
Kennh
ATApache TinkerPop
Created by Memo on 10/16/2024 in #questions
Basic vertex querying does not work in Amazon Neptune but it works with local Gremlin Server
The gremlin-javascript driver deserializes the elementMap() step into the Map class. await this.gremlinService.readClientSource.V().elementMap().toList() will return an Array of Maps. JSON.stringify() , which NestJS is likely calling for you, doesn't support Maps so you need to convert them into objects using something like Object.fromEntries().
9 replies
ATApache TinkerPop
Created by red on 10/14/2024 in #questions
Naming multiple vertices
I'm not sure there is a way to do this in just pure gremlin without needing some sort of lambda. I don't know of a way to iterate two collections at the same time or select from a list using its order index. Any ideas @spmallette ?
9 replies
ATApache TinkerPop
Created by e8l on 9/27/2024 in #questions
[Bug?] gremlinpython is hanged up or not recovering connection after connection error has occurred
9 replies
ATApache TinkerPop
Created by criminosis on 10/1/2024 in #questions
Tinkerpop Server OOM
I guess are next steps to write up an issue report on the Jira after making an account
Yea, that would be good for tracking.
I wouldn't be opposed to taking a stab at trying to fix it either assuming my theory is correct that we're missing a listener removal for the happy path to remove the cancelation future.
We're always looking for contributions so that would be great. That being said, I'm a bit concerned about this particular issue though since the channel holding references to results definitely shouldn't be happening. Might require a bigger change to properly fix it, which might not be worth doing at this point.
17 replies
ATApache TinkerPop
Created by e8l on 9/27/2024 in #questions
[Bug?] gremlinpython is hanged up or not recovering connection after connection error has occurred
What you're noticing here kind of boils down to how connection pooling works in gremlin-python. The pool is really just a queue that the connection adds itself back to after either an error or a success but it's missing some handling for the scenarios you pointed out. One of the main issues is that the pool itself can't determine if a connection is healthy or if it unhealthy and should be removed from the pool. I think you should go ahead and make a Jira for this. If it's easier for you, I can help you make one that references this post. I think the only workaround right now is to occasionally open a new Client to create a new pool of connections when you notice some of those exceptions.
9 replies
ATApache TinkerPop
Created by criminosis on 10/1/2024 in #questions
Tinkerpop Server OOM
Sorry for the delayed response. I'll try to take a look at this soon. But for now, I just wanted to point out that SingleTaskSession and the like are part of the UnifiedChannelizer. From what I remember, the UnifiedChannelizer isn't quite production ready, and in fact is being removed in the next major version of TinkerPop. We can certainly still make bug/performance fixes to this part of the code for 3.7.x though.
17 replies
ATApache TinkerPop
Created by Balan on 8/23/2024 in #questions
How can we extract values only
If I understand this correctly, you are first trying to take the result of a gremlin query that returns Latitude and Longitude (like in the initial post you made), and use those values in the in the math() step that calculates the Haversine formula (your latest post). If that is the case, you have two options. 1. You should combine this into one Gremlin query. You can save the results of the Latitude and Longitude to variables or use them in a by() modulator to the math step. Assuming that those values are properties on a vertex called 'lat' and 'lon' it would look something like g.V().project('Latitude', 'Longitude').by('lat').by('lon').math(...). You would replace the ... in the math() step with the Haversine formula. 2. If you want to keep these as two separate queries, then you should use one of the Gremlin Languages Variants (GLVs) which are essentially drivers that will automatically deserialize the result into the appropriate type so you don't have to deal with the GraphSON (which is what your initial post shows). Read triggan's answer above for more details about that.
9 replies
ATApache TinkerPop
Created by Max on 9/3/2024 in #questions
Gremlin query to order vertices with some locked to specific positions
I don't think there is that sort of fine-grained control over traversal iteration order or collection order. Do you have any ideas @spmallette ?
18 replies
ATApache TinkerPop
Created by Memo on 8/27/2024 in #questions
Query works when executed in console but not in javascript
Is this problem specific to this query? If you run a simple query like g.V().count().next() do you see incorrect results as well?
3 replies
ATApache TinkerPop
Created by Balan on 8/23/2024 in #questions
How can we extract values only
Could you clarify what you mean by "only values". What is the query you are running now? Or are you saying that you don't want the "@type" information and you only want the "@value", in which case you are going to want to use the untyped serializer like "GraphSONUntypedMessageSerializerV1". The HTTP accept header for such a request would be "application/vnd.gremlin-v1.0+json;types=false"
9 replies
ATApache TinkerPop
Created by b4lls4ck on 8/22/2024 in #questions
How to speed up gremlin query
This seems like a JanusGraph-specific performance question so you may be able to get more help by asking in the JanusGraph Discord. For TinkerPop in general though, I'd start with the profile() step. It'll let you know which step is taking the most time and I believe JanusGraph returns some index details in there as well. That information could probably be used as a starting point to help you tweak your indices.
6 replies
ATApache TinkerPop
Created by criminosis on 7/27/2024 in #questions
op_traversal P98 Spikes
There could potentially be lots of different causes for this as there are a lot of pieces in the scenario you laid out. Something worth investigating is whether transactions are causing a slowdown. JanusGraph itself has different options for transactional behavior. I'm not that familiar with JanusGraph, but I believe it has different locking mechanisms based on the storage backend being used.
9 replies
ATApache TinkerPop
Created by Limosin18 on 7/3/2024 in #questions
Optimising python-gremlin for fastApi
Yea, the thread you mentioned has some good information that is relevant to your question. The gremlin-python module currently isn't async which is why it blocks. There is an open JIRA about adding full async support, https://issues.apache.org/jira/browse/TINKERPOP-2774 , you can see that there are others that use FastAPI that have run into similar situations and have had similar questions. Feel free to leave a comment in that JIRA if you are interested in seeing full async support. In any case, following the advice from the thread you linked will probably lead to the highest RPS you can have for now until TINKERPOP-2774 is implemented. Would you consider your question solved for now?
4 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
I've looked into your real use case a little closer and I don't think there's a workaround at this time. Side note, you should end your traversals with a terminating step like iterate() or else they don't do anything. So your query should actually be gtx.addV().property('name', 'test1').property('age', 11).iterate(). The error you are seeing with "This AuthorizationHandler..." occurs after the transaction attempts to commit so it shouldn't actually prevent the commit from occurring. The real problem you will encounter is a different server issue that Lyndon was alluding to earlier. The problem is that the authorization handler on the server is accidentally converting the request from the client from a session request (which is used for transactions on the server side) to a regular request. Lyndon actually has a proposed fix for this https://github.com/apache/tinkerpop/pull/2622/files . This fix should go into the next release, but I'm not sure when that release will happen. Lately, there has been a quarterly release cadence so it hopefully shouldn't be too far off.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
This is caused by a bug in the server. The auth handler doesn't properly take care of the "close" request sent from the driver (which the Console uses internally). If you're interested, this is the line that causes it https://github.com/apache/tinkerpop/blob/3.7.0/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WebSocketAuthorizationHandler.java#L83 . It's a bit more complicated than simply adding support for it in the auth handler because the "close" request was supposed to be have deprecated back in 3.3.11 but it was brought back into the driver after. I guess I'm trying to say there isn't actually a simple and complete fix even though the cause of the issue is obvious. If you need to use sessions directly, then I don't think there are any current workarounds. However, it sounds like you just want to use transactions, depending on how you use transactions, and whether your rely on autocommit/autorollback, we might be able to find a workaround.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
Sorry, it looks like no one's had a chance to look into this yet. I'll try to reproduce this issue tomorrow and get back to you with some more detailed information. Thanks for providing such a detailed repro case.
12 replies
ATApache TinkerPop
Created by RuS2m on 6/1/2024 in #questions
Analyzing samples of Gremlin Queries in Neptune Notebook
I'm not familiar with trying to figure out which portion of the graph is most frequently used based on the Gremlin queries issued against it. There might be some Neptune-specific functionality that can help as well. Does anyone from @neptune have any insights that could help?
9 replies
ATApache TinkerPop
Created by gdotv on 2/23/2024 in #questions
Configuring Websockets connection to pass through a proxy server
As far as I can tell, gremlin-driver doesn't have support for SOCKS proxies right now. gremlin-driver uses netty as its client library so you would need to add a SOCKS proxy handler to the netty pipeline to support this. Adding something like the Socks4ProxyHandler to https://github.com/apache/tinkerpop/blob/master/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Channelizer.java#L189 might work.
13 replies
ATApache TinkerPop
Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
If that is the case, then I think the blog that was linked earlier (https://aws.amazon.com/blogs/database/automated-testing-of-amazon-neptune-data-access-with-apache-tinkerpop-gremlin/) probably has the best setup for now. Its example show how you can use GremlinServer with TinkerGraph in a docker container as a test double for Neptune. Since it seems like you are using Java, you actually have a simpler option which is to just include tinkergraph-gremlin as a test dependency and run your queries directly against a local instance of TinkerGraph. As always, you'll want to keep in mind provider specific differences which are outlined for Neptune here https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html
7 replies
ATApache TinkerPop
Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
Could you explain a little more in-depth the type of testing that you are doing? Is this something you want to run fairly often (per commit) or something that is run closer to releases?
7 replies