[erlang-questions] question re. message delivery
Miles Fidelman
mfidelman@REDACTED
Tue Sep 26 20:10:15 CEST 2017
On 9/26/17 10:05 AM, *Matthias Lang* wrote:
> On 26. September 2017, Miles Fidelman wrote:
>
>
>>> Miles, do you have some concrete examples of situations where you're
>>> worried about messages disappearing? Here's one from me: process 1
>>> sends two messages to process 2. The messages are A and B,
>>> respectively. Process 2 sends an ACK for message B back to process
>>> 1. For single-node Erlang, if message A disappears then that is a
>>> bug. I'll let others reason about distributed Erlang.
>> Sure. Bank transactions. Edits to a document. Dispatch commands to a
>> vehicle.
> Those are not what I consider concrete examples.
How concrete do you need. There are lots of systems where one needs
reliable, ordered message delivery. One generally implements an
acknowledgement, but those can be unordered.
Let's say that a transaction is a test-and-set on a value. With
acknowledgement sent after transaction is executed.
Send transactions 1,2,3,4,5
If message delivery is ordered & guaranteed, then an acknowledgement
from 5 guarantees that transactions 1-4 were performed, in order, even
if some of the acknowledgements were not received.
If, either, a message can get dropped, or it can get delivered out of
order, then one needs a protocol on top of basic message delivery to
wait for an acknowledgement of each and every message before sending the
next.
There are multiple approaches to implementing a reliable messaging
protocol. What approach would work best somewhat depends on the kinds
of failure modes one has to deal with (i.e., the services provided by
the next layer down).
Miles
--
In theory, there is no difference between theory and practice.
In practice, there is. .... Yogi Berra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170926/49665463/attachment.htm>
More information about the erlang-questions
mailing list