Closed josevalim closed 5 years ago
Since a channel will be required, how do you plan to expose that configuration? Is the plan to point people to Partisan or provide an alternative as part of this project? Strictly speaking, this is really more of an optional thing rather than required, since the default Erlang distribution channel is sufficient for small clusters - I think it's only in large clusters where congestion becomes a problem.
We want to change the Firenest.Topology API so that a channel is expected as argument when sending messages. This will allow us to use Partisan efficiently or allow someone to implement better multiplexing than the disterl that uses a single connection.
That makes sense, but what is the channel abstraction? As far as I'm aware, there is nothing for distributed Erlang, it's just baked into the kernel modules (primarily :rpc
) - is Firenest planning on exposing a behavior or protocol for other libraries to standardize on, or is there one already available that I'm not aware of? I didn't see anything like that in Partisan, but I skimmed through, so I may have missed it.
The name "channel" is confusing in our context, so we will need something better. The idea though is to tag messages and we provide ordering guarantee only for messages with the same tag. This allows us to open up multiple connections between nodes. More info on section 3.3.2 in the paper.
I think it's good terminology, but yeah, in the context of Phoenix it will certainly be confusing.
In any case, I think I get it now, in Firenest.Topology.Erlang
, the channel tag would be ignored, but for a topology based on Partisan, the tag would be passed through to the Partisan API, is that correct? I'm assuming the channel tag would be optional when sending messages using the Firenest API, but required by Firenest.Topology
implementations, since that appears to be how Partisan works as well (non-tagged messages just use a default channel).
Yes, precisely. :+1:
Some other names instead of "Channel":
Accurate but probably bad because of its use in different (but related) contexts:
Maybe better; all of these attempt to capture the 'messages are ordered when having(/being on) the same X':
I think I would call it a partition and probably force them to be integers. If we don’t want to impose integers, then I would say the argument is always hashed. --
José Valimwww.plataformatec.com.br http://www.plataformatec.com.br/Founder and Director of R&D
I think I would call it a partition and probably force them to be integers.
Having now read the Partisan paper thoroughly, I disagree with both of these proposals because:
33
does not mean anything to a reader of the code, while something like :riak_state_gossip
does. So it to me makes sense to at least allow the use of atoms to identify Partisan Channels (or their equivalent in Firenest).@Qqwy right. so we can just allow them to be any term, which we will hash and send in the available number of underlying connections.
I'm not sure we want to do hashing - I think the goal is to send a particular message on a particular connection and not just have a pool where you multiplex messages.
See https://arxiv.org/pdf/1802.02652.pdf.