Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Connecting to cluster with requireMaster=false always connects to Master #166

@mortenaa

Description

@mortenaa

I'm trying to connect to a 3 node cluster, with requireMaster=false, but still all connections seem to be made to the Leader node.

Trying to undersand the code, it seems to me that this part will always select the Leader node if it's available, because the ordering in MemerInfo.state has Leader > Follower

final case class ClusterInfo(serverAddress: InetSocketAddress, members: List[MemberInfo]) {
  lazy val bestNode: Option[MemberInfo] = {
    val xs = members.filter { x => x.isAlive && x.state.isAllowedToConnect }
    if (xs.isEmpty) None else Some(xs.maxBy(_.state))
  }
}

we are using eventstore client 7.3.0 and eventstore 5.0.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions