func (ss *Storageserver) GetServers(args *storageproto.GetServersArgs, reply *storageproto.RegisterReply) error { if ss.cntnodes < ss.numnodes { reply.Ready = false } else { reply.Ready = true reply.Servers = ss.servers } return nil }
// Non-master servers to the master func (ss *Storageserver) RegisterServer(args *storageproto.RegisterArgs, reply *storageproto.RegisterReply) error { lsplog.Vlogf(5, "Connected:", args.ServerInfo.NodeID) ss.serverListLock.Lock() if ss.cntnodes < ss.numnodes { ss.servers[ss.cntnodes] = args.ServerInfo ss.cntnodes += 1 } if ss.cntnodes == ss.numnodes { lsplog.Vlogf(5, "Ready") reply.Ready = true reply.Servers = ss.servers } ss.serverListLock.Unlock() return nil }