mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
Fix misc copylocks and remove exclude rule (#22962)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
52f4de3ad6
commit
8f847884c2
@ -70,8 +70,6 @@ issues:
|
|||||||
- G307
|
- G307
|
||||||
# Use of weak random number generator math/rand
|
# Use of weak random number generator math/rand
|
||||||
- G404
|
- G404
|
||||||
# Exclude copylocks
|
|
||||||
- copylocks
|
|
||||||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
|
||||||
max-issues-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
||||||
|
|||||||
@ -25,15 +25,15 @@ type DocContent struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func collect() []DocContent {
|
func collect() []DocContent {
|
||||||
params := paramtable.ComponentParam{}
|
params := ¶mtable.ComponentParam{}
|
||||||
params.Init()
|
params.Init()
|
||||||
|
|
||||||
val := reflect.ValueOf(params)
|
val := reflect.ValueOf(params).Elem()
|
||||||
data := make([]DocContent, 0)
|
data := make([]DocContent, 0)
|
||||||
keySet := typeutil.NewSet[string]()
|
keySet := typeutil.NewSet[string]()
|
||||||
for i := 0; i < val.NumField(); i++ {
|
for i := 0; i < val.NumField(); i++ {
|
||||||
valueField := val.Field(i)
|
valueField := val.Field(i)
|
||||||
collectRecursive(¶ms, &data, &valueField)
|
collectRecursive(params, &data, &valueField)
|
||||||
}
|
}
|
||||||
result := make([]DocContent, 0)
|
result := make([]DocContent, 0)
|
||||||
for _, d := range data {
|
for _, d := range data {
|
||||||
|
|||||||
@ -211,7 +211,7 @@ func TestFlowGraphManager(t *testing.T) {
|
|||||||
const channelPrefix = "by-dev-rootcoord-dml-test-fg-mgr-execute-"
|
const channelPrefix = "by-dev-rootcoord-dml-test-fg-mgr-execute-"
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.testName, func(t *testing.T) {
|
t.Run(test.testName, func(t *testing.T) {
|
||||||
var baseParams = Params.BaseTable
|
var baseParams = &Params.BaseTable
|
||||||
baseParams.Save(Params.DataNodeCfg.MemoryWatermark.Key, fmt.Sprintf("%f", test.watermark))
|
baseParams.Save(Params.DataNodeCfg.MemoryWatermark.Key, fmt.Sprintf("%f", test.watermark))
|
||||||
for i, memorySize := range test.memorySizes {
|
for i, memorySize := range test.memorySizes {
|
||||||
vchannel := fmt.Sprintf("%s%d", channelPrefix, i)
|
vchannel := fmt.Sprintf("%s%d", channelPrefix, i)
|
||||||
|
|||||||
@ -81,7 +81,7 @@ func TestSyncMemoryTooHigh(t *testing.T) {
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.testName, func(t *testing.T) {
|
t.Run(test.testName, func(t *testing.T) {
|
||||||
var baseParams = Params.BaseTable
|
var baseParams = &Params.BaseTable
|
||||||
baseParams.Save(Params.DataNodeCfg.MemoryForceSyncSegmentNum.Key, fmt.Sprintf("%d", test.syncSegmentNum))
|
baseParams.Save(Params.DataNodeCfg.MemoryForceSyncSegmentNum.Key, fmt.Sprintf("%d", test.syncSegmentNum))
|
||||||
policy := syncMemoryTooHigh()
|
policy := syncMemoryTooHigh()
|
||||||
segments := make([]*Segment, len(test.memorySizesInMB))
|
segments := make([]*Segment, len(test.memorySizesInMB))
|
||||||
|
|||||||
@ -267,7 +267,7 @@ type testIndexNode struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initSession(ctx context.Context) *sessionutil.Session {
|
func initSession(ctx context.Context) *sessionutil.Session {
|
||||||
baseTable := paramtable.Get().BaseTable
|
baseTable := ¶mtable.Get().BaseTable
|
||||||
rootPath, err := baseTable.Load("etcd.rootPath")
|
rootPath, err := baseTable.Load("etcd.rootPath")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type mockIndexNodeComponent struct {
|
type mockIndexNodeComponent struct {
|
||||||
IndexNode
|
*IndexNode
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ types.IndexNodeComponent = &mockIndexNodeComponent{}
|
var _ types.IndexNodeComponent = &mockIndexNodeComponent{}
|
||||||
@ -36,6 +36,6 @@ func NewMockIndexNodeComponent(ctx context.Context) (types.IndexNodeComponent, e
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mockIndexNodeComponent{
|
return &mockIndexNodeComponent{
|
||||||
IndexNode: *node,
|
IndexNode: node,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -444,7 +444,7 @@ var _ MsgStream = (*MqTtMsgStream)(nil)
|
|||||||
|
|
||||||
// MqTtMsgStream is a msgstream that contains timeticks
|
// MqTtMsgStream is a msgstream that contains timeticks
|
||||||
type MqTtMsgStream struct {
|
type MqTtMsgStream struct {
|
||||||
mqMsgStream
|
*mqMsgStream
|
||||||
chanMsgBuf map[mqwrapper.Consumer][]TsMsg
|
chanMsgBuf map[mqwrapper.Consumer][]TsMsg
|
||||||
chanMsgPos map[mqwrapper.Consumer]*msgpb.MsgPosition
|
chanMsgPos map[mqwrapper.Consumer]*msgpb.MsgPosition
|
||||||
chanStopChan map[mqwrapper.Consumer]chan bool
|
chanStopChan map[mqwrapper.Consumer]chan bool
|
||||||
@ -473,7 +473,7 @@ func NewMqTtMsgStream(ctx context.Context,
|
|||||||
syncConsumer := make(chan int, 1)
|
syncConsumer := make(chan int, 1)
|
||||||
|
|
||||||
return &MqTtMsgStream{
|
return &MqTtMsgStream{
|
||||||
mqMsgStream: *msgStream,
|
mqMsgStream: msgStream,
|
||||||
chanMsgBuf: chanMsgBuf,
|
chanMsgBuf: chanMsgBuf,
|
||||||
chanMsgPos: chanMsgPos,
|
chanMsgPos: chanMsgPos,
|
||||||
chanStopChan: chanStopChan,
|
chanStopChan: chanStopChan,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user