lasp-lang / partisan

High-performance, high-scalability distributed computing for the BEAM.
https://partisan.dev
Apache License 2.0
914 stars 60 forks source link

Reduce the number of connections between nodes #247

Open aramallo opened 1 year ago

aramallo commented 1 year ago

At the moment the peer_service_manager will open and maintain one connection in each direction, that is when node A connects to node B it does not take into account that maybe B already established a connection to A.

More specifically, the peer_service_manager will check the current outgoing connections i.e. partisan_peer_service_client (in v4 from its in-process state cache and in v5 using partisan_peer_service_connections which uses ets) without considering the existing incoming connections partisan_peer_service_server.

The above is contrary to what disterl does, which ensures there is always one TPC connection between two nodes. disterl does this during the handshake checking the existing connections (or in-flight connection attempts).

For Partisan, we can do the same but taking into account Channel Parallelism.