mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
fix: Fix init rootcoord meta timeout (#38248)
issue: https://github.com/milvus-io/milvus/issues/37630 Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
41b19c6b1d
commit
7a5aea116d
@ -498,6 +498,7 @@ func (kc *Catalog) appendPartitionAndFieldsInfo(ctx context.Context, collMeta *p
|
||||
return collection, nil
|
||||
}
|
||||
|
||||
// TODO: This function will be invoked many times if there are many databases, leading to significant overhead.
|
||||
func (kc *Catalog) batchAppendPartitionAndFieldsInfo(ctx context.Context, collMeta []*pb.CollectionInfo,
|
||||
ts typeutil.Timestamp,
|
||||
) ([]*model.Collection, error) {
|
||||
|
||||
@ -436,18 +436,20 @@ func (ss *SuffixSnapshot) generateSaveExecute(ctx context.Context, kvs map[strin
|
||||
func (ss *SuffixSnapshot) LoadWithPrefix(ctx context.Context, key string, ts typeutil.Timestamp) ([]string, []string, error) {
|
||||
// ts 0 case shall be treated as fetch latest/current value
|
||||
if ts == 0 || ts == typeutil.MaxTimestamp {
|
||||
keys, values, err := ss.MetaKv.LoadWithPrefix(ctx, key)
|
||||
fks := keys[:0] // make([]string, 0, len(keys))
|
||||
fvs := values[:0] // make([]string, 0, len(values))
|
||||
fks := make([]string, 0)
|
||||
fvs := make([]string, 0)
|
||||
// hide rootPrefix from return value
|
||||
for i, k := range keys {
|
||||
applyFn := func(key []byte, value []byte) error {
|
||||
// filters tombstone
|
||||
if ss.isTombstone(values[i]) {
|
||||
continue
|
||||
if ss.isTombstone(string(value)) {
|
||||
return nil
|
||||
}
|
||||
fks = append(fks, ss.hideRootPrefix(k))
|
||||
fvs = append(fvs, values[i])
|
||||
fks = append(fks, ss.hideRootPrefix(string(key)))
|
||||
fvs = append(fvs, string(value))
|
||||
return nil
|
||||
}
|
||||
|
||||
err := ss.MetaKv.WalkWithPrefix(ctx, key, PaginationSize, applyFn)
|
||||
return fks, fvs, err
|
||||
}
|
||||
ss.Lock()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user