apple / swift-distributed-actors

Peer-to-peer cluster implementation for Swift Distributed Actors
https://apple.github.io/swift-distributed-actors/
Apache License 2.0
580 stars 54 forks source link

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

Closed akbashev closed 8 months ago

akbashev commented 8 months ago

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.