mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
In quota center, ignore the "DB not found error" to prevent it from affecting the rate limiting of other databases. /kind improvement pr: https://github.com/milvus-io/milvus/pull/36821 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
85ce66843b
commit
f8d9c24256
@ -571,7 +571,8 @@ func (q *QuotaCenter) forceDenyWriting(errorCode commonpb.ErrorCode, cluster boo
|
|||||||
for _, collectionID := range collectionIDs {
|
for _, collectionID := range collectionIDs {
|
||||||
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
||||||
if !ok {
|
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)
|
collectionLimiter := q.rateLimiter.GetCollectionLimiters(dbID, collectionID)
|
||||||
if collectionLimiter == nil {
|
if collectionLimiter == nil {
|
||||||
@ -588,7 +589,8 @@ func (q *QuotaCenter) forceDenyWriting(errorCode commonpb.ErrorCode, cluster boo
|
|||||||
for _, partitionID := range partitionIDs {
|
for _, partitionID := range partitionIDs {
|
||||||
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
dbID, ok := q.collectionIDToDBID.Get(collectionID)
|
||||||
if !ok {
|
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)
|
partitionLimiter := q.rateLimiter.GetPartitionLimiters(dbID, collectionID, partitionID)
|
||||||
if partitionLimiter == nil {
|
if partitionLimiter == nil {
|
||||||
@ -778,7 +780,8 @@ func (q *QuotaCenter) calculateWriteRates() error {
|
|||||||
|
|
||||||
dbID, ok := q.collectionIDToDBID.Get(collection)
|
dbID, ok := q.collectionIDToDBID.Get(collection)
|
||||||
if !ok {
|
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)
|
collectionLimiter := q.rateLimiter.GetCollectionLimiters(dbID, collection)
|
||||||
if collectionLimiter == nil {
|
if collectionLimiter == nil {
|
||||||
@ -1230,7 +1233,7 @@ func (q *QuotaCenter) checkDiskQuota(denyWritingDBs map[int64]struct{}) error {
|
|||||||
}
|
}
|
||||||
dbID, ok := q.collectionIDToDBID.Get(collection)
|
dbID, ok := q.collectionIDToDBID.Get(collection)
|
||||||
if !ok {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ func TestQuotaCenter(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
err = quotaCenter.forceDenyWriting(commonpb.ErrorCode_ForceDeny, false, nil, []int64{4}, nil)
|
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{
|
err = quotaCenter.forceDenyWriting(commonpb.ErrorCode_ForceDeny, false, nil, []int64{1, 2, 3}, map[int64][]int64{
|
||||||
1: {1000},
|
1: {1000},
|
||||||
|
Loading…
Reference in New Issue
Block a user