mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
enhance: Ignore db not found error in quota center (#36821)
In quota center, ignore the "DB not found error" to prevent it from affecting the rate limiting of other databases. /kind improvement --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
b0d5866507
commit
1bd3228635
@ -571,7 +571,8 @@ func (q *QuotaCenter) forceDenyWriting(errorCode commonpb.ErrorCode, cluster boo
|
||||
for _, collectionID := range collectionIDs {
|
||||
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
||||
if !ok {
|
||||
return fmt.Errorf("db ID not found of collection ID: %d", collectionID)
|
||||
log.Warn("cannot find db for collection", zap.Int64("collection", collectionID))
|
||||
continue
|
||||
}
|
||||
collectionLimiter := q.rateLimiter.GetCollectionLimiters(dbID, collectionID)
|
||||
if collectionLimiter == nil {
|
||||
@ -588,7 +589,8 @@ func (q *QuotaCenter) forceDenyWriting(errorCode commonpb.ErrorCode, cluster boo
|
||||
for _, partitionID := range partitionIDs {
|
||||
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
||||
if !ok {
|
||||
return fmt.Errorf("db ID not found of collection ID: %d", collectionID)
|
||||
log.Warn("cannot find db for collection", zap.Int64("collection", collectionID))
|
||||
continue
|
||||
}
|
||||
partitionLimiter := q.rateLimiter.GetPartitionLimiters(dbID, collectionID, partitionID)
|
||||
if partitionLimiter == nil {
|
||||
@ -778,7 +780,8 @@ func (q *QuotaCenter) calculateWriteRates() error {
|
||||
|
||||
dbID, ok := q.collectionIDToDBID.Get(collection)
|
||||
if !ok {
|
||||
return fmt.Errorf("db ID not found of collection ID: %d", collection)
|
||||
log.Warn("cannot find db for collection", zap.Int64("collection", collection))
|
||||
continue
|
||||
}
|
||||
collectionLimiter := q.rateLimiter.GetCollectionLimiters(dbID, collection)
|
||||
if collectionLimiter == nil {
|
||||
@ -1230,7 +1233,7 @@ func (q *QuotaCenter) checkDiskQuota(denyWritingDBs map[int64]struct{}) error {
|
||||
}
|
||||
dbID, ok := q.collectionIDToDBID.Get(collection)
|
||||
if !ok {
|
||||
log.Warn("cannot find db id for collection", zap.Int64("collection", collection))
|
||||
log.Warn("cannot find db for collection", zap.Int64("collection", collection))
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ func TestQuotaCenter(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = quotaCenter.forceDenyWriting(commonpb.ErrorCode_ForceDeny, false, nil, []int64{4}, nil)
|
||||
assert.Error(t, err)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = quotaCenter.forceDenyWriting(commonpb.ErrorCode_ForceDeny, false, nil, []int64{1, 2, 3}, map[int64][]int64{
|
||||
1: {1000},
|
||||
|
Loading…
Reference in New Issue
Block a user