code: func (h *Head) processWALSamples(
  	minValidTime int64,
  	input <-chan []RefSample, output chan<- []RefSample,
  ) (unknownRefs uint64) {
  	defer close(output)
  
  	// Mitigate lock contention in getByID.
  	refSeries := map[uint64]*memSeries{}
  
  	mint, maxt := int64(math.MaxInt64), int64(math.MinInt64)
  
  	for samples := range input {
  		for _, s := range samples {
  			if s.T < minValidTime {
  				continue
  			}
  			ms := refSeries[s.Ref]
  			if ms == nil {
  				ms = h.series.getByID(s.Ref)
  				if ms == nil {
  					unknownRefs++
  					continue
  				}
  				refSeries[s.Ref] = ms
  			}
  			_, chunkCreated := ms.append(s.T, s.V)
  			if chunkCreated {
  				h.metrics.chunksCreated.Inc()
  				h.metrics.chunks.Inc()
  			}
  			if s.T > maxt {
  				maxt = s.T
  			}
  			if s.T < mint {
  				mint = s.T
  			}
  		}
  		output <- samples
  	}
  	h.updateMinMaxTime(mint, maxt)
  
  	return unknownRefs
  }
docs: // processWALSamples adds a partition of samples it receives to the head and passes
  // them on to other workers.
  // Samples before the mint timestamp are discarded.