[OSM-dev] foreign key constraint violation in live-api

IgnacioZ zignacio at gmail.com
Tue May 4 13:07:01 BST 2010


Ok thank you very much.

I will add some more POI today changing my code to wait for the new request
to be created when the previous one finished (which is not always exactly
the same as to when I get the response).

If you need some help with the code let me know. What language do you work
with ?

Regards,
Ignacio.

On Tue, May 4, 2010 at 8:59 AM, Tom Hughes <tom at compton.nu> wrote:

> On 04/05/10 12:36, IgnacioZ wrote:
>
>   They were done in a for loop and before I start the next request, I
>> receive the answer, though by looking at my code it could happen that
>> two requests are done in parallel, after receiving the Id of the
>> previous one, I continue and the previous connection may not have been
>> finalized (they are different instances).
>>
>> Do you think that could be the reason ?
>>
>
> Once you get the ID back everything should be complete on the server so if
> you were waiting that long there shouldn't be a problem. That isn't what I'm
> seeing in the server logs though.
>
> I have the request to add 717587768 starting:
>
> [2010-05-02 19:02:06.985698 #9411] Processing NodeController#create (for
> ...) [PUT]
>
> then the request add 717587767 starting:
>
> [2010-05-02 19:02:06.998618 #9413] Processing NodeController#create (for
> ...) [PUT]
>
> then they both deadlocked (probably against each other):
>
> [2010-05-02 19:02:08.136362 #9413] Deadlock detected on retry 1, restarting
> transaction
> [2010-05-02 19:02:08.282322 #9411] Deadlock detected on retry 1, restarting
> transaction
>
> after which they both report FK violations.
>
> Now there is presumably a bug in the way we restart the deadlocked
> transaction that leads to the FK violations but I suspect it was the
> parallel upload that led to the deadlock and that it explains why other
> people don't see the same problems.
>
>
> Tom
>
> --
> Tom Hughes (tom at compton.nu)
> http://compton.nu/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100504/b60bb342/attachment.html>


More information about the dev mailing list