code: func (p *Partition) prependActiveLogFile() error {
  	// Add active stats to total stats.
  	if p.activeLogFile != nil {
  		p.stats.Add(p.activeLogFile.MeasurementCardinalityStats())
  	}
  
  	// Open file and insert it into the first position.
  	f, err := p.openLogFile(filepath.Join(p.path, FormatLogFileName(p.nextSequence())))
  	if err != nil {
  		return err
  	}
  	p.activeLogFile = f
  
  	// Prepend and generate new fileset.
  	p.fileSet = p.fileSet.PrependLogFile(f)
  
  	// Write new manifest.
  	manifestSize, err := p.Manifest().Write()
  	if err != nil {
  		// TODO: Close index if write fails.
  		return err
  	}
  	p.manifestSize = manifestSize
  
  	// Write new stats.
  	if err := p.writeStatsFile(); err != nil {
  		return err
  	}
  
  	// Set the file metrics again.
  	p.tracker.SetFiles(uint64(len(p.fileSet.IndexFiles())), "index")
  	p.tracker.SetFiles(uint64(len(p.fileSet.LogFiles())), "log")
  	p.tracker.SetDiskSize(uint64(p.fileSet.Size()))
  	return nil
  }
docs: // prependActiveLogFile adds a new log file so that the current log file can be compacted.