Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f2a27e0e
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f2a27e0e
编写于
5月 26, 2022
作者:
L
Letian Jiang
提交者:
GitHub
5月 26, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Retry GetShardLeaders until service available or timeout (#17183)
Signed-off-by:
N
Letian Jiang
<
letian.jiang@zilliz.com
>
上级
5872c5af
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
208 addition
and
183 deletion
+208
-183
internal/core/src/pb/common.pb.cc
internal/core/src/pb/common.pb.cc
+58
-57
internal/core/src/pb/common.pb.h
internal/core/src/pb/common.pb.h
+1
-0
internal/proto/common.proto
internal/proto/common.proto
+1
-0
internal/proto/commonpb/common.pb.go
internal/proto/commonpb/common.pb.go
+122
-118
internal/proxy/meta_cache.go
internal/proxy/meta_cache.go
+22
-5
internal/querycoord/impl.go
internal/querycoord/impl.go
+1
-1
internal/querycoord/impl_test.go
internal/querycoord/impl_test.go
+3
-2
未找到文件。
internal/core/src/pb/common.pb.cc
浏览文件 @
f2a27e0e
...
...
@@ -326,7 +326,7 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"eader
\022
*
\n\004
base
\030\001
\001
(
\013
2
\034
.milvus.proto.commo"
"n.MsgBase
\"
M
\n\014
DMLMsgHeader
\022
*
\n\004
base
\030\001
\001
(
\013
2"
"
\034
.milvus.proto.common.MsgBase
\022\021\n\t
shardNa"
"me
\030\002
\001
(
\t
*
\2
2
2\006\n\t
ErrorCode
\022\013\n\007
Success
\020\000\022\023\n\017
U"
"me
\030\002
\001
(
\t
*
\2
5
2\006\n\t
ErrorCode
\022\013\n\007
Success
\020\000\022\023\n\017
U"
"nexpectedError
\020\001\022\021\n\r
ConnectFailed
\020\002\022\024\n\020
P"
"ermissionDenied
\020\003\022\027\n\023
CollectionNotExists"
"
\020\004\022\023\n\017
IllegalArgument
\020\005\022\024\n\020
IllegalDimens"
...
...
@@ -345,61 +345,61 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"ilure
\020\035\022\033\n\027
UpdateCredentialFailure
\020\036\022\033\n\027
"
"DeleteCredentialFailure
\020\037\022\030\n\024
GetCredenti"
"alFailure
\020
\022\030\n\024
ListCredUsersFailure
\020
!
\022\022\n
"
"
\016
NotShardLeader
\020\"\022\02
2\n\r
DDRequestRace
\020\350\007
*X
\n
"
"
\n
IndexState
\022\022\n\016
IndexStateNone
\020\000\022\014\n\010
Uniss
"
"
ued
\020\001\022\016\n\n
InProgress
\020\002\022\014\n\010
Finished
\020\003\022\n\n\006
F
"
"
ailed
\020\004
*
\202\001\n\014
SegmentState
\022\024\n\020
SegmentState
"
"
None
\020\000\022\014\n\010
NotExist
\020\001\022\013\n\007
Growing
\020\002\022\n\n\006
Sea
"
"
led
\020\003\022\013\n\007
Flushed
\020\004\022\014\n\010
Flushing
\020\005\022\013\n\007
Drop
"
"
ped
\020\006\022\r\n\t
Importing
\020\007
*>
\n\017
PlaceholderType
\022
"
"
\010\n\004
None
\020\000\022\020\n\014
BinaryVector
\020
d
\022\017\n\013
FloatVect
"
"
or
\020
e*
\362\n\n\007
MsgType
\022\r\n\t
Undefined
\020\000\022\024\n\020
Creat
"
"
eCollection
\020
d
\022\022\n\016
DropCollection
\020
e
\022\021\n\r
Has
"
"
Collection
\020
f
\022\026\n\022
DescribeCollection
\020
g
\022\023\n\017
"
"
ShowCollections
\020
h
\022\024\n\020
GetSystemConfigs
\020
i
\022
"
"
\022\n\016
LoadCollection
\020
j
\022\025\n\021
ReleaseCollection
"
"
\020
k
\022\017\n\013
CreateAlias
\020
l
\022\r\n\t
DropAlias
\020
m
\022\016\n\n
Al
"
"
terAlias
\020
n
\022\024\n\017
CreatePartition
\020\310\001\022\022\n\r
Drop
"
"
Partition
\020\311\001\022\021\n\014
HasPartition
\020\312\001\022\026\n\021
Descr
"
"
ibePartition
\020\313\001\022\023\n\016
ShowPartitions
\020\314\001\022\023\n\016
"
"
LoadPartitions
\020\315\001\022\026\n\021
ReleasePartitions
\020\316
"
"
\001\022\02
1\n\014
ShowSegments
\020\372\001\022\024\n\017
DescribeSegment
\020
"
"
\373\001\022\021\n\014
LoadSegments
\020\374\001\022\024\n\017
ReleaseSegments
"
"
\020\375\001\022\024\n\017
HandoffSegments
\020\376\001\022\030\n\023
LoadBalanc
e"
"
Segments
\020\377\001\022\025\n\020
DescribeSegments
\020\200\002\022\020\n\013
Cr
"
"e
ateIndex
\020\254\002\022\022\n\r
DescribeIndex
\020\255\002\022\016\n\t
Drop
"
"
Index
\020\256\002\022\013\n\006
Insert
\020\220\003\022\013\n\006
Delete
\020\221\003\022\n\n\005
Fl
"
"
ush
\020\222\003\022\027\n\022
ResendSegmentStats
\020\223\003\022\013\n\006
Searc
"
"
h
\020\364\003\022\021\n\014
SearchResult
\020\365\003\022\022\n\r
GetIndexStat
e"
"
\020\366\003\022\032\n\025
GetIndexBuildProgress
\020\367\003\022\034\n\027
GetCo
"
"
llectionStatistics
\020\370\003\022\033\n\026
GetPartitionSta
"
"
tistics
\020\371\003\022\r\n\010
Retrieve
\020\372\003\022\023\n\016
RetrieveRes
"
"
ult
\020\373\003\022\024\n\017
WatchDmChannels
\020\374\003\022\025\n\020
RemoveDm
"
"
Channels
\020\375\003\022\027\n\022
WatchQueryChannels
\020\376\003\022\030\n\023
"
"
RemoveQueryChannels
\020\377\003\022\035\n\030
SealedSegments
"
"
ChangeInfo
\020\200\004\022\027\n\022
WatchDeltaChannels
\020\201\004\022\024
"
"
\
n\017
GetShardLeaders
\020\202\004\022\020\n\013
GetReplicas
\020\203\004\022\020
"
"
\n\013
SegmentInfo
\020\330\004\022\017\n\n
SystemInfo
\020\331\004\022\024\n\017
Get
"
"
RecoveryInfo
\020\332\004\022\024\n\017
GetSegmentState
\020\333\004\022\r\n
"
"
\0
10
TimeTick
\020\260\t\022\023\n\016
QueryNodeStats
\020\261\t\022\016\n\t
Loa
"
"
dIndex
\020\262\t\022\016\n\t
RequestID
\020\263\t\022\017\n\n
RequestTSO
\020
"
"
\264\t\022\024\n\017
AllocateSegment
\020\265\t\022\026\n\021
SegmentStati
"
"
stics
\020\266\t\022\025\n\020
SegmentFlushDone
\020\267\t\022\017\n\n
DataN
"
"
odeTt
\020\270\t\022\025\n\020
CreateCredential
\020\334\013\022\022\n\r
GetCr
"
"
edential
\020\335\013\022\025\n\020
DeleteCredential
\020\336\013\022\025\n\020
Up
"
"
dateCredential
\020\337\013\022\026\n\021
ListCredUsernames
\020\340
"
"
\013
*
\"\n\007
DslType
\022\007\n\003
Dsl
\020\000\022\016\n\n
BoolExprV1
\020\001
*B
\n
"
"
\017
CompactionState
\022\021\n\r
UndefiedState
\020\000\022\r\n\t
E
"
"
xecuting
\020\001\022\r\n\t
Completed
\020\002
*X
\n\020
Consistency
"
"
Level
\022\n\n\006
Strong
\020\000\022\013\n\007
Session
\020\001\022\013\n\007
Bounde
"
"
d
\020\002\022\016\n\n
Eventually
\020\003\022\016\n\n
Customized
\020\004
*
\227\001\n\013
"
"
ImportState
\022\021\n\r
ImportPending
\020\000\022\020\n\014
Import
"
"
Failed
\020\001\022\021\n\r
ImportStarted
\020\002\022\024\n\020
ImportDow
"
"
nloaded
\020\003\022\020\n\014
ImportParsed
\020\004\022\023\n\017
ImportPer
"
"
sisted
\020\005\022\023\n\017
ImportCompleted
\020\006
BW
\n\016
io.milv
"
"
us.grpcB
\013
CommonProtoP
\001
Z3github.com/milvu
"
"
s-io/milvus/internal/proto/commonpb
\240\001\001
b
\006
"
"proto3"
"
\016
NotShardLeader
\020\"\022\02
6\n\022
NoReplicaAvailable
\020
"
"
#
\022\022\n\r
DDRequestRace
\020\350\007
*X
\n\n
IndexState
\022\022\n\016
I
"
"
ndexStateNone
\020\000\022\014\n\010
Unissued
\020\001\022\016\n\n
InProgr
"
"
ess
\020\002\022\014\n\010
Finished
\020\003\022\n\n\006
Failed
\020\004
*
\202\001\n\014
Segm
"
"
entState
\022\024\n\020
SegmentStateNone
\020\000\022\014\n\010
NotExi
"
"
st
\020\001\022\013\n\007
Growing
\020\002\022\n\n\006
Sealed
\020\003\022\013\n\007
Flushed
"
"
\020\004\022\014\n\010
Flushing
\020\005\022\013\n\007
Dropped
\020\006\022\r\n\t
Importi
"
"
ng
\020\007
*>
\n\017
PlaceholderType
\022\010\n\004
None
\020\000\022\020\n\014
Bin
"
"
aryVector
\020
d
\022\017\n\013
FloatVector
\020
e*
\362\n\n\007
MsgType
"
"
\022\r\n\t
Undefined
\020\000\022\024\n\020
CreateCollection
\020
d
\022\022\n
"
"
\016
DropCollection
\020
e
\022\021\n\r
HasCollection
\020
f
\022\026\n\022
"
"
DescribeCollection
\020
g
\022\023\n\017
ShowCollections
\020
"
"
h
\022\024\n\020
GetSystemConfigs
\020
i
\022\022\n\016
LoadCollectio
"
"
n
\020
j
\022\025\n\021
ReleaseCollection
\020
k
\022\017\n\013
CreateAlia
"
"
s
\020
l
\022\r\n\t
DropAlias
\020
m
\022\016\n\n
AlterAlias
\020
n
\022\024\n\017
Cr
"
"
eatePartition
\020\310\001\022\022\n\r
DropPartition
\020\311\001\022\021\n\014
"
"
HasPartition
\020\312\001\022\026\n\021
DescribePartition
\020\313\001\022
"
"
\023\n\016
ShowPartitions
\020\314\001\022\023\n\016
LoadPartitions
\020\315
"
"
\001\022\02
6\n\021
ReleasePartitions
\020\316\001\022\021\n\014
ShowSegment
"
"
s
\020\372\001\022\024\n\017
DescribeSegment
\020\373\001\022\021\n\014
LoadSegmen
"
"
ts
\020\374\001\022\024\n\017
ReleaseSegments
\020\375\001\022\024\n\017
HandoffS
e"
"
gments
\020\376\001\022\030\n\023
LoadBalanceSegments
\020\377\001\022\025\n\020
D
"
"e
scribeSegments
\020\200\002\022\020\n\013
CreateIndex
\020\254\002\022\022\n\r
"
"
DescribeIndex
\020\255\002\022\016\n\t
DropIndex
\020\256\002\022\013\n\006
Inse
"
"
rt
\020\220\003\022\013\n\006
Delete
\020\221\003\022\n\n\005
Flush
\020\222\003\022\027\n\022
Resend
"
"
SegmentStats
\020\223\003\022\013\n\006
Search
\020\364\003\022\021\n\014
SearchR
e"
"
sult
\020\365\003\022\022\n\r
GetIndexState
\020\366\003\022\032\n\025
GetIndexB
"
"
uildProgress
\020\367\003\022\034\n\027
GetCollectionStatisti
"
"
cs
\020\370\003\022\033\n\026
GetPartitionStatistics
\020\371\003\022\r\n\010
Re
"
"
trieve
\020\372\003\022\023\n\016
RetrieveResult
\020\373\003\022\024\n\017
WatchD
"
"
mChannels
\020\374\003\022\025\n\020
RemoveDmChannels
\020\375\003\022\027\n\022
W
"
"
atchQueryChannels
\020\376\003\022\030\n\023
RemoveQueryChann
"
"
els
\020\377\003\022\035\n\030
SealedSegmentsChangeInfo
\020\200\004\022\027\n
"
"
\
022
WatchDeltaChannels
\020\201\004\022\024\n\017
GetShardLeader
"
"
s
\020\202\004\022\020\n\013
GetReplicas
\020\203\004\022\020\n\013
SegmentInfo
\020\330\004
"
"
\022\017\n\n
SystemInfo
\020\331\004\022\024\n\017
GetRecoveryInfo
\020\332\004\022
"
"
\0
24\n\017
GetSegmentState
\020\333\004\022\r\n\010
TimeTick
\020\260\t\022\023\n\016
"
"
QueryNodeStats
\020\261\t\022\016\n\t
LoadIndex
\020\262\t\022\016\n\t
Req
"
"
uestID
\020\263\t\022\017\n\n
RequestTSO
\020\264\t\022\024\n\017
AllocateSe
"
"
gment
\020\265\t\022\026\n\021
SegmentStatistics
\020\266\t\022\025\n\020
Segm
"
"
entFlushDone
\020\267\t\022\017\n\n
DataNodeTt
\020\270\t\022\025\n\020
Crea
"
"
teCredential
\020\334\013\022\022\n\r
GetCredential
\020\335\013\022\025\n\020
D
"
"
eleteCredential
\020\336\013\022\025\n\020
UpdateCredential
\020\337
"
"
\013
\022\026\n\021
ListCredUsernames
\020\340\013
*
\"\n\007
DslType
\022\007\n\003
"
"
Dsl
\020\000\022\016\n\n
BoolExprV1
\020\001
*B
\n\017
CompactionState
"
"
\022\021\n\r
UndefiedState
\020\000\022\r\n\t
Executing
\020\001\022\r\n\t
Co
"
"
mpleted
\020\002
*X
\n\020
ConsistencyLevel
\022\n\n\006
Strong
\020
"
"
\000\022\013\n\007
Session
\020\001\022\013\n\007
Bounded
\020\002\022\016\n\n
Eventuall
"
"
y
\020\003\022\016\n\n
Customized
\020\004
*
\227\001\n\013
ImportState
\022\021\n\r
I
"
"
mportPending
\020\000\022\020\n\014
ImportFailed
\020\001\022\021\n\r
Impo
"
"
rtStarted
\020\002\022\024\n\020
ImportDownloaded
\020\003\022\020\n\014
Imp
"
"
ortParsed
\020\004\022\023\n\017
ImportPersisted
\020\005\022\023\n\017
Impo
"
"
rtCompleted
\020\006
BW
\n\016
io.milvus.grpcB
\013
CommonP
"
"
rotoP
\001
Z3github.com/milvus-io/milvus/inte
"
"
rnal/proto/commonpb
\240\001\001
b
\006
proto3"
;
static
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
*
const
descriptor_table_common_2eproto_deps
[
1
]
=
{
};
...
...
@@ -418,7 +418,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_com
static
::
PROTOBUF_NAMESPACE_ID
::
internal
::
once_flag
descriptor_table_common_2eproto_once
;
static
bool
descriptor_table_common_2eproto_initialized
=
false
;
const
::
PROTOBUF_NAMESPACE_ID
::
internal
::
DescriptorTable
descriptor_table_common_2eproto
=
{
&
descriptor_table_common_2eproto_initialized
,
descriptor_table_protodef_common_2eproto
,
"common.proto"
,
36
06
,
&
descriptor_table_common_2eproto_initialized
,
descriptor_table_protodef_common_2eproto
,
"common.proto"
,
36
30
,
&
descriptor_table_common_2eproto_once
,
descriptor_table_common_2eproto_sccs
,
descriptor_table_common_2eproto_deps
,
10
,
0
,
schemas
,
file_default_instances
,
TableStruct_common_2eproto
::
offsets
,
file_level_metadata_common_2eproto
,
10
,
file_level_enum_descriptors_common_2eproto
,
file_level_service_descriptors_common_2eproto
,
...
...
@@ -469,6 +469,7 @@ bool ErrorCode_IsValid(int value) {
case
32
:
case
33
:
case
34
:
case
35
:
case
1000
:
return
true
;
default:
...
...
internal/core/src/pb/common.pb.h
浏览文件 @
f2a27e0e
...
...
@@ -142,6 +142,7 @@ enum ErrorCode : int {
GetCredentialFailure
=
32
,
ListCredUsersFailure
=
33
,
NotShardLeader
=
34
,
NoReplicaAvailable
=
35
,
DDRequestRace
=
1000
,
ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_
=
std
::
numeric_limits
<::
PROTOBUF_NAMESPACE_ID
::
int32
>::
min
(),
ErrorCode_INT_MAX_SENTINEL_DO_NOT_USE_
=
std
::
numeric_limits
<::
PROTOBUF_NAMESPACE_ID
::
int32
>::
max
()
...
...
internal/proto/common.proto
浏览文件 @
f2a27e0e
...
...
@@ -43,6 +43,7 @@ enum ErrorCode {
GetCredentialFailure
=
32
;
ListCredUsersFailure
=
33
;
NotShardLeader
=
34
;
NoReplicaAvailable
=
35
;
// internal error code.
DDRequestRace
=
1000
;
...
...
internal/proto/commonpb/common.pb.go
浏览文件 @
f2a27e0e
此差异已折叠。
点击以展开。
internal/proxy/meta_cache.go
浏览文件 @
f2a27e0e
...
...
@@ -22,6 +22,7 @@ import (
"fmt"
"strconv"
"sync"
"time"
"go.uber.org/zap"
...
...
@@ -35,6 +36,7 @@ import (
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
"github.com/milvus-io/milvus/internal/proto/schemapb"
"github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/internal/util/retry"
"github.com/milvus-io/milvus/internal/util/timerecord"
"github.com/milvus-io/milvus/internal/util/typeutil"
)
...
...
@@ -607,12 +609,27 @@ func (m *MetaCache) GetShards(ctx context.Context, withCache bool, collectionNam
},
CollectionID
:
info
.
collID
,
}
resp
,
err
:=
qc
.
GetShardLeaders
(
ctx
,
req
)
// retry until service available or context timeout
var
resp
*
querypb
.
GetShardLeadersResponse
childCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Second
*
10
)
defer
cancel
()
err
=
retry
.
Do
(
childCtx
,
func
()
error
{
resp
,
err
=
qc
.
GetShardLeaders
(
ctx
,
req
)
if
err
!=
nil
{
return
retry
.
Unrecoverable
(
err
)
}
if
resp
.
Status
.
ErrorCode
==
commonpb
.
ErrorCode_Success
{
return
nil
}
// do not retry unless got NoReplicaAvailable from querycoord
if
resp
.
Status
.
ErrorCode
!=
commonpb
.
ErrorCode_NoReplicaAvailable
{
return
retry
.
Unrecoverable
(
fmt
.
Errorf
(
"fail to get shard leaders from QueryCoord: %s"
,
resp
.
Status
.
Reason
))
}
return
fmt
.
Errorf
(
"fail to get shard leaders from QueryCoord: %s"
,
resp
.
Status
.
Reason
)
})
if
err
!=
nil
{
return
nil
,
err
}
if
resp
.
Status
.
ErrorCode
!=
commonpb
.
ErrorCode_Success
{
return
nil
,
fmt
.
Errorf
(
"fail to get shard leaders from QueryCoord: %s"
,
resp
.
Status
.
Reason
)
return
nil
,
fmt
.
Errorf
(
"GetShardLeaders timeout, error: %s"
,
err
.
Error
())
}
shards
:=
parseShardLeaderList2QueryNode
(
resp
.
GetShards
())
...
...
internal/querycoord/impl.go
浏览文件 @
f2a27e0e
...
...
@@ -1205,7 +1205,7 @@ func (qc *QueryCoord) GetShardLeaders(ctx context.Context, req *querypb.GetShard
if
len
(
shardLeaderLists
)
==
0
{
return
&
querypb
.
GetShardLeadersResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_
UnexpectedError
,
ErrorCode
:
commonpb
.
ErrorCode_
NoReplicaAvailable
,
Reason
:
"no replica available"
,
},
},
nil
...
...
internal/querycoord/impl_test.go
浏览文件 @
f2a27e0e
...
...
@@ -23,10 +23,11 @@ import (
"testing"
"time"
"go.uber.org/zap"
"github.com/milvus-io/milvus/internal/common"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/util/sessionutil"
"go.uber.org/zap"
"github.com/stretchr/testify/assert"
...
...
@@ -1695,7 +1696,7 @@ func TestGetShardLeaders(t *testing.T) {
queryCoord
.
cluster
=
mockCluster
resp
,
err
=
queryCoord
.
GetShardLeaders
(
ctx
,
getShardLeadersReq
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
commonpb
.
ErrorCode_
UnexpectedError
,
resp
.
Status
.
ErrorCode
)
assert
.
Equal
(
t
,
commonpb
.
ErrorCode_
NoReplicaAvailable
,
resp
.
Status
.
ErrorCode
)
// TODO(yah01): Disable the unit test case for now,
// restore it after the rebalance between replicas feature is implemented
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录