apple / swift-distributed-actors

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

We should not need .joining nodes to participate on convergence() #412

Open ktoso opened 4 years ago

ktoso commented 4 years ago

I currently did convergence a bit more conservative to get things quite hardened but it should not need to be so I think.

// FIXME: we should not need .joining nodes to participate on convergence()
    func fixme_converged_joiningOrDownMembersDoNotCount() {
ktoso commented 4 years ago
        /// Checks for convergence of the membership (seen table) among members.
        ///
        /// ### Convergence
        /// Convergence means that "all (considered) members" have seen at-least the version that the convergence
        /// is checked against (this version). In other words, if a member is seen as `.joining` in this version
        /// other members are guaranteed to have seen this information, or their membership may have progressed further
        /// e.g. the member may have already moved to `.up` or further in their perception.
        ///
        /// Only `.up` and `.leaving` members are considered, since joining members are "too early"
        /// to matter in decisions, and down members shall never participate in decision making.
        func converged() -> Bool {
            let members = self.membership.members(withStatus: [.joining, .up, .leaving]) // FIXME: we should not require joining nodes in convergence, can losen up a bit here I hope