apple / swift-distributed-actors

Peer-to-peer cluster implementation for Swift Distributed Actors

Home Page:https://apple.github.io/swift-distributed-actors/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leadership will choose lowest node by `systemName` order and not by address

akbashev opened this issue · comments

Current implementation of Comparable protocol from ClusterEndpoint is using description string, and thus creates a problem—it contains systemName in it and most important it comes before host and port. So when selectByLowestAddress kicks in Leadership it will sort nodes and choose lowest not by address, but by alphabetical order (or guess unicode order) of systemName node's variables.

As systemName is actually internal and not so important quick solution could be just to remove it from node comparison.