4
votes

There are some threads on this subject already.. particularly this one

but is there any recommended solution to drop large graph other than batching..? I tried increasing timeout and it doesn't work

Below is the example..


gremlin> g.V().count()

==>5230885

gremlin> g.V().drop().iterate()

{"requestId":"77c64369-45fa-462f-91d7-5712e3308497","detailedMessage":"A timeout occurred within the script during evaluation of [RequestMessage{, requestId=77c64369-45fa-462f-91d7-5712e3308497, op='eval', processor='', args={gremlin=g.V().drop().iterate(), bindings={}, batchSize=64}}] - consider increasing the timeout","code":"TimeLimitExceededException"} Type ':help' or ':h' for help. Display stack trace? [yN]N

gremlin> g.E().count()

==>83330550

gremlin> :remote config timeout none

==>Remote timeout is disabled

gremlin> g.E().drop().iterate()

{"requestId":"d418fa03-72ce-4154-86d8-42225e4b9eca","detailedMessage":"A timeout occurred within the script during evaluation of [RequestMessage{, requestId=d418fa03-72ce-4154-86d8-42225e4b9eca, op='eval', processor='', args={gremlin=g.E().drop().iterate(), bindings={}, batchSize=64}}] - consider increasing the timeout","code":"TimeLimitExceededException"} Type ':help' or ':h' for help. Display stack trace? [yN]N

2

2 Answers

2
votes

You can increase the timeout of your neptune cluster by using the parameter group option neptune_query_timeout.

If using version 3.3.7 of the Java client, you can specify it for specific requests: Set Timeouts at a Per-Query Level

Hopefully soon you will be able to run:

g.with("scriptEvaluationTimeout", 600).V().drop()
2
votes

You have two options currently to drop an entire graph that is large. One option of course is to delete the current cluster and create a new one. To delete the existing graph the best approach is to use multiple threads that drop chunks of the graph in batches. I have been working on some Python code that can do just that. It is currently on a branch at this location.

https://github.com/awslabs/amazon-neptune-tools/tree/master/drop-graph

For a graph of the size you have the tool should work fine as is. It does have some limitations currently that are documented in the code.

I hope this helps. Kelvin