Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
errors on delete
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 29 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Yaron Naveh  
View profile  
 More options Jun 23 2012, 2:04 pm
From: Yaron Naveh <yaron...@gmail.com>
Date: Sat, 23 Jun 2012 11:04:33 -0700 (PDT)
Local: Sat, Jun 23 2012 2:04 pm
Subject: errors on delete

Hi

I'm using neo4j 1.8 using node-neo4j (which uses the REST api of neo4j).

I need to delete 100 nodes. When I do this synchronously there is no
problem (e.g. I wait for one delete to finish before calling the next one).
When I delete them in an async manner (many rest requests sent
concurrently) I intermittently get a few failures. I see this coming back
in the http response once per each error:

HTTP/1.1 500 Transaction(15744)[STATUS_ACTIVE,Resources=1] can't wait on
resource RWLock[Relationship[8253]] since =>
Transaction(15744)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]-
RWLock[Node[1841]] <-[:WAITING_FOR]-
Transaction(15744)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]-
RWLock[Relationship[8253]]
Content-Length: 0
Server: Jetty(6.1.25)

I believe neo4j uses keep-alive to reuse the same connection but this does
not seem relevant. I have verified my code is (logically) correct, e.g. I
do not delete an already deleted node and etc.

Any idea?

Thanks,
Yaron


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Florent Empis  
View profile  
 More options Jun 23 2012, 3:52 pm
From: Florent Empis <florent.em...@gmail.com>
Date: Sat, 23 Jun 2012 21:52:39 +0200
Local: Sat, Jun 23 2012 3:52 pm
Subject: Re: [Neo4j] errors on delete

(Answering this with very partial knowledge, I use this as an occasion to
learn stuff about Neo4J)
In 2009, similar issues arose (
http://www.mail-archive.com/u...@lists.neo4j.org/msg01870.html )
The advice given then was to manage the locking mechanism by hand.
Looking at your trace, I'd say that your data is like this:

(Node X) -[Rel 8253]-(Node 1841)

You are currently trying to delete node X.
Sometime before, you ran an operation (a delete I guess?) on node 1841
To be able to perform this, Relationship 8253 has to be locked (it will be
deleted, since per
http://docs.neo4j.org/chunked/milestone/transactions-delete.html  all
properties and relationships of a node are deleted upon delete of the node
itself)
When you do it in synch mode:
You: Delete Node 1841
You: Wait
Server: Delete confirmed
You: Delete Node X

Works, obviously
When you do it in asynch mode:
What you are attempting to do is:
You:Delete Node 1841
Server:Locks Node 1841 and all its relationships
You:Delete Node X
Server:Attemps to lock 1841 and all its relationships: fails on rel 8253
Server:Boom, Err 500 on delete Node X
Server:(probably) Delete Node 1841 confirmed

Either you can manage the lock on the server side like suggested in the
2009 thread, or I think you'll have to manage it externally.

Can you add some sort of management in your delete calls to the server,
partionning it to avoid collisions? Something akin to this:
[0...33][34...66][67...99]
(this example assumes that relationships are all between direct neighbours
of course...)
3 threads run in parallel.
Thread A starts at 0 stops at 33
Thread B starts at 66 stops at 34
Thread B starts at 99 stops at 67

This should in theory avoid collisions if we assume delete operation
duration to be constant for all nodes...?
(if you want to be extra careful, add a dampenning at the end of the
partition: as you get closer to the boundary, wait a little bit between
calls...it will give extra time to the neighbouring thread to move further
away....)

Please remember I'm probably as new to Neo4J as you, so take all this with
a grain of salt :-)

Florent
2012/6/23 Yaron Naveh <yaron...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yaron Naveh  
View profile  
 More options Jun 23 2012, 6:44 pm
From: Yaron Naveh <yaron...@gmail.com>
Date: Sun, 24 Jun 2012 01:44:34 +0300
Local: Sat, Jun 23 2012 6:44 pm
Subject: Re: [Neo4j] errors on delete

Thanks

Actually I have a node X, and multiple nodes a..z that are linked to it. I
am deleting all links. Since all links are different (except their end
point X) I'm not sure how deleting one link should lock another?

what does it mean to do it on the server side?
not sure how how to handle it externally - if I have multiple clients on
different machines I cannot synchronize them. I am expecting neo4j to lock
everything of interest while deleting a link.

On Sat, Jun 23, 2012 at 10:52 PM, Florent Empis <florent.em...@gmail.com>wrote:

--

I'm on Twitter (@YaronNaveh <http://twitter.com/#!/YaronNaveh>)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Jun 23 2012, 10:19 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sun, 24 Jun 2012 04:19:11 +0200
Local: Sat, Jun 23 2012 10:19 pm
Subject: Re: [Neo4j] errors on delete

Deleting a relationship currently locks both nodes.

What about deleting them all in a batch transaction?

Or deleting them with mutating cypher? http://docs.neo4j.org/chunked/snapshot/query-delete.html

MIchael

Am 24.06.2012 um 00:44 schrieb Yaron Naveh:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yaron Naveh  
View profile  
 More options Jun 24 2012, 5:59 am
From: Yaron Naveh <yaron...@gmail.com>
Date: Sun, 24 Jun 2012 12:59:52 +0300
Local: Sun, Jun 24 2012 5:59 am
Subject: Re: [Neo4j] errors on delete

Thanks

I still don't get the problem. I have node A with links to different nodes.
I delete the links. There should be no deadlock in my scenario. Possibly A
will be locked for a while by one delete, by why don't other deletes wait
for the lock to be released?

Also can you give me a link for batch transactions?

On Sun, Jun 24, 2012 at 5:19 AM, Michael Hunger <

--

I'm on Twitter (@YaronNaveh <http://twitter.com/#!/YaronNaveh>)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Jul 5 2012, 4:30 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Thu, 5 Jul 2012 10:30:49 +0200
Local: Thurs, Jul 5 2012 4:30 am
Subject: Re: [Neo4j] errors on delete
Yaron,
batch transactions are covered at
http://docs.neo4j.org/chunked/snapshot/rest-api-batch-ops.html

Is that what you are looking for?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yaron Naveh  
View profile  
 More options Jul 5 2012, 11:20 am
From: Yaron Naveh <yaron...@gmail.com>
Date: Thu, 5 Jul 2012 18:20:09 +0300
Local: Thurs, Jul 5 2012 11:20 am
Subject: Re: [Neo4j] errors on delete

Thanks

I'm currently using a workaround - doing everything in a sync manner. but
I'm still not sure why the async version fails, this is my main worry now.
I wouldn't expect batch to be required here - deleting multiple
relationships of a single node.

On Thu, Jul 5, 2012 at 11:30 AM, Peter Neubauer <

--

I'm on Twitter (@YaronNaveh <http://twitter.com/#!/YaronNaveh>)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Jul 5 2012, 11:21 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Thu, 5 Jul 2012 17:21:46 +0200
Local: Thurs, Jul 5 2012 11:21 am
Subject: Re: [Neo4j] errors on delete
Could you just try Cypher to delete your relationships?
http://docs.neo4j.org/chunked/snapshot/query-delete.html#delete-remov...

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse  
View profile  
 More options Jul 5 2012, 12:52 pm
From: Jesse <je...@guestd.com>
Date: Thu, 5 Jul 2012 09:52:31 -0700 (PDT)
Local: Thurs, Jul 5 2012 12:52 pm
Subject: Re: [Neo4j] errors on delete

The REST API seems to have serious issues with concurrency - the new
mutating Cypher stuff does appear to address this but you'll basically be
doing everything the Cypher way. Which, mind you, isn't necessarily a bad
thing; I am finding Cypher to be very intuitive and powerful... excepting
the inconvenient pseudo-JSON format for sending property data :)

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Jul 5 2012, 1:10 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Thu, 5 Jul 2012 19:10:08 +0200
Local: Thurs, Jul 5 2012 1:10 pm
Subject: Re: [Neo4j] errors on delete

#1 Each REST call is an individual tx and individual thread, except in cypher and batch operations which group multiple operations.
#2 if you want to send properties as parameters (which you should anyway) then you can post real json as params, see

http://docs.neo4j.org/chunked/snapshot/cypher-plugin.html#cypher-plug...

Michael

Am 05.07.2012 um 18:52 schrieb Jesse:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Jul 5 2012, 1:29 pm
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Thu, 5 Jul 2012 19:29:15 +0200
Local: Thurs, Jul 5 2012 1:29 pm
Subject: Re: [Neo4j] errors on delete

Jesse,
How would you envision property data to be sent? Speak up :-)

/peter

Send from mobile.
On Jul 5, 2012 6:53 PM, "Jesse" <je...@guestd.com> wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse  
View profile   Translate to Translated (View Original)
 More options Jul 5 2012, 6:56 pm
From: Jesse <je...@guestd.com>
Date: Thu, 5 Jul 2012 15:56:01 -0700 (PDT)
Local: Thurs, Jul 5 2012 6:56 pm
Subject: Re: [Neo4j] errors on delete

Hey guys, thanks for getting back to me - #2 looks like it solves my JSON
issue, I will definitely be checking that out.

Back to the original topic though: the new mutating Cypher syntax I realize
only makes it easier to group multiple operations into the same transaction
- there still seem to be concurrency problems if one tries to
simultaneously delete two distinct relationships to the same node with a
Cypher call each. I get back something like:

Transaction(197)[STATUS_ACTIVE,Resources=1] can't wait on resource
RWLock[Relationship[120]] since =>
Transaction(197)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]- RWLock[Node[60]]
<-[:WAITING_FOR]- Transaction(197)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]-
RWLock[Relationship[120]]

If Neo4j can detect and prevent a RWLock ahead of time, can't it simply
queue my Cypher transactions FIFO style? I can't think of an easy way to
handle this situation in a scalable fashion from my application (a
webserver).

Jesse

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse  
View profile   Translate to Translated (View Original)
 More options Jul 5 2012, 7:03 pm
From: Jesse <je...@guestd.com>
Date: Thu, 5 Jul 2012 16:03:15 -0700 (PDT)
Local: Thurs, Jul 5 2012 7:03 pm
Subject: Re: [Neo4j] errors on delete

I suppose I could just keep retrying until the resource opens up? Seems
like a pain though if the db could handle it for me...

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile   Translate to Translated (View Original)
 More options Jul 5 2012, 7:10 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Fri, 6 Jul 2012 01:10:05 +0200
Local: Thurs, Jul 5 2012 7:10 pm
Subject: Re: [Neo4j] errors on delete

It detects and abort deadlocks, so usually you would retry the operation.

The deadlock detection is happening after the fact, to precompute all that would not be feasible as the tx-system would have to know a lot about the semantics of all your operations. And usually it is seldom enough that a simple
retry is a good solution.

Michael

Am 06.07.2012 um 00:56 schrieb Jesse:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse  
View profile   Translate to Translated (View Original)
 More options Jul 5 2012, 7:31 pm
From: Jesse <je...@guestd.com>
Date: Thu, 5 Jul 2012 16:31:10 -0700 (PDT)
Local: Thurs, Jul 5 2012 7:31 pm
Subject: Re: [Neo4j] errors on delete

Ok. Thanks again for getting back to me so quick. I've just tested passing
JSON as a param and auto-retrying when I see the RWLock error - seems to
solve both problems. Cheers!

Jesse

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shireesh  
View profile  
 More options Jul 7 2012, 1:26 pm
From: Shireesh <ashirees...@gmail.com>
Date: Sat, 7 Jul 2012 10:26:16 -0700 (PDT)
Local: Sat, Jul 7 2012 1:26 pm
Subject: Re: [Neo4j] errors on delete

I tried cyper delete, but it deletes all the connected nodes and edges, but
i need to delete connected nodes based on their properties (eg : delete
connected node only if it has value "x" on a certain property and which is
connected to parent node through the edge "relx")

I used server plugins to achieve the above behavior.

How good is this approach, any comments would be helpful.

Thanks,
Shireesh.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile   Translate to Translated (View Original)
 More options Jul 7 2012, 3:44 pm
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Sat, 7 Jul 2012 21:44:43 +0200
Local: Sat, Jul 7 2012 3:44 pm
Subject: Re: [Neo4j] errors on delete

Hi there,
If you can find and return the nodes you are interested in deleting with a
Cypher query then you should be able to delete them too. Do you have any
example graph and what to delete?

/peter

Send from mobile.
On Jul 7, 2012 7:26 PM, "Shireesh" <ashirees...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Jul 7 2012, 4:58 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sat, 7 Jul 2012 22:58:45 +0200
Local: Sat, Jul 7 2012 4:58 pm
Subject: Re: [Neo4j] errors on delete
Shireesh,

you can filter with cypher before deleting.

start n=...
match n-[r]-m
where r.foo = 'bar'
delete r


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shireesh adla  
View profile  
 More options Jul 8 2012, 11:25 am
From: shireesh adla <ashirees...@gmail.com>
Date: Sun, 8 Jul 2012 20:55:55 +0530
Local: Sun, Jul 8 2012 11:25 am
Subject: Re: [Neo4j] errors on delete

Thanks for the response.

I have connected graph in this order,

A --> [produces] X1 [consumes] <-- B
A --> [produces] X2
A --> [consumes] X3 [produces] <-- B
A --> [uses] R1 [uses] <-- B
A --> [uses] R2
X2 -->[has] L1

nodes : [A,B,X1,X2,X3,R1,R2,L1]
edge types : [produces,consumes,uses,has]

Now delete [A] needs to delete in the following way,
-- delete all those nodes which A produces only is no other node consumes
it.[eg X2]
-- delete all nodes which A uses, if no other node uses it. [eg : R2]
-- delete the grand child nodes connected to the child node [L1]

so based on above conditions if i delete A,
  nodes to be deleted : A,X2,L1,R2

Thanks,
Shireesh

On Sun, Jul 8, 2012 at 1:14 AM, Peter Neubauer <neubauer.pe...@gmail.com>wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
shireesh adla  
View profile  
 More options Jul 8 2012, 11:27 am
From: shireesh adla <ashirees...@gmail.com>
Date: Sun, 8 Jul 2012 20:57:09 +0530
Local: Sun, Jul 8 2012 11:27 am
Subject: Re: [Neo4j] errors on delete

Thanks Michael,

Will give it a try.

Regards,
Shireesh.

On Sun, Jul 8, 2012 at 2:28 AM, Michael Hunger <

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
brian  
View profile  
 More options Oct 8 2012, 11:16 am
From: brian <blevine...@gmail.com>
Date: Mon, 8 Oct 2012 08:16:16 -0700 (PDT)
Local: Mon, Oct 8 2012 11:16 am
Subject: Re: [Neo4j] errors on delete

I am running into the same problem and will have to use the Cypher method
you describe.  However I'm also confused as to why deleting multiple
relationships concurrently via the REST API produces a deadlock.  Could you
explain further?

Thanks.

-brian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aseem Kishore  
View profile  
 More options Oct 27 2012, 7:43 pm
From: Aseem Kishore <aseem.kish...@gmail.com>
Date: Sat, 27 Oct 2012 19:42:40 -0400
Local: Sat, Oct 27 2012 7:42 pm
Subject: Re: [Neo4j] errors on delete

Just discovered this thread -- great stuff. We used to see transaction
errors from time to time too, but they've mostly disappeared that now that
I'm finally migrating our app to mutable Cypher.

Still, I just saw one earlier -- a deadlock error
message<https://twitter.com/aseemk/status/262283331511676928>for the
first time -- and it's good to know that a simple retry is
recommended in this case.

(Though I agree 100% that, intuitively, I would expect Neo4j to internally
serialize queries that need access to the same resources. Isn't
transactional support a key selling point of mutable Cypher?)

We obviously shouldn't be retrying every 500 response from Neo4j though (or
should we?). So I wanted to ask how you guys recommend we detect retryable
failures specifically.

Should we be checking the `exception` property in the response for a
whitelisted set of exception names? Which names?

Thanks much!

Aseem


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Oct 27 2012, 8:45 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sun, 28 Oct 2012 02:45:41 +0200
Local: Sat, Oct 27 2012 8:45 pm
Subject: Re: [Neo4j] errors on delete
Aseem,

can you raise an issue about this?

I think it is most sensible to return a different error code as you suggested when a deadlock exception arises.

What do you think?
- 409 Conflict Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.
- 423 Locked (WebDAV; RFC 4918) The resource that is being accessed is locked.

The only thing I see as an issue (in general) is when streaming back results from requests, that the deadlock exception (and others) only after the header has already been sent (and parts of the response too) as the execution happens lazily and is ongoing on the server.

Michael

Am 28.10.2012 um 01:42 schrieb Aseem Kishore:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aseem Kishore  
View profile  
 More options Oct 27 2012, 8:58 pm
From: Aseem Kishore <aseem.kish...@gmail.com>
Date: Sat, 27 Oct 2012 20:57:42 -0400
Local: Sat, Oct 27 2012 8:57 pm
Subject: Re: [Neo4j] errors on delete

Done:

https://github.com/neo4j/community/issues/950

Streaming will indeed be tricky. Besides this signaling issue, how should
clients act btw if they got and processed some results back before this
kind of transaction error?

Any example kind of scenarios where a transaction error might invalidate
earlier results? Or are earlier results always okay by definition?

Aseem

On Sat, Oct 27, 2012 at 8:45 PM, Michael Hunger <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Oct 27 2012, 9:28 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sun, 28 Oct 2012 02:28:28 +0100
Local: Sat, Oct 27 2012 9:28 pm
Subject: Re: [Neo4j] errors on delete

Good points,

as the transaction is rolled back the previous elements that originated from a mutating operation are invalid. So earlier results of those are _never_ ok. The transaction that is rolled back spans the whole http request.

Things that originated from a read operation which was not affected by the mutation should still be valid.

I would want to change the results for streaming operations to be more individual records that are returned, so that one or more of those record might be "error-records" reporting failures. This is still TDB though. Much like
the twitter streaming API results.

Michael

Am 28.10.2012 um 02:57 schrieb Aseem Kishore:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 29   Newer >
« Back to Discussions « Newer topic     Older topic »