Skip to content

Commit

Permalink
Fix ReplicaInfo package name (milvus-io#16400)
Browse files Browse the repository at this point in the history
Fix milvus-io#16399
PR 16373 breaks the build after ReplicaInfo moved from querypb to milvuspb
Also fix  problem in Makefile
Limit action/setup-go version to ~1.17.1(>=1.17.1 <1.18.0)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia authored Apr 6, 2022
1 parent 086e896 commit 4cb7c28
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
uses: actions/setup-go@v2.2.0
if: ${{ matrix.os == 'macos-11' }}
with:
go-version: '^1.17.1'
go-version: '~1.17.1'
- name: Mac Cache Go Mod Volumes
if: ${{ matrix.os == 'macos-11' }}
uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cppcheck:
generated-proto-go: export protoc:=${PWD}/cmake_build/thirdparty/protobuf/protobuf-build/protoc
generated-proto-go: build-cpp
@mkdir -p ${GOPATH}/bin
@which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && cd /tmp && go get github.com/golang/protobuf/protoc-gen-go@v1.3.2)
@which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2)
@(env bash $(PWD)/scripts/proto_gen_go.sh)

check-proto-product: generated-proto-go
Expand Down
8 changes: 4 additions & 4 deletions internal/querynode/shard_node_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/golang/protobuf/proto"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/proto/milvuspb"
"go.etcd.io/etcd/api/v3/mvccpb"
v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
clientv3 "go.etcd.io/etcd/client/v3"
Expand Down Expand Up @@ -155,7 +155,7 @@ func (nd *etcdShardNodeDetector) watch(ch clientv3.WatchChan, collectionID, repl

func (nd *etcdShardNodeDetector) handlePutEvent(e *clientv3.Event, collectionID, replicaID int64) {
var err error
var info, prevInfo *querypb.ReplicaInfo
var info, prevInfo *milvuspb.ReplicaInfo
info, err = nd.parseReplicaInfo(e.Kv.Value)
if err != nil {
log.Warn("failed to handle node event", zap.Any("event", e), zap.Error(err))
Expand Down Expand Up @@ -261,8 +261,8 @@ func (nd *etcdShardNodeDetector) handleDelEvent(e *clientv3.Event, collectionID,
}
}

func (nd *etcdShardNodeDetector) parseReplicaInfo(bs []byte) (*querypb.ReplicaInfo, error) {
info := &querypb.ReplicaInfo{}
func (nd *etcdShardNodeDetector) parseReplicaInfo(bs []byte) (*milvuspb.ReplicaInfo, error) {
info := &milvuspb.ReplicaInfo{}
err := proto.Unmarshal(bs, info)
return info, err
}
22 changes: 11 additions & 11 deletions internal/querynode/shard_node_detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"time"

"github.com/golang/protobuf/proto"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/proto/milvuspb"
"github.com/milvus-io/milvus/internal/util/funcutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -73,9 +73,9 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
type testCase struct {
name string
ids []int64
oldRecords map[string]*querypb.ReplicaInfo
oldRecords map[string]*milvuspb.ReplicaInfo
oldGarbage map[string]string
updateRecords map[string]*querypb.ReplicaInfo
updateRecords map[string]*milvuspb.ReplicaInfo
updateGarbage map[string]string
delRecords []string
expectInitEvents []nodeEvent
Expand All @@ -88,7 +88,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "init normal case",
ids: []int64{1, 2},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "normal case with other replica",
ids: []int64{1, 2},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "init normal missing node",
ids: []int64{1},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand All @@ -166,7 +166,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "normal updates",
ids: []int64{1, 2, 3},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand All @@ -180,7 +180,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
eventType: nodeAdd,
},
},
updateRecords: map[string]*querypb.ReplicaInfo{
updateRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "normal updates with other replica",
ids: []int64{1, 2},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand All @@ -232,7 +232,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
eventType: nodeAdd,
},
},
updateRecords: map[string]*querypb.ReplicaInfo{
updateRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestEtcdShardNodeDetector_watch(t *testing.T) {
{
name: "normal deletes",
ids: []int64{1, 2},
oldRecords: map[string]*querypb.ReplicaInfo{
oldRecords: map[string]*milvuspb.ReplicaInfo{
"replica_1": {
CollectionID: 1,
ReplicaID: 1,
Expand Down

0 comments on commit 4cb7c28

Please sign in to comment.