mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
fix: Use SliceSetEqual to compare load field list (#36051)
Related to #36037 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
c916407f37
commit
c0c12c6c5b
@ -19,7 +19,6 @@ package job
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/cockroachdb/errors"
|
||||
@ -36,6 +35,7 @@ import (
|
||||
"github.com/milvus-io/milvus/pkg/eventlog"
|
||||
"github.com/milvus-io/milvus/pkg/log"
|
||||
"github.com/milvus-io/milvus/pkg/metrics"
|
||||
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
||||
"github.com/milvus-io/milvus/pkg/util/merr"
|
||||
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
||||
)
|
||||
@ -105,7 +105,7 @@ func (job *LoadCollectionJob) PreExecute() error {
|
||||
return merr.WrapErrParameterInvalid(collection.GetReplicaNumber(), req.GetReplicaNumber(), "can't change the replica number for loaded collection")
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(collection.GetLoadFields(), req.GetLoadFields()) {
|
||||
if !funcutil.SliceSetEqual(collection.GetLoadFields(), req.GetLoadFields()) {
|
||||
log.Warn("collection with different load field list exists, release this collection first before chaning its replica number",
|
||||
zap.Int64s("loadedFieldIDs", collection.GetLoadFields()),
|
||||
zap.Int64s("reqFieldIDs", req.GetLoadFields()),
|
||||
@ -298,7 +298,7 @@ func (job *LoadPartitionJob) PreExecute() error {
|
||||
return merr.WrapErrParameterInvalid(collection.GetReplicaNumber(), req.GetReplicaNumber(), "can't change the replica number for loaded partitions")
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(collection.GetLoadFields(), req.GetLoadFields()) {
|
||||
if !funcutil.SliceSetEqual(collection.GetLoadFields(), req.GetLoadFields()) {
|
||||
log.Warn("collection with different load field list exists, release this collection first before chaning its replica number",
|
||||
zap.Int64s("loadedFieldIDs", collection.GetLoadFields()),
|
||||
zap.Int64s("reqFieldIDs", req.GetLoadFields()),
|
||||
|
Loading…
Reference in New Issue
Block a user