goodboy / tractor

A distributed, structured concurrent runtime for Python (and friends)
GNU Affero General Public License v3.0
263 stars 12 forks source link

Multi-root discovery: pragmatic, simple consensus. #216

Open goodboy opened 3 years ago

goodboy commented 3 years ago

This issue is a more practical and immediate equivalent of the discussion in #184.

From the start of the project a hacky naive approach to finding the addresses of other "actors" has been this idea of an arbiter which we implement as a "special actor" with methods for looking up (socket) addresses by name. This is of course not an ideal system since there will always be a race during a multi-tree startup for the "arbiter" address as well no flexible consensus system for how that position can be transferred to another tree / root actor when the first is torn down / fails. The fragility is further emphasized in how root actors "check" for the registry (arbiter) existing which is simply do a fast TCP connect and drop on the supposed arbiter socket address.

Summarizing the current naive/questionable design for an address registry:


Digging into "why" this is in the code:

This "arbiter" idea was originally adopted from other "actor system" projects:

Places to start some research

WIP, will come back.

goodboy commented 2 years ago

resource dump, will do writeup later.

internal existing issues: https://github.com/goodboy/tractor/issues/184

resources to work toward our own discovery sys: https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing https://spec.matrix.org/unstable/server-server-api/#room-state-resolution https://spec.matrix.org/unstable/rooms/v2/ https://en.wikipedia.org/wiki/Multicast_DNS https://en.wikipedia.org/wiki/Name_Service_Switch https://en.wikipedia.org/wiki/Link-Local_Multicast_Name_Resolution https://en.wikipedia.org/wiki/Zero-configuration_networking#Name_service_discovery https://en.wikipedia.org/wiki/Service_Location_Protocol https://en.wikipedia.org/wiki/Peer_Name_Resolution_Protocol https://en.wikipedia.org/wiki/Name_Service_Switch https://raft.github.io/raft.pdf