code: func (a *AggMetric) SyncAggregatedChunkSaveState(ts uint32, consolidator consolidation.Consolidator, aggSpan uint32) {
  	// no lock needed cause aggregators don't change at runtime
  	for _, a := range a.aggregators {
  		if a.span == aggSpan {
  			switch consolidator {
  			case consolidation.None:
  				panic("cannot get an archive for no consolidation")
  			case consolidation.Avg:
  				panic("avg consolidator has no matching Archive(). you need sum and cnt")
  			case consolidation.Cnt:
  				if a.cntMetric != nil {
  					a.cntMetric.SyncChunkSaveState(ts)
  				}
  				return
  			case consolidation.Min:
  				if a.minMetric != nil {
  					a.minMetric.SyncChunkSaveState(ts)
  				}
  				return
  			case consolidation.Max:
  				if a.maxMetric != nil {
  					a.maxMetric.SyncChunkSaveState(ts)
  				}
  				return
  			case consolidation.Sum:
  				if a.sumMetric != nil {
  					a.sumMetric.SyncChunkSaveState(ts)
  				}
  				return
  			case consolidation.Lst:
  				if a.lstMetric != nil {
  					a.lstMetric.SyncChunkSaveState(ts)
  				}
  				return
  			default:
  				panic(fmt.Sprintf("internal error: no such consolidator %q with span %d", consolidator, aggSpan))
  			}
  		}
  	}
  }
docs: // Sync the saved state of a chunk by its T0.