code: func (s *Store) CheckServiceTagNodes(ws memdb.WatchSet, serviceName string, tags []string) (uint64, structs.CheckServiceNodes, error) {
  	tx := s.db.Txn(false)
  	defer tx.Abort()
  
  	// Query the state store for the service.
  	iter, err := tx.Get("services", "service", serviceName)
  	if err != nil {
  		return 0, nil, fmt.Errorf("failed service lookup: %s", err)
  	}
  	ws.Add(iter.WatchCh())
  
  	// Return the results, filtering by tag.
  	serviceExists := false
  	var results structs.ServiceNodes
  	for service := iter.Next(); service != nil; service = iter.Next() {
  		svc := service.(*structs.ServiceNode)
  		serviceExists = true
  		if !serviceTagsFilter(svc, tags) {
  			results = append(results, svc)
  		}
  	}
  
  	// Get the table index.
  	idx := maxIndexForService(tx, serviceName, serviceExists, true)
  	return s.parseCheckServiceNodes(tx, ws, idx, serviceName, results, err)
  }
docs: // CheckServiceTagNodes is used to query all nodes and checks for a given
  // service, filtering out services that don't contain the given tag.