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
Message from discussion errors on delete
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
 
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

On Sun, Jun 24, 2012 at 11:59 AM, Yaron Naveh <yaron...@gmail.com> wrote:
> 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
> <michael.hun...@neotechnology.com> wrote:

>> 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:

>> 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:

>>> (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>

>>>> 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

>> --

>> I'm on Twitter (@YaronNaveh)

> --

> I'm on Twitter (@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.