fix(admin): fix master leader link showing incorrect port in Admin UI (#8924)
fix(admin): use gRPC address for current server in RaftListClusterServers The old Raft implementation was returning the HTTP address (ms.option.Master) for the current server, while peers used gRPC addresses (peer.ConnectionString). The Admin UI's GetClusterMasters() converts all addresses from gRPC to HTTP via GrpcAddressToServerAddress (port - 10000), which produced a negative port (-667) for the current server since its address was already in HTTP format (port 9333). Use ToGrpcAddress() for consistency with both HashicorpRaft (which stores gRPC addresses) and old Raft peers. Fixes #8921
This commit is contained in:
@@ -41,7 +41,7 @@ func (ms *MasterServer) RaftListClusterServers(ctx context.Context, req *master_
|
||||
// Add the current server itself (Peers() only returns other peers)
|
||||
resp.ClusterServers = append(resp.ClusterServers, &master_pb.RaftListClusterServersResponse_ClusterServers{
|
||||
Id: currentServerName,
|
||||
Address: string(ms.option.Master),
|
||||
Address: ms.option.Master.ToGrpcAddress(),
|
||||
Suffrage: "Voter",
|
||||
IsLeader: currentServerName == leader,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user