code: func (h *Heartbeat) fetch() error {
  	// failed to fetch server info?
  	// reset to init state regardless of the current state
  	server, err := h.GetServerInfo()
  	if err != nil {
  		h.reset(HeartbeatStateInit)
  		return trace.Wrap(err)
  	}
  	switch h.state {
  	// in case of successfull state fetch, move to announce from init
  	case HeartbeatStateInit:
  		h.current = server
  		h.reset(HeartbeatStateAnnounce)
  		return nil
  		// nothing to do in announce state
  	case HeartbeatStateAnnounce:
  		return nil
  	case HeartbeatStateAnnounceWait:
  		// time to announce
  		if h.Clock.Now().UTC().After(h.nextAnnounce) {
  			h.current = server
  			h.reset(HeartbeatStateAnnounce)
  			return nil
  		}
  		result := services.CompareServers(h.current, server)
  		// server update happened, time to announce
  		if result == services.Different {
  			h.current = server
  			h.reset(HeartbeatStateAnnounce)
  		}
  		return nil
  		// nothing to do in keep alive state
  	case HeartbeatStateKeepAlive:
  		return nil
  		// Stay in keep alive state in case
  		// if there are no changes
  	case HeartbeatStateKeepAliveWait:
  		// time to send a new keep alive
  		if h.Clock.Now().UTC().After(h.nextKeepAlive) {
  			h.setState(HeartbeatStateKeepAlive)
  			return nil
  		}
  		result := services.CompareServers(h.current, server)
  		// server update happened, move to announce
  		if result == services.Different {
  			h.current = server
  			h.reset(HeartbeatStateAnnounce)
  		}
  		return nil
  	default:
  		return trace.BadParameter("unsupported state: %v", h.state)
  	}
  }
docs: // fetch, if succeeded updates or sets current server
  // to the last received server