code: func (v *view) CreateFragmentIfNotExists(shard uint64) (*fragment, error) {
  	v.mu.Lock()
  	defer v.mu.Unlock()
  	// Find fragment in cache first.
  	if frag := v.fragments[shard]; frag != nil {
  		return frag, nil
  	}
  
  	// Initialize and open fragment.
  	frag := v.newFragment(v.fragmentPath(shard), shard)
  	if err := frag.Open(); err != nil {
  		return nil, errors.Wrap(err, "opening fragment")
  	}
  	frag.RowAttrStore = v.rowAttrStore
  
  	v.fragments[shard] = frag
  	broadcastChan := make(chan struct{})
  
  	go func() {
  		msg := &CreateShardMessage{
  			Index: v.index,
  			Field: v.field,
  			Shard: shard,
  		}
  		// Broadcast a message that a new max shard was just created.
  		err := v.broadcaster.SendSync(msg)
  		if err != nil {
  			v.logger.Printf("broadcasting create shard: %v", err)
  		}
  		close(broadcastChan)
  	}()
  
  	// We want to wait until the broadcast is complete, but what if it
  	// takes a really long time? So we time out.
  	select {
  	case <-broadcastChan:
  	case <-time.After(50 * time.Millisecond):
  		v.logger.Debugf("broadcasting create shard took >50ms")
  	}
  
  	return frag, nil
  }
docs: // CreateFragmentIfNotExists returns a fragment in the view by shard.