[openstreetmap/openstreetmap-website] Idempotency for API 0.6 (#2201)

mmd notifications at github.com
Thu Apr 18 12:27:16 UTC 2019

Switching to some kind of asynchronous queue based system isn't exactly trivial with today's API calls. I see at least the following three major issues here: (a) sync/asych message interdepencies, (b) data dependencies and (c) error handling.

Queue processing would not only require us to spend some time on the changeset upload, but also on creating, and in particular closing changesets. Once a changeset has been uploaded to be processed asynchronously, we cannot simply send a synchronous "close changeset", as it would directly interfere with the queue handling, and in the worst case close the changeset even before its due for processing the queue. 

On the data dependency side, I think one thing which has become clear in this issue is that chunked upload implies that message t2 might depend on the results of message t1, so queuing both of them at the same time isn't going to work. A client would have to enqueue message t1, poll for its status until is has been processed and only then enqueue message t2, based on updated information from t1. This sort of thwarts the whole concept of asynch processing.

Next would be error handling. Assuming we were to enqueue multiple changeset uploads, and there's some error condition, it's not clear how the process would continue here. In the synchronous world, we simply tell the user "hey, there's some conflict, because joe mapper deleted the node you were about to add in your way". In the asynch world, that message lingers somewhere in the queue, and it's not clear, how conflict resolution would go about.

I don't believe we would ever be in the position to have more than a single message in the queue, unless we could come up with a complete overhaul of the protocol to address those issues I mentioned.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190418/596c8920/attachment.html>

More information about the rails-dev mailing list