[OSM-dev] Data checks?

Tom Hughes tom at compton.nu
Mon Feb 18 08:42:38 GMT 2008

In message <2fc2c5f10802180031y6620bcefrb8608d603ff246a2 at mail.gmail.com>
        Martijn van Oosterhout <kleptog at gmail.com> wrote:

> Secondly, prevention is better than cure. It would be worthwhile going
> over all the code that accesses the server database and determine if
> it is "safe". The lack of transactions makes it more difficult, but
> the idea is that prior to deleting a node you check that it's not
> used, after locking it. And more importantly, *after* you've deleted
> it, check again.

That still has race conditions unless you can do the check in an
atomic fashion, which I'm not sure you can.

> Alternatively, when adding/updating a way, lock the component nodes
> prior to doing the update so they can't get deleted in the meantime.

Well obviously we could just lock everything, but the users of
the API probably wouldn't like the result much.

> There are many methods and complete books written on the topic. Choose
> whichever you like best, but it's certainly a problem that needs to be
> solved.

I know that. They probably generally start from the assumption
that you have a vaguely ACID compliant database engine though.


Tom Hughes (tom at compton.nu)

More information about the dev mailing list