mirror of https://github.com/milvus-io/milvus.git
Remove deprecated cacheSize param (#18566)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/18590/head
parent
fcd71930c8
commit
002f509808
|
@ -29,6 +29,7 @@ import (
|
||||||
"github.com/milvus-io/milvus/internal/proto/querypb"
|
"github.com/milvus-io/milvus/internal/proto/querypb"
|
||||||
"github.com/milvus-io/milvus/internal/proto/schemapb"
|
"github.com/milvus-io/milvus/internal/proto/schemapb"
|
||||||
"github.com/milvus-io/milvus/internal/util/funcutil"
|
"github.com/milvus-io/milvus/internal/util/funcutil"
|
||||||
|
"github.com/milvus-io/milvus/internal/util/metricsinfo"
|
||||||
"github.com/milvus-io/milvus/internal/util/typeutil"
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -502,7 +503,7 @@ func TestTask_loadSegmentsTask(t *testing.T) {
|
||||||
node, err := genSimpleQueryNode(ctx)
|
node, err := genSimpleQueryNode(ctx)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
totalRAM := Params.QueryNodeCfg.CacheSize * 1024 * 1024 * 1024
|
totalRAM := int64(metricsinfo.GetMemoryCount())
|
||||||
|
|
||||||
col, err := node.metaReplica.getCollectionByID(defaultCollectionID)
|
col, err := node.metaReplica.getCollectionByID(defaultCollectionID)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
|
@ -13,7 +13,6 @@ package paramtable
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
"os"
|
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -702,8 +701,6 @@ type queryNodeConfig struct {
|
||||||
QueryNodeIP string
|
QueryNodeIP string
|
||||||
QueryNodePort int64
|
QueryNodePort int64
|
||||||
NodeID atomic.Value
|
NodeID atomic.Value
|
||||||
// TODO: remove cacheSize
|
|
||||||
CacheSize int64 // deprecated
|
|
||||||
|
|
||||||
FlowGraphMaxQueueLength int32
|
FlowGraphMaxQueueLength int32
|
||||||
FlowGraphMaxParallelism int32
|
FlowGraphMaxParallelism int32
|
||||||
|
@ -741,7 +738,6 @@ type queryNodeConfig struct {
|
||||||
func (p *queryNodeConfig) init(base *BaseTable) {
|
func (p *queryNodeConfig) init(base *BaseTable) {
|
||||||
p.Base = base
|
p.Base = base
|
||||||
p.NodeID.Store(UniqueID(0))
|
p.NodeID.Store(UniqueID(0))
|
||||||
p.initCacheSize()
|
|
||||||
|
|
||||||
p.initFlowGraphMaxQueueLength()
|
p.initFlowGraphMaxQueueLength()
|
||||||
p.initFlowGraphMaxParallelism()
|
p.initFlowGraphMaxParallelism()
|
||||||
|
@ -770,27 +766,6 @@ func (p *queryNodeConfig) InitAlias(alias string) {
|
||||||
p.Alias = alias
|
p.Alias = alias
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *queryNodeConfig) initCacheSize() {
|
|
||||||
defer log.Debug("init cacheSize", zap.Any("cacheSize (GB)", p.CacheSize))
|
|
||||||
|
|
||||||
const defaultCacheSize = 32 // GB
|
|
||||||
p.CacheSize = defaultCacheSize
|
|
||||||
|
|
||||||
var err error
|
|
||||||
cacheSize := os.Getenv("CACHE_SIZE")
|
|
||||||
if cacheSize == "" {
|
|
||||||
cacheSize, err = p.Base.Load("queryNode.cacheSize")
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
value, err := strconv.ParseInt(cacheSize, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
p.CacheSize = value
|
|
||||||
}
|
|
||||||
|
|
||||||
// advanced params
|
// advanced params
|
||||||
// stats
|
// stats
|
||||||
func (p *queryNodeConfig) initStatsPublishInterval() {
|
func (p *queryNodeConfig) initStatsPublishInterval() {
|
||||||
|
|
|
@ -13,7 +13,6 @@ package paramtable
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
"os"
|
|
||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -215,17 +214,6 @@ func TestComponentParam(t *testing.T) {
|
||||||
t.Run("test queryNodeConfig", func(t *testing.T) {
|
t.Run("test queryNodeConfig", func(t *testing.T) {
|
||||||
Params := CParams.QueryNodeCfg
|
Params := CParams.QueryNodeCfg
|
||||||
|
|
||||||
cacheSize := Params.CacheSize
|
|
||||||
assert.Equal(t, int64(32), cacheSize)
|
|
||||||
err := os.Setenv("CACHE_SIZE", "2")
|
|
||||||
assert.NoError(t, err)
|
|
||||||
Params.initCacheSize()
|
|
||||||
assert.Equal(t, int64(2), Params.CacheSize)
|
|
||||||
err = os.Setenv("CACHE_SIZE", "32")
|
|
||||||
assert.NoError(t, err)
|
|
||||||
Params.initCacheSize()
|
|
||||||
assert.Equal(t, int64(32), Params.CacheSize)
|
|
||||||
|
|
||||||
interval := Params.StatsPublishInterval
|
interval := Params.StatsPublishInterval
|
||||||
assert.Equal(t, 1000, interval)
|
assert.Equal(t, 1000, interval)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue