CausalOrdering

Causal ordering

Telepathy's D-Bus Tubes mechanism doesn't guarantee total ordering of messages, only causal ordering.

Suppose Alice, Bob and Christine and Dave are participants in a D-Bus Tubes channel.

Alice sends a message A. We guarantee that by the time Bob receives A, he has already received every message that Alice had received by the time she sent A. In particular, if Alice's message A was a reply to a message M, we guarantee that Bob will see them in the order [M, A].

We also guarantee that if Alice sends messages [A1, A2] in that order, Bob will receive them in that same order.

However, we make no guarantees about messages that Alice hadn't yet received: if Alice sends a message A, and at about the same time, Christine sends a message C, it's possible that Bob will see the messages in the order [A, C] while Dave sees [C, A].

If you want to impose a total ordering, you'll probably have to elect one of the participants as a "leader" for the protocol, and have everyone else synchronize via them.

Suggested algorithm for "leader" election

To be written

Total ordering

For reference, here's a definition of total ordering: if it is possible to label the messages with distinct numbers such that everyone sees all messages in ascending numerical order, then they're totally ordered.

Suppose Alice sends a message A while Christine sends a message C, and Bob sees the messages in the order [A, C]. If there is total ordering, Dave will also see the message in the order [A, C].

Again, we don't guarantee to provide this.