code: func (f *fragment) Open() error {
  	f.mu.Lock()
  	defer f.mu.Unlock()
  
  	if err := func() error {
  		// Initialize storage in a function so we can close if anything goes wrong.
  		f.Logger.Debugf("open storage for index/field/view/fragment: %s/%s/%s/%d", f.index, f.field, f.view, f.shard)
  		if err := f.openStorage(); err != nil {
  			return errors.Wrap(err, "opening storage")
  		}
  
  		// Fill cache with rows persisted to disk.
  		f.Logger.Debugf("open cache for index/field/view/fragment: %s/%s/%s/%d", f.index, f.field, f.view, f.shard)
  		if err := f.openCache(); err != nil {
  			return errors.Wrap(err, "opening cache")
  		}
  
  		// Clear checksums.
  		f.checksums = make(map[int][]byte)
  
  		// Read last bit to determine max row.
  		pos := f.storage.Max()
  		f.maxRowID = pos / ShardWidth
  		f.stats.Gauge("rows", float64(f.maxRowID), 1.0)
  		return nil
  	}(); err != nil {
  		f.close()
  		return err
  	}
  
  	f.Logger.Debugf("successfully opened index/field/view/fragment: %s/%s/%s/%d", f.index, f.field, f.view, f.shard)
  	return nil
  }
docs: // Open opens the underlying storage.