mirror of https://github.com/milvus-io/milvus.git
Fix rate limit not woring for upsert (#26127)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/26191/head
parent
e13b6b88eb
commit
6472a50349
|
@ -155,7 +155,7 @@ func wrapQuotaError(rt internalpb.RateType, errCode commonpb.ErrorCode, fullMeth
|
|||
func getFailedResponse(req interface{}, rt internalpb.RateType, errCode commonpb.ErrorCode, fullMethod string) interface{} {
|
||||
err := wrapQuotaError(rt, errCode, fullMethod)
|
||||
switch req.(type) {
|
||||
case *milvuspb.InsertRequest, *milvuspb.DeleteRequest:
|
||||
case *milvuspb.InsertRequest, *milvuspb.DeleteRequest, *milvuspb.UpsertRequest:
|
||||
return failedMutationResult(errCode, err.Error())
|
||||
case *milvuspb.ImportRequest:
|
||||
return &milvuspb.ImportResponse{
|
||||
|
|
|
@ -171,6 +171,7 @@ func TestRateLimitInterceptor(t *testing.T) {
|
|||
}
|
||||
|
||||
testGetFailedResponse(&milvuspb.DeleteRequest{}, internalpb.RateType_DMLDelete, commonpb.ErrorCode_ForceDeny, "delete")
|
||||
testGetFailedResponse(&milvuspb.UpsertRequest{}, internalpb.RateType_DMLUpsert, commonpb.ErrorCode_ForceDeny, "upsert")
|
||||
testGetFailedResponse(&milvuspb.ImportRequest{}, internalpb.RateType_DMLBulkLoad, commonpb.ErrorCode_MemoryQuotaExhausted, "import")
|
||||
testGetFailedResponse(&milvuspb.SearchRequest{}, internalpb.RateType_DQLSearch, commonpb.ErrorCode_DiskQuotaExhausted, "search")
|
||||
testGetFailedResponse(&milvuspb.QueryRequest{}, internalpb.RateType_DQLQuery, commonpb.ErrorCode_ForceDeny, "query")
|
||||
|
|
Loading…
Reference in New Issue