code: func (s *TranslateFile) handlePrimaryStoreEvent(ev primaryStoreEvent) error {
  	s.mu.Lock()
  	defer s.mu.Unlock()
  
  	if ev.id == s.primaryID {
  		return nil
  	}
  
  	// Stop translate store replication.
  	close(s.replicationClosing)
  	s.repWG.Wait()
  
  	// Set the primary node for translate store replication.
  	s.logger.Debugf("set primary translate store to %s", ev.id)
  	s.primaryID = ev.id
  	if ev.id == "" {
  		s.PrimaryTranslateStore = nil
  	} else {
  		s.PrimaryTranslateStore = ev.ts
  	}
  
  	// Start translate store replication. Stream from primary, if available.
  	if s.PrimaryTranslateStore != nil {
  		s.replicationClosing = make(chan struct{})
  		s.repWG.Add(1)
  		go func() { defer s.repWG.Done(); s.monitorReplication() }()
  	}
  
  	return nil
  }
docs: // handlePrimaryStoreEvent changes the PrimaryTranslateStore
  // used for replication by TranslateFile.