diff --git a/configs/milvus.yaml b/configs/milvus.yaml index 8c45cc8809..e03615195d 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -1039,7 +1039,6 @@ common: enableConfigParamTypeCheck: true # Indicates whether to enable config param type check enablePosixMode: false # Specifies whether to run in POSIX mode for enhanced file system compatibility UsingJSONStatsForQuery: true # Indicates whether to use json stats when query - clusterID: 0 # cluster id # QuotaConfig, configurations of Milvus quota and limits. # By default, we enable: diff --git a/internal/datacoord/import_util.go b/internal/datacoord/import_util.go index 48324b2537..a9c2e58ba5 100644 --- a/internal/datacoord/import_util.go +++ b/internal/datacoord/import_util.go @@ -35,7 +35,6 @@ import ( "github.com/milvus-io/milvus/internal/datacoord/session" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/util/importutilv2" - "github.com/milvus-io/milvus/pkg/v2/common" "github.com/milvus-io/milvus/pkg/v2/log" "github.com/milvus-io/milvus/pkg/v2/proto/datapb" "github.com/milvus-io/milvus/pkg/v2/proto/internalpb" @@ -339,10 +338,7 @@ func AssembleImportRequest(task ImportTask, job ImportJob, meta *meta, alloc all expansionFactor := paramtable.Get().DataCoordCfg.ImportPreAllocIDExpansionFactor.GetAsInt64() preAllocIDNum := (totalRows + 1) * int64(binlogNum) * expansionFactor - idBegin, idEnd, err := common.AllocAutoID(func(n uint32) (int64, int64, error) { - ids, ide, e := alloc.AllocN(int64(n)) - return int64(ids), int64(ide), e - }, uint32(preAllocIDNum), Params.CommonCfg.ClusterID.GetAsUint64()) + idBegin, idEnd, err := alloc.AllocN(preAllocIDNum) if err != nil { return nil, err } diff --git a/internal/proxy/task_insert.go b/internal/proxy/task_insert.go index fdd4f79297..3168084cf6 100644 --- a/internal/proxy/task_insert.go +++ b/internal/proxy/task_insert.go @@ -12,7 +12,6 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/util/function/embedding" - "github.com/milvus-io/milvus/pkg/v2/common" "github.com/milvus-io/milvus/pkg/v2/log" "github.com/milvus-io/milvus/pkg/v2/metrics" "github.com/milvus-io/milvus/pkg/v2/util/commonpbutil" @@ -184,8 +183,7 @@ func (it *insertTask) PreExecute(ctx context.Context) error { var rowIDBegin UniqueID var rowIDEnd UniqueID tr := timerecord.NewTimeRecorder("applyPK") - clusterID := Params.CommonCfg.ClusterID.GetAsUint64() - rowIDBegin, rowIDEnd, _ = common.AllocAutoID(it.idAllocator.Alloc, rowNums, clusterID) + rowIDBegin, rowIDEnd, _ = it.idAllocator.Alloc(rowNums) metrics.ProxyApplyPrimaryKeyLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10)).Observe(float64(tr.ElapseSpan().Milliseconds())) it.insertMsg.RowIDs = make([]UniqueID, rowNums) diff --git a/internal/proxy/task_upsert.go b/internal/proxy/task_upsert.go index 6143ab4211..cd3fcd64de 100644 --- a/internal/proxy/task_upsert.go +++ b/internal/proxy/task_upsert.go @@ -767,8 +767,7 @@ func (it *upsertTask) insertPreExecute(ctx context.Context) error { rowNums := uint32(it.upsertMsg.InsertMsg.NRows()) // set upsertTask.insertRequest.rowIDs tr := timerecord.NewTimeRecorder("applyPK") - clusterID := Params.CommonCfg.ClusterID.GetAsUint64() - rowIDBegin, rowIDEnd, _ := common.AllocAutoID(it.idAllocator.Alloc, rowNums, clusterID) + rowIDBegin, rowIDEnd, _ := it.idAllocator.Alloc(rowNums) metrics.ProxyApplyPrimaryKeyLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10)).Observe(float64(tr.ElapseSpan().Milliseconds())) it.upsertMsg.InsertMsg.RowIDs = make([]UniqueID, rowNums) diff --git a/pkg/common/common.go b/pkg/common/common.go index b7d0196d4c..31e6f1fe82 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -19,7 +19,6 @@ package common import ( "encoding/binary" "fmt" - "math/bits" "strconv" "strings" @@ -516,15 +515,3 @@ func ParseNamespaceProp(props ...*commonpb.KeyValuePair) (value bool, has bool, } return false, false, nil } - -func AllocAutoID(allocFunc func(uint32) (int64, int64, error), rowNum uint32, clusterID uint64) (int64, int64, error) { - idStart, idEnd, err := allocFunc(rowNum) - if err != nil { - return 0, 0, err - } - reversed := bits.Reverse64(clusterID) - // right shift by 1 to preserve sign bit - reversed = reversed >> 1 - - return idStart | int64(reversed), idEnd | int64(reversed), nil -} diff --git a/pkg/common/common_test.go b/pkg/common/common_test.go index 90655c08f9..868090b659 100644 --- a/pkg/common/common_test.go +++ b/pkg/common/common_test.go @@ -288,12 +288,3 @@ func TestIsEnableDynamicSchema(t *testing.T) { }) } } - -func TestAllocAutoID(t *testing.T) { - start, end, err := AllocAutoID(func(n uint32) (int64, int64, error) { - return 100, 110, nil - }, 10, 1) - assert.NoError(t, err) - assert.EqualValues(t, 0b0100, start>>60) - assert.EqualValues(t, 0b0100, end>>60) -} diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index 6fa7f962c0..2735df9122 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -57,7 +57,6 @@ const ( DefaultSearchCacheBudgetGBRatio = 0.10 DefaultLoadNumThreadRatio = 8.0 DefaultBeamWidthRatio = 4.0 - MaxClusterIDBits = 3 ) // ComponentParam is used to quickly and easily access all components' configurations. @@ -329,7 +328,6 @@ type commonConfig struct { EnablePosixMode ParamItem `refreshable:"false"` UsingJSONStatsForQuery ParamItem `refreshable:"true"` - ClusterID ParamItem `refreshable:"false"` } func (p *commonConfig) init(base *BaseTable) { @@ -1250,26 +1248,6 @@ This helps Milvus-CDC synchronize incremental data`, Export: true, } p.EnablePosixMode.Init(base.mgr) - - p.ClusterID = ParamItem{ - Key: "common.clusterID", - Version: "2.6.3", - DefaultValue: "0", - Doc: "cluster id", - Export: true, - PanicIfEmpty: true, - Formatter: func(v string) string { - if getAsInt(v) < 0 { - return "" - } - maxClusterID := (int64(1) << MaxClusterIDBits) - 1 - if getAsInt64(v) > maxClusterID { - return "" - } - return v - }, - } - p.ClusterID.Init(base.mgr) } type gpuConfig struct { diff --git a/pkg/util/paramtable/component_param_test.go b/pkg/util/paramtable/component_param_test.go index 79e6b3d3e5..fef1f7216f 100644 --- a/pkg/util/paramtable/component_param_test.go +++ b/pkg/util/paramtable/component_param_test.go @@ -146,13 +146,6 @@ func TestComponentParam(t *testing.T) { assert.Equal(t, 1, params.CommonCfg.StorageZstdConcurrency.GetAsInt()) params.Save("common.storage.zstd.concurrency", "2") assert.Equal(t, 2, params.CommonCfg.StorageZstdConcurrency.GetAsInt()) - - assert.Equal(t, 0, params.CommonCfg.ClusterID.GetAsInt()) - params.Save("common.clusterID", "32") - assert.Panics(t, func() { - params.CommonCfg.ClusterID.GetAsInt() - }) - params.Save("common.clusterID", "0") }) t.Run("test rootCoordConfig", func(t *testing.T) {