[Fixup] error root path for catalog when using tikv (#28163)

Signed-off-by: chyezh <ye.zhen@zilliz.com>
pull/28187/head
chyezh 2023-11-06 12:06:19 +08:00 committed by GitHub
parent f40fb01627
commit 86973a8871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -550,10 +550,13 @@ func (s *Server) initMeta(chunkManager storage.ChunkManager) error {
s.watchClient = etcdkv.NewEtcdKV(s.etcdCli, Params.EtcdCfg.MetaRootPath.GetValue())
metaType := Params.MetaStoreCfg.MetaStoreType.GetValue()
log.Info("data coordinator connecting to metadata store", zap.String("metaType", metaType))
metaRootPath := ""
if metaType == util.MetaStoreTypeTiKV {
s.kv = tikv.NewTiKV(s.tikvCli, Params.TiKVCfg.MetaRootPath.GetValue())
metaRootPath = Params.TiKVCfg.MetaRootPath.GetValue()
s.kv = tikv.NewTiKV(s.tikvCli, metaRootPath)
} else if metaType == util.MetaStoreTypeEtcd {
s.kv = etcdkv.NewEtcdKV(s.etcdCli, Params.EtcdCfg.MetaRootPath.GetValue())
metaRootPath = Params.EtcdCfg.MetaRootPath.GetValue()
s.kv = etcdkv.NewEtcdKV(s.etcdCli, metaRootPath)
} else {
return retry.Unrecoverable(fmt.Errorf("not supported meta store: %s", metaType))
}
@ -561,7 +564,7 @@ func (s *Server) initMeta(chunkManager storage.ChunkManager) error {
reloadEtcdFn := func() error {
var err error
catalog := datacoord.NewCatalog(s.kv, chunkManager.RootPath(), Params.EtcdCfg.MetaRootPath.GetValue())
catalog := datacoord.NewCatalog(s.kv, chunkManager.RootPath(), metaRootPath)
s.meta, err = newMeta(s.ctx, catalog, chunkManager)
if err != nil {
return err