From edd9e1f0bd2d341dd9fbcf37d969abd0bb074b11 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 1 Jul 2024 14:23:13 +0800 Subject: [PATCH] enhance: Update protobuf-go to protobuf-go v2 Signed-off-by: Wei Liu --- Makefile | 14 +- client/client.go | 2 +- client/collection_options.go | 2 +- client/collection_test.go | 2 +- client/go.mod | 8 +- client/go.sum | 2 - client/read_options.go | 2 +- cmd/milvus/mck.go | 2 +- cmd/tools/datameta/main.go | 2 +- cmd/tools/migration/backend/backup_header.go | 28 -- .../migration/backend/backup_header.pb.go | 203 ++++++++ .../migration/backend/backup_header.proto | 22 + cmd/tools/migration/backend/backup_restore.go | 2 +- .../migration/backend/backup_restore_test.go | 5 +- cmd/tools/migration/backend/etcd210.go | 6 +- cmd/tools/migration/meta/meta210.go | 2 +- cmd/tools/migration/meta/meta220.go | 2 +- go.mod | 2 +- go.sum | 4 +- internal/datacoord/analyze_meta.go | 2 +- internal/datacoord/channel.go | 2 +- internal/datacoord/channel_manager_test.go | 2 +- internal/datacoord/channel_store.go | 2 +- internal/datacoord/channel_store_test.go | 2 +- internal/datacoord/compaction_task_meta.go | 2 +- internal/datacoord/import_job.go | 2 +- internal/datacoord/import_task.go | 2 +- internal/datacoord/index_meta.go | 2 +- internal/datacoord/meta.go | 2 +- internal/datacoord/meta_test.go | 2 +- internal/datacoord/segment_info.go | 2 +- .../compaction/clustering_compactor.go | 2 +- .../distributed/proxy/httpserver/handler.go | 2 +- .../proxy/httpserver/handler_v1.go | 2 +- .../proxy/httpserver/handler_v2.go | 2 +- .../distributed/proxy/httpserver/utils.go | 2 +- .../proxy/httpserver/utils_test.go | 2 +- .../proxy/httpserver/wrap_request.go | 2 +- .../pipeline/flow_graph_dd_node.go | 2 +- .../pipeline/flow_graph_write_node.go | 2 +- internal/metastore/kv/binlog/binlog_test.go | 2 +- internal/metastore/kv/datacoord/kv_catalog.go | 2 +- .../metastore/kv/datacoord/kv_catalog_test.go | 8 +- internal/metastore/kv/datacoord/util.go | 2 +- .../metastore/kv/querycoord/kv_catalog.go | 2 +- internal/metastore/kv/rootcoord/kv_catalog.go | 2 +- .../metastore/kv/rootcoord/kv_catalog_test.go | 2 +- .../metastore/kv/streamingcoord/kv_catalog.go | 2 +- internal/metastore/model/index.go | 2 +- internal/proxy/accesslog/info/grpc_info.go | 5 +- internal/proxy/database_interceptor_test.go | 5 +- internal/proxy/impl.go | 2 +- internal/proxy/lb_policy_test.go | 2 +- internal/proxy/msg_pack_test.go | 2 +- internal/proxy/proxy_test.go | 2 +- internal/proxy/rate_limit_interceptor.go | 2 +- internal/proxy/rate_limit_interceptor_test.go | 2 +- internal/proxy/rootcoord_mock_test.go | 2 +- internal/proxy/search_util.go | 2 +- internal/proxy/task.go | 2 +- internal/proxy/task_delete.go | 2 +- internal/proxy/task_query.go | 2 +- internal/proxy/task_query_test.go | 2 +- internal/proxy/task_search.go | 2 +- internal/proxy/task_search_test.go | 2 +- internal/proxy/task_statistic.go | 2 +- internal/proxy/task_statistic_test.go | 2 +- internal/proxy/task_test.go | 2 +- internal/querycoordv2/dist/dist_handler.go | 2 +- .../querycoordv2/meta/channel_dist_manager.go | 2 +- .../querycoordv2/meta/collection_manager.go | 2 +- internal/querycoordv2/meta/replica.go | 2 +- .../querycoordv2/meta/replica_manager_test.go | 2 +- internal/querycoordv2/meta/resource_group.go | 2 +- .../querycoordv2/meta/resource_manager.go | 2 +- .../querycoordv2/meta/segment_dist_manager.go | 2 +- internal/querycoordv2/session/cluster.go | 2 +- internal/querycoordv2/session/cluster_test.go | 1 + internal/querycoordv2/utils/types_test.go | 2 +- internal/querynodev2/delegator/delegator.go | 2 +- .../querynodev2/delegator/segment_pruner.go | 2 +- .../delegator/segment_pruner_test.go | 2 +- internal/querynodev2/mock_data.go | 2 +- internal/querynodev2/optimizers/query_hook.go | 2 +- .../querynodev2/optimizers/query_hook_test.go | 2 +- internal/querynodev2/segments/cgo_util.go | 2 +- internal/querynodev2/segments/collection.go | 2 +- .../querynodev2/segments/load_index_info.go | 2 +- internal/querynodev2/segments/mock_data.go | 6 +- internal/querynodev2/segments/plan_test.go | 2 +- internal/querynodev2/segments/reduce_test.go | 6 +- internal/querynodev2/segments/result.go | 2 +- internal/querynodev2/segments/segment.go | 2 +- internal/querynodev2/services.go | 2 +- internal/querynodev2/services_test.go | 2 +- internal/querynodev2/tasks/search_task.go | 2 +- .../querynodev2/tasks/search_task_test.go | 2 +- internal/rootcoord/create_collection_task.go | 2 +- .../rootcoord/create_collection_task_test.go | 2 +- internal/storage/insert_data.go | 3 +- internal/storage/payload_reader.go | 2 +- internal/storage/payload_writer.go | 2 +- internal/storage/print_binlog.go | 2 +- internal/storage/print_binlog_test.go | 2 +- internal/storage/serde.go | 2 +- internal/storage/utils.go | 2 +- internal/storage/utils_test.go | 2 +- .../server/balancer/channel/pchannel.go | 3 +- internal/util/analyzecgowrapper/analyze.go | 2 +- .../util/indexcgowrapper/build_index_info.go | 2 +- internal/util/indexcgowrapper/index.go | 13 +- .../service/contextutil/create_consumer.go | 2 +- .../contextutil/create_consumer_test.go | 2 +- .../service/contextutil/create_producer.go | 2 +- .../contextutil/create_producer_test.go | 2 +- .../service/lazygrpc/conn_test.go | 2 +- .../streamingutil/service/lazygrpc/service.go | 4 +- internal/util/streamrpc/streamer.go | 2 +- internal/util/typeutil/storage.go | 2 +- pkg/eventlog/event_log.pb.go | 449 +++++++++--------- pkg/eventlog/event_log_grpc.pb.go | 134 ++++++ pkg/go.mod | 2 +- .../mqimpl/rocksmq/client/client_impl_test.go | 2 +- pkg/mq/mqimpl/rocksmq/client/util.go | 2 +- pkg/mq/msgstream/mq_msgstream.go | 2 +- pkg/mq/msgstream/msg.go | 2 +- pkg/mq/msgstream/msg_for_collection.go | 2 +- pkg/mq/msgstream/msg_for_database.go | 2 +- pkg/mq/msgstream/msg_for_index.go | 2 +- pkg/mq/msgstream/msg_for_partition.go | 2 +- pkg/mq/msgstream/unmarshal_test.go | 2 +- pkg/streaming/util/message/builder.go | 2 +- pkg/streaming/util/message/encoder.go | 2 +- pkg/streaming/util/message/message.go | 2 +- .../util/message/specialized_message.go | 2 +- .../impls/pulsar/message_id_data.pb.go | 177 +++++++ .../impls/pulsar/message_id_data.proto | 13 + .../walimpls/impls/pulsar/message_id_test.go | 16 +- pkg/util/funcutil/placeholdergroup.go | 2 +- pkg/util/funcutil/policy.go | 69 ++- pkg/util/typeutil/convension.go | 2 +- pkg/util/typeutil/schema.go | 2 +- pkg/util/typeutil/schema_test.go | 4 +- scripts/generate_proto.sh | 41 +- tests/go_client/go.mod | 2 +- tests/go_client/go.sum | 2 + tests/integration/alias/alias_test.go | 2 +- tests/integration/balance/balance_test.go | 2 +- .../balance/channel_exclusive_balance_test.go | 2 +- .../bloomfilter/bloom_filter_test.go | 2 +- .../channel_balance/channel_balance_test.go | 2 +- .../compaction/clustering_compaction_test.go | 2 +- .../compaction/l0_compaction_test.go | 2 +- .../compaction/mix_compaction_test.go | 2 +- .../search_after_coord_down_test.go | 2 +- .../coordrecovery/coord_recovery_test.go | 2 +- tests/integration/datanode/compaction_test.go | 2 +- tests/integration/datanode/datanode_test.go | 2 +- .../integration/expression/expression_test.go | 2 +- .../integration/getvector/get_vector_test.go | 2 +- .../hellomilvus/hello_milvus_test.go | 2 +- .../hybridsearch/hybridsearch_test.go | 2 +- tests/integration/import/binlog_test.go | 2 +- .../integration/import/dynamic_field_test.go | 2 +- tests/integration/import/import_test.go | 2 +- tests/integration/import/multi_vector_test.go | 2 +- .../integration/import/partition_key_test.go | 2 +- .../indexstat/get_index_statistics_test.go | 2 +- tests/integration/insert/insert_test.go | 2 +- tests/integration/jsonexpr/json_expr_test.go | 2 +- .../materialized_view_test.go | 2 +- tests/integration/meta_watcher.go | 2 +- tests/integration/meta_watcher_test.go | 2 +- .../partialsearch/partial_search_test.go | 2 +- .../partitionkey/partition_key_test.go | 2 +- tests/integration/querynode/querynode_test.go | 2 +- .../rangesearch/range_search_test.go | 2 +- .../refreshconfig/refresh_config_test.go | 2 +- tests/integration/rg/resource_group_test.go | 2 +- .../manual_rolling_upgrade_test.go | 2 +- tests/integration/sparse/sparse_test.go | 2 +- tests/integration/target/target_test.go | 2 +- tests/integration/upsert/upsert_test.go | 2 +- tests/integration/util_collection.go | 2 +- tests/integration/util_query.go | 2 +- 185 files changed, 1058 insertions(+), 507 deletions(-) create mode 100644 cmd/tools/migration/backend/backup_header.pb.go create mode 100644 cmd/tools/migration/backend/backup_header.proto create mode 100644 pkg/eventlog/event_log_grpc.pb.go create mode 100644 pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go create mode 100644 pkg/streaming/walimpls/impls/pulsar/message_id_data.proto diff --git a/Makefile b/Makefile index 7282eb6636062..27b4bf6337ade 100644 --- a/Makefile +++ b/Makefile @@ -225,15 +225,17 @@ build-3rdparty: generated-proto-without-cpp: download-milvus-proto @echo "Generate proto ..." - @mkdir -p ${GOPATH}/bin - @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/generate_proto.sh) + @mkdir -p ${INSTALL_PATH} + @which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && GOBIN=${INSTALL_PATH} go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0) + @which protoc-gen-go-grpc 1>/dev/null || (echo "Installing protoc-gen-go-grpc" && GOBIN=${INSTALL_PATH} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0) + @(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH}) generated-proto: download-milvus-proto build-3rdparty @echo "Generate proto ..." - @mkdir -p ${GOPATH}/bin - @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/generate_proto.sh) + @mkdir -p ${INSTALL_PATH} + @which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && GOBIN=${INSTALL_PATH} go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0) + @which protoc-gen-go-grpc 1>/dev/null || (echo "Installing protoc-gen-go-grpc" && GOBIN=${INSTALL_PATH} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0) + @(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH}) build-cpp: generated-proto @echo "Building Milvus cpp library ..." diff --git a/client/client.go b/client/client.go index 803ef4935ad6e..15d21311b14be 100644 --- a/client/client.go +++ b/client/client.go @@ -26,12 +26,12 @@ import ( "sync" "time" - "github.com/gogo/status" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/collection_options.go b/client/collection_options.go index b4eb9a6d2b180..046a2d21c5027 100644 --- a/client/collection_options.go +++ b/client/collection_options.go @@ -17,7 +17,7 @@ package client import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/collection_test.go b/client/collection_test.go index 2a55a786b8501..0bab40f48335c 100644 --- a/client/collection_test.go +++ b/client/collection_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/go.mod b/client/go.mod index 88169cebfe250..aad9018aaf9f3 100644 --- a/client/go.mod +++ b/client/go.mod @@ -5,8 +5,6 @@ go 1.21 require ( github.com/blang/semver/v4 v4.0.0 github.com/cockroachdb/errors v1.9.1 - github.com/gogo/status v1.1.0 - github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632 github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3 @@ -15,8 +13,8 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/gjson v1.17.1 go.uber.org/atomic v1.10.0 - golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 google.golang.org/grpc v1.57.1 + google.golang.org/protobuf v1.33.0 ) require ( @@ -40,8 +38,8 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect - github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect @@ -109,6 +107,7 @@ require ( go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.20.0 // indirect golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.20.0 // indirect @@ -117,7 +116,6 @@ require ( google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect - google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/client/go.sum b/client/go.sum index a87245b81b272..4937762da52a4 100644 --- a/client/go.sum +++ b/client/go.sum @@ -198,7 +198,6 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -206,7 +205,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff --git a/client/read_options.go b/client/read_options.go index 152061b1a0526..504f2825dd932 100644 --- a/client/read_options.go +++ b/client/read_options.go @@ -20,7 +20,7 @@ import ( "encoding/json" "strconv" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/cmd/milvus/mck.go b/cmd/milvus/mck.go index 5129a67d935b1..b8534eb09c77b 100644 --- a/cmd/milvus/mck.go +++ b/cmd/milvus/mck.go @@ -12,9 +12,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" diff --git a/cmd/tools/datameta/main.go b/cmd/tools/datameta/main.go index d6bdffc35c2cb..9c2e495679c1f 100644 --- a/cmd/tools/datameta/main.go +++ b/cmd/tools/datameta/main.go @@ -6,8 +6,8 @@ import ( "sort" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/cmd/tools/migration/backend/backup_header.go b/cmd/tools/migration/backend/backup_header.go index 59436505ed7cb..483697ea426ad 100644 --- a/cmd/tools/migration/backend/backup_header.go +++ b/cmd/tools/migration/backend/backup_header.go @@ -3,8 +3,6 @@ package backend import ( "encoding/json" - "github.com/golang/protobuf/proto" - "github.com/milvus-io/milvus/cmd/tools/migration/console" ) @@ -14,32 +12,6 @@ const ( BackupHeaderVersionV1 BackupHeaderVersion = iota ) -// BackupHeader stores etcd backup header information -type BackupHeader struct { - // Version number for backup format - Version BackupHeaderVersion `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // instance name, as rootPath for key prefix - Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"` - // MetaPath used in keys - MetaPath string `protobuf:"bytes,3,opt,name=meta_path,proto3" json:"meta_path,omitempty"` - // Entries record number of key-value in backup - Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"` - // Component is the backup target - Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"` - // Extra property reserved - Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"-"` -} - -func (v *BackupHeader) Reset() { - *v = BackupHeader{} -} - -func (v *BackupHeader) String() string { - return proto.CompactTextString(v) -} - -func (v *BackupHeader) ProtoMessage() {} - type BackupHeaderExtra struct { EntryIncludeRootPath bool `json:"entry_include_root_path"` } diff --git a/cmd/tools/migration/backend/backup_header.pb.go b/cmd/tools/migration/backend/backup_header.pb.go new file mode 100644 index 0000000000000..83d9a37541afc --- /dev/null +++ b/cmd/tools/migration/backend/backup_header.pb.go @@ -0,0 +1,203 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.4 +// source: backup_header.proto + +package backend + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BackupHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Version number for backup format + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // instance name, as rootPath for key prefix + Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"` + // MetaPath used in keys + MetaPath string `protobuf:"bytes,3,opt,name=meta_path,json=metaPath,proto3" json:"meta_path,omitempty"` + // Entries record number of key-value in backup + Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"` + // Component is the backup target + Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"` + // Extra property reserved + Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"extra,omitempty"` +} + +func (x *BackupHeader) Reset() { + *x = BackupHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_backup_header_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupHeader) ProtoMessage() {} + +func (x *BackupHeader) ProtoReflect() protoreflect.Message { + mi := &file_backup_header_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackupHeader.ProtoReflect.Descriptor instead. +func (*BackupHeader) Descriptor() ([]byte, []int) { + return file_backup_header_proto_rawDescGZIP(), []int{0} +} + +func (x *BackupHeader) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *BackupHeader) GetInstance() string { + if x != nil { + return x.Instance + } + return "" +} + +func (x *BackupHeader) GetMetaPath() string { + if x != nil { + return x.MetaPath + } + return "" +} + +func (x *BackupHeader) GetEntries() int64 { + if x != nil { + return x.Entries + } + return 0 +} + +func (x *BackupHeader) GetComponent() string { + if x != nil { + return x.Component + } + return "" +} + +func (x *BackupHeader) GetExtra() []byte { + if x != nil { + return x.Extra + } + return nil +} + +var File_backup_header_proto protoreflect.FileDescriptor + +var file_backup_header_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x28, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6d, 0x64, 0x2e, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x22, + 0xaf, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x63, 0x6d, 0x64, 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_backup_header_proto_rawDescOnce sync.Once + file_backup_header_proto_rawDescData = file_backup_header_proto_rawDesc +) + +func file_backup_header_proto_rawDescGZIP() []byte { + file_backup_header_proto_rawDescOnce.Do(func() { + file_backup_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_backup_header_proto_rawDescData) + }) + return file_backup_header_proto_rawDescData +} + +var file_backup_header_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_backup_header_proto_goTypes = []interface{}{ + (*BackupHeader)(nil), // 0: milvus.proto.cmd.tools.migration.backend.BackupHeader +} +var file_backup_header_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_backup_header_proto_init() } +func file_backup_header_proto_init() { + if File_backup_header_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_backup_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_backup_header_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_backup_header_proto_goTypes, + DependencyIndexes: file_backup_header_proto_depIdxs, + MessageInfos: file_backup_header_proto_msgTypes, + }.Build() + File_backup_header_proto = out.File + file_backup_header_proto_rawDesc = nil + file_backup_header_proto_goTypes = nil + file_backup_header_proto_depIdxs = nil +} diff --git a/cmd/tools/migration/backend/backup_header.proto b/cmd/tools/migration/backend/backup_header.proto new file mode 100644 index 0000000000000..fef7f8dc8935e --- /dev/null +++ b/cmd/tools/migration/backend/backup_header.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package milvus.proto.cmd.tools.migration.backend; + + +option go_package = "github.com/milvus-io/milvus/internal/proto/cmd/tools/migration/backend"; + + + +message BackupHeader { + // Version number for backup format + int32 version = 1; + // instance name, as rootPath for key prefix + string instance = 2; + // MetaPath used in keys + string meta_path = 3; + // Entries record number of key-value in backup + int64 entries = 4; + // Component is the backup target + string component = 5; + // Extra property reserved + bytes extra = 6; +} diff --git a/cmd/tools/migration/backend/backup_restore.go b/cmd/tools/migration/backend/backup_restore.go index c21d096cdf1be..59678a3437522 100644 --- a/cmd/tools/migration/backend/backup_restore.go +++ b/cmd/tools/migration/backend/backup_restore.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) diff --git a/cmd/tools/migration/backend/backup_restore_test.go b/cmd/tools/migration/backend/backup_restore_test.go index 847f17ba1b03d..ded76a16fdab9 100644 --- a/cmd/tools/migration/backend/backup_restore_test.go +++ b/cmd/tools/migration/backend/backup_restore_test.go @@ -5,11 +5,12 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/encoding/prototext" ) func TestBackupCodec_Serialize(t *testing.T) { header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: "/by-dev", MetaPath: "meta", Entries: 0, @@ -26,6 +27,6 @@ func TestBackupCodec_Serialize(t *testing.T) { assert.NoError(t, err) gotHeader, gotEntries, err := codec.DeSerialize(file) assert.NoError(t, err) - assert.True(t, reflect.DeepEqual(header, gotHeader)) + assert.Equal(t, prototext.Format(header), prototext.Format(gotHeader)) assert.True(t, reflect.DeepEqual(kvs, gotEntries)) } diff --git a/cmd/tools/migration/backend/etcd210.go b/cmd/tools/migration/backend/etcd210.go index 2aa3a10ed5de0..a4dfa049852f6 100644 --- a/cmd/tools/migration/backend/etcd210.go +++ b/cmd/tools/migration/backend/etcd210.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/cmd/tools/migration/configs" "github.com/milvus-io/milvus/cmd/tools/migration/console" @@ -420,7 +420,7 @@ func (b etcd210) Backup(meta *meta.Meta, backupFile string) error { instance = metaRootPath } header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: instance, MetaPath: metaPath, Entries: int64(len(saves)), @@ -472,7 +472,7 @@ func (b etcd210) BackupV2(file string) error { } header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: instance, MetaPath: metaPath, Entries: int64(len(saves)), diff --git a/cmd/tools/migration/meta/meta210.go b/cmd/tools/migration/meta/meta210.go index 23016210660f9..06cba643d85f1 100644 --- a/cmd/tools/migration/meta/meta210.go +++ b/cmd/tools/migration/meta/meta210.go @@ -3,7 +3,7 @@ package meta import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/cmd/tools/migration/legacy" diff --git a/cmd/tools/migration/meta/meta220.go b/cmd/tools/migration/meta/meta220.go index f190b4061c651..684f773ea2db2 100644 --- a/cmd/tools/migration/meta/meta220.go +++ b/cmd/tools/migration/meta/meta220.go @@ -2,7 +2,7 @@ package meta import ( "github.com/blang/semver/v4" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/cmd/tools/migration/versions" "github.com/milvus-io/milvus/internal/metastore/kv/datacoord" diff --git a/go.mod b/go.mod index 58e4dd650f427..99a731453ebf2 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,6 @@ require ( github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.9.0 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.865 - github.com/tidwall/gjson v1.14.4 github.com/tikv/client-go/v2 v2.0.4 go.etcd.io/etcd/api/v3 v3.5.5 go.etcd.io/etcd/client/v3 v3.5.5 @@ -67,6 +66,7 @@ require ( github.com/milvus-io/milvus/pkg v0.0.0-00010101000000-000000000000 github.com/pkg/errors v0.9.1 github.com/remeh/sizedwaitgroup v1.0.0 + github.com/tidwall/gjson v1.17.1 github.com/valyala/fastjson v1.6.4 github.com/zeebo/xxh3 v1.0.2 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 diff --git a/go.sum b/go.sum index 8ea91cff3ad1b..42c18215e20a3 100644 --- a/go.sum +++ b/go.sum @@ -863,8 +863,8 @@ github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= -github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= -github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= +github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= diff --git a/internal/datacoord/analyze_meta.go b/internal/datacoord/analyze_meta.go index 3e543e2b9cd7f..e53f4a7c5a21f 100644 --- a/internal/datacoord/analyze_meta.go +++ b/internal/datacoord/analyze_meta.go @@ -21,8 +21,8 @@ import ( "fmt" "sync" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/indexpb" diff --git a/internal/datacoord/channel.go b/internal/datacoord/channel.go index e1f45e5f0f14f..6618a6cf22e85 100644 --- a/internal/datacoord/channel.go +++ b/internal/datacoord/channel.go @@ -19,8 +19,8 @@ package datacoord import ( "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datacoord/channel_manager_test.go b/internal/datacoord/channel_manager_test.go index 1e23e5eef3af8..2902309437783 100644 --- a/internal/datacoord/channel_manager_test.go +++ b/internal/datacoord/channel_manager_test.go @@ -22,11 +22,11 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" kvmock "github.com/milvus-io/milvus/internal/kv/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/channel_store.go b/internal/datacoord/channel_store.go index c88163709ed84..cc4140ed65b9d 100644 --- a/internal/datacoord/channel_store.go +++ b/internal/datacoord/channel_store.go @@ -23,10 +23,10 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datacoord/channel_store_test.go b/internal/datacoord/channel_store_test.go index 501d4a9d74bae..0e3ccd37851b9 100644 --- a/internal/datacoord/channel_store_test.go +++ b/internal/datacoord/channel_store_test.go @@ -5,11 +5,11 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/kv/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/compaction_task_meta.go b/internal/datacoord/compaction_task_meta.go index 71b58824c532a..1d31130d255fa 100644 --- a/internal/datacoord/compaction_task_meta.go +++ b/internal/datacoord/compaction_task_meta.go @@ -20,8 +20,8 @@ import ( "context" "sync" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/import_job.go b/internal/datacoord/import_job.go index 5d2da3d81f17a..44048105736dd 100644 --- a/internal/datacoord/import_job.go +++ b/internal/datacoord/import_job.go @@ -19,8 +19,8 @@ package datacoord import ( "time" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datacoord/import_task.go b/internal/datacoord/import_task.go index 82d3c70b2f099..1261cd5854d19 100644 --- a/internal/datacoord/import_task.go +++ b/internal/datacoord/import_task.go @@ -17,7 +17,7 @@ package datacoord import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" ) diff --git a/internal/datacoord/index_meta.go b/internal/datacoord/index_meta.go index ba280769e8b38..58a9175fc2279 100644 --- a/internal/datacoord/index_meta.go +++ b/internal/datacoord/index_meta.go @@ -23,10 +23,10 @@ import ( "strconv" "sync" - "github.com/golang/protobuf/proto" "github.com/prometheus/client_golang/prometheus" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/metastore" diff --git a/internal/datacoord/meta.go b/internal/datacoord/meta.go index 352cf1d7fb6c7..381ade320c529 100644 --- a/internal/datacoord/meta.go +++ b/internal/datacoord/meta.go @@ -26,10 +26,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/datacoord/meta_test.go b/internal/datacoord/meta_test.go index d78540f838e6c..fbf33a791f5c9 100644 --- a/internal/datacoord/meta_test.go +++ b/internal/datacoord/meta_test.go @@ -21,11 +21,11 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/datacoord/segment_info.go b/internal/datacoord/segment_info.go index 17103dae0bd29..592e96a3c1fa7 100644 --- a/internal/datacoord/segment_info.go +++ b/internal/datacoord/segment_info.go @@ -19,10 +19,10 @@ package datacoord import ( "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/datanode/compaction/clustering_compactor.go b/internal/datanode/compaction/clustering_compactor.go index b92902f4a1352..6dfdc509c4a76 100644 --- a/internal/datanode/compaction/clustering_compactor.go +++ b/internal/datanode/compaction/clustering_compactor.go @@ -29,11 +29,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" diff --git a/internal/distributed/proxy/httpserver/handler.go b/internal/distributed/proxy/httpserver/handler.go index 2685448874ec7..6b781181d9d6f 100644 --- a/internal/distributed/proxy/httpserver/handler.go +++ b/internal/distributed/proxy/httpserver/handler.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/types" diff --git a/internal/distributed/proxy/httpserver/handler_v1.go b/internal/distributed/proxy/httpserver/handler_v1.go index 0cdf7deddf380..5e821081b57a5 100644 --- a/internal/distributed/proxy/httpserver/handler_v1.go +++ b/internal/distributed/proxy/httpserver/handler_v1.go @@ -9,10 +9,10 @@ import ( "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" - "github.com/golang/protobuf/proto" "github.com/tidwall/gjson" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/handler_v2.go b/internal/distributed/proxy/httpserver/handler_v2.go index f7a23a1f81ed7..77f8c18deceae 100644 --- a/internal/distributed/proxy/httpserver/handler_v2.go +++ b/internal/distributed/proxy/httpserver/handler_v2.go @@ -13,13 +13,13 @@ import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" validator "github.com/go-playground/validator/v10" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/tidwall/gjson" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/utils.go b/internal/distributed/proxy/httpserver/utils.go index 7a0ce94af7a38..adb37c526b487 100644 --- a/internal/distributed/proxy/httpserver/utils.go +++ b/internal/distributed/proxy/httpserver/utils.go @@ -11,10 +11,10 @@ import ( "strings" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" "github.com/spf13/cast" "github.com/tidwall/gjson" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/utils_test.go b/internal/distributed/proxy/httpserver/utils_test.go index f860bb37fb125..e01958b6574ef 100644 --- a/internal/distributed/proxy/httpserver/utils_test.go +++ b/internal/distributed/proxy/httpserver/utils_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/tidwall/gjson" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/wrap_request.go b/internal/distributed/proxy/httpserver/wrap_request.go index 79d2f0dfa80c4..045dbf13d568e 100644 --- a/internal/distributed/proxy/httpserver/wrap_request.go +++ b/internal/distributed/proxy/httpserver/wrap_request.go @@ -7,7 +7,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/flushcommon/pipeline/flow_graph_dd_node.go b/internal/flushcommon/pipeline/flow_graph_dd_node.go index 6dc596d4ad6f9..688adf5682913 100644 --- a/internal/flushcommon/pipeline/flow_graph_dd_node.go +++ b/internal/flushcommon/pipeline/flow_graph_dd_node.go @@ -22,9 +22,9 @@ import ( "reflect" "sync/atomic" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/flushcommon/pipeline/flow_graph_write_node.go b/internal/flushcommon/pipeline/flow_graph_write_node.go index 910a3ad341205..43870c143c53f 100644 --- a/internal/flushcommon/pipeline/flow_graph_write_node.go +++ b/internal/flushcommon/pipeline/flow_graph_write_node.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/metastore/kv/binlog/binlog_test.go b/internal/metastore/kv/binlog/binlog_test.go index 3c2c5114b5f27..3437ce742540e 100644 --- a/internal/metastore/kv/binlog/binlog_test.go +++ b/internal/metastore/kv/binlog/binlog_test.go @@ -20,8 +20,8 @@ import ( "math/rand" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/metastore/kv/datacoord/kv_catalog.go b/internal/metastore/kv/datacoord/kv_catalog.go index 8904424fd806f..9899b506e3b92 100644 --- a/internal/metastore/kv/datacoord/kv_catalog.go +++ b/internal/metastore/kv/datacoord/kv_catalog.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" "golang.org/x/exp/maps" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/metastore/kv/datacoord/kv_catalog_test.go b/internal/metastore/kv/datacoord/kv_catalog_test.go index f7aaa47ac6b37..3c2e76999e381 100644 --- a/internal/metastore/kv/datacoord/kv_catalog_test.go +++ b/internal/metastore/kv/datacoord/kv_catalog_test.go @@ -27,10 +27,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -1364,7 +1364,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SaveImportJob(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) @@ -1418,7 +1418,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SavePreImportTask(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) @@ -1472,7 +1472,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SaveImportTask(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) diff --git a/internal/metastore/kv/datacoord/util.go b/internal/metastore/kv/datacoord/util.go index 3c57e8e483563..be924c03b0f6b 100644 --- a/internal/metastore/kv/datacoord/util.go +++ b/internal/metastore/kv/datacoord/util.go @@ -19,8 +19,8 @@ package datacoord import ( "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/metastore/kv/querycoord/kv_catalog.go b/internal/metastore/kv/querycoord/kv_catalog.go index 97b141ed154d6..aee78b53928c0 100644 --- a/internal/metastore/kv/querycoord/kv_catalog.go +++ b/internal/metastore/kv/querycoord/kv_catalog.go @@ -6,11 +6,11 @@ import ( "io" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/klauspost/compress/zstd" "github.com/pingcap/log" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/metastore/kv/rootcoord/kv_catalog.go b/internal/metastore/kv/rootcoord/kv_catalog.go index 4c8c59acb3260..566aedc350ccf 100644 --- a/internal/metastore/kv/rootcoord/kv_catalog.go +++ b/internal/metastore/kv/rootcoord/kv_catalog.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/metastore/kv/rootcoord/kv_catalog_test.go b/internal/metastore/kv/rootcoord/kv_catalog_test.go index 347670d046c7e..1d3bbf12c2d0d 100644 --- a/internal/metastore/kv/rootcoord/kv_catalog_test.go +++ b/internal/metastore/kv/rootcoord/kv_catalog_test.go @@ -9,13 +9,13 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/atomic" "go.uber.org/zap" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/metastore/kv/streamingcoord/kv_catalog.go b/internal/metastore/kv/streamingcoord/kv_catalog.go index 0cfb65c18a530..2227e0029530e 100644 --- a/internal/metastore/kv/streamingcoord/kv_catalog.go +++ b/internal/metastore/kv/streamingcoord/kv_catalog.go @@ -4,7 +4,7 @@ import ( "context" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/streamingpb" diff --git a/internal/metastore/model/index.go b/internal/metastore/model/index.go index ffbecd13a5167..1e44ebeb0db86 100644 --- a/internal/metastore/model/index.go +++ b/internal/metastore/model/index.go @@ -1,7 +1,7 @@ package model import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/indexpb" diff --git a/internal/proxy/accesslog/info/grpc_info.go b/internal/proxy/accesslog/info/grpc_info.go index 123adcdd011ed..0b8de20677ca9 100644 --- a/internal/proxy/accesslog/info/grpc_info.go +++ b/internal/proxy/accesslog/info/grpc_info.go @@ -28,14 +28,13 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" - "google.golang.org/protobuf/runtime/protoiface" - "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proxy/connection" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/requestutil" + "google.golang.org/protobuf/proto" ) type GrpcAccessInfo struct { @@ -167,7 +166,7 @@ func (i *GrpcAccessInfo) ResponseSize() string { switch r := i.resp.(type) { case SizeResponse: size = r.XXX_Size() - case protoiface.MessageV1: + case proto.Message: size = proto.Size(r) default: return Unknown diff --git a/internal/proxy/database_interceptor_test.go b/internal/proxy/database_interceptor_test.go index 91bafffb62869..92aad0ad74ef2 100644 --- a/internal/proxy/database_interceptor_test.go +++ b/internal/proxy/database_interceptor_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/pkg/util" @@ -133,7 +134,7 @@ func TestDatabaseInterceptor(t *testing.T) { assert.NoError(t, err) if len(after) != len(before) { - t.Errorf("req has been modified:%s", req.String()) + t.Errorf("req has been modified:%s", prototext.Format(req)) } } }) diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index f85e3c9731b36..72338f939a4f3 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -26,11 +26,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/federpb" diff --git a/internal/proxy/lb_policy_test.go b/internal/proxy/lb_policy_test.go index bf3c32c896de3..86551df24a6d5 100644 --- a/internal/proxy/lb_policy_test.go +++ b/internal/proxy/lb_policy_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/atomic" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/msg_pack_test.go b/internal/proxy/msg_pack_test.go index f41e0516296b7..731edbb7d7b97 100644 --- a/internal/proxy/msg_pack_test.go +++ b/internal/proxy/msg_pack_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 4abdd24597072..5ace8e5108f0d 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" @@ -40,6 +39,7 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/rate_limit_interceptor.go b/internal/proxy/rate_limit_interceptor.go index 0185237ea1b49..c671512b48716 100644 --- a/internal/proxy/rate_limit_interceptor.go +++ b/internal/proxy/rate_limit_interceptor.go @@ -21,9 +21,9 @@ import ( "fmt" "strconv" - "github.com/golang/protobuf/proto" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/proxy/rate_limit_interceptor_test.go b/internal/proxy/rate_limit_interceptor_test.go index 9004bc8d56858..f690f0ccb63f3 100644 --- a/internal/proxy/rate_limit_interceptor_test.go +++ b/internal/proxy/rate_limit_interceptor_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/rootcoord_mock_test.go b/internal/proxy/rootcoord_mock_test.go index 9fc565163abdd..869d163522a41 100644 --- a/internal/proxy/rootcoord_mock_test.go +++ b/internal/proxy/rootcoord_mock_test.go @@ -24,8 +24,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/search_util.go b/internal/proxy/search_util.go index 382dad91c211f..0ea8a4e6d2471 100644 --- a/internal/proxy/search_util.go +++ b/internal/proxy/search_util.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task.go b/internal/proxy/task.go index 7b64ce7d8cf50..d111d631ede19 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -23,8 +23,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_delete.go b/internal/proxy/task_delete.go index c082fb3081225..a41cacd53dea6 100644 --- a/internal/proxy/task_delete.go +++ b/internal/proxy/task_delete.go @@ -6,10 +6,10 @@ import ( "io" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_query.go b/internal/proxy/task_query.go index 60f808e52381d..40fb5c8e2ac52 100644 --- a/internal/proxy/task_query.go +++ b/internal/proxy/task_query.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_query_test.go b/internal/proxy/task_query_test.go index 07631390d7a7b..06d318f6c726a 100644 --- a/internal/proxy/task_query_test.go +++ b/internal/proxy/task_query_test.go @@ -22,11 +22,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index 66f591064dc78..96f61825f61d3 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -7,10 +7,10 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_search_test.go b/internal/proxy/task_search_test.go index 4e3b9c5287c72..07a8d06dad6bd 100644 --- a/internal/proxy/task_search_test.go +++ b/internal/proxy/task_search_test.go @@ -23,12 +23,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_statistic.go b/internal/proxy/task_statistic.go index 20425151fa0d4..09e43b64df506 100644 --- a/internal/proxy/task_statistic.go +++ b/internal/proxy/task_statistic.go @@ -6,9 +6,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_statistic_test.go b/internal/proxy/task_statistic_test.go index 2288d4c23ab79..c3438d0f13465 100644 --- a/internal/proxy/task_statistic_test.go +++ b/internal/proxy/task_statistic_test.go @@ -20,9 +20,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_test.go b/internal/proxy/task_test.go index c85632018c506..a74c2538e984e 100644 --- a/internal/proxy/task_test.go +++ b/internal/proxy/task_test.go @@ -27,10 +27,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querycoordv2/dist/dist_handler.go b/internal/querycoordv2/dist/dist_handler.go index 93253e7c204c6..2a7f35936043b 100644 --- a/internal/querycoordv2/dist/dist_handler.go +++ b/internal/querycoordv2/dist/dist_handler.go @@ -21,9 +21,9 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/querycoordv2/meta/channel_dist_manager.go b/internal/querycoordv2/meta/channel_dist_manager.go index 890e67f30158e..9ecd29d06efe5 100644 --- a/internal/querycoordv2/meta/channel_dist_manager.go +++ b/internal/querycoordv2/meta/channel_dist_manager.go @@ -19,8 +19,8 @@ package meta import ( "sync" - "github.com/golang/protobuf/proto" "github.com/samber/lo" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/util/typeutil" diff --git a/internal/querycoordv2/meta/collection_manager.go b/internal/querycoordv2/meta/collection_manager.go index 4871459812c01..f7fa1a5685a60 100644 --- a/internal/querycoordv2/meta/collection_manager.go +++ b/internal/querycoordv2/meta/collection_manager.go @@ -23,10 +23,10 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/meta/replica.go b/internal/querycoordv2/meta/replica.go index 387dc910d57d1..217dfc7144747 100644 --- a/internal/querycoordv2/meta/replica.go +++ b/internal/querycoordv2/meta/replica.go @@ -1,7 +1,7 @@ package meta import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/querypb" "github.com/milvus-io/milvus/pkg/util/paramtable" diff --git a/internal/querycoordv2/meta/replica_manager_test.go b/internal/querycoordv2/meta/replica_manager_test.go index 36db70a73845c..55d3c471a12c6 100644 --- a/internal/querycoordv2/meta/replica_manager_test.go +++ b/internal/querycoordv2/meta/replica_manager_test.go @@ -19,9 +19,9 @@ package meta import ( "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" diff --git a/internal/querycoordv2/meta/resource_group.go b/internal/querycoordv2/meta/resource_group.go index d1ee0bec45fa6..e9bbd87551652 100644 --- a/internal/querycoordv2/meta/resource_group.go +++ b/internal/querycoordv2/meta/resource_group.go @@ -2,7 +2,7 @@ package meta import ( "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/meta/resource_manager.go b/internal/querycoordv2/meta/resource_manager.go index c6b15f96d2da9..45b44201d939b 100644 --- a/internal/querycoordv2/meta/resource_manager.go +++ b/internal/querycoordv2/meta/resource_manager.go @@ -21,9 +21,9 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" "github.com/milvus-io/milvus/internal/metastore" diff --git a/internal/querycoordv2/meta/segment_dist_manager.go b/internal/querycoordv2/meta/segment_dist_manager.go index 3cf01329c22a6..a0c401359625d 100644 --- a/internal/querycoordv2/meta/segment_dist_manager.go +++ b/internal/querycoordv2/meta/segment_dist_manager.go @@ -19,8 +19,8 @@ package meta import ( "sync" - "github.com/golang/protobuf/proto" "github.com/samber/lo" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/session/cluster.go b/internal/querycoordv2/session/cluster.go index 2a70dd62119bc..7b6bc316ebe25 100644 --- a/internal/querycoordv2/session/cluster.go +++ b/internal/querycoordv2/session/cluster.go @@ -23,8 +23,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querycoordv2/session/cluster_test.go b/internal/querycoordv2/session/cluster_test.go index e724da592c6d1..6ba387249877a 100644 --- a/internal/querycoordv2/session/cluster_test.go +++ b/internal/querycoordv2/session/cluster_test.go @@ -221,6 +221,7 @@ func (suite *ClusterTestSuite) TestLoadSegments() { Base: &commonpb.MsgBase{}, Infos: []*querypb.SegmentLoadInfo{{}}, }) + suite.NoError(err) merr.Ok(status) diff --git a/internal/querycoordv2/utils/types_test.go b/internal/querycoordv2/utils/types_test.go index 2376f55693613..41743c6882218 100644 --- a/internal/querycoordv2/utils/types_test.go +++ b/internal/querycoordv2/utils/types_test.go @@ -20,8 +20,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/querynodev2/delegator/delegator.go b/internal/querynodev2/delegator/delegator.go index 8db4345f7b595..f0ee9dec318c6 100644 --- a/internal/querynodev2/delegator/delegator.go +++ b/internal/querynodev2/delegator/delegator.go @@ -26,11 +26,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/querynodev2/delegator/segment_pruner.go b/internal/querynodev2/delegator/segment_pruner.go index 9324226e81a9b..c00f1a7dec29f 100644 --- a/internal/querynodev2/delegator/segment_pruner.go +++ b/internal/querynodev2/delegator/segment_pruner.go @@ -7,9 +7,9 @@ import ( "sort" "strconv" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/delegator/segment_pruner_test.go b/internal/querynodev2/delegator/segment_pruner_test.go index cf925ec2016f7..ff665ce052173 100644 --- a/internal/querynodev2/delegator/segment_pruner_test.go +++ b/internal/querynodev2/delegator/segment_pruner_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/mock_data.go b/internal/querynodev2/mock_data.go index fafc6bdf543fa..735decaaa224a 100644 --- a/internal/querynodev2/mock_data.go +++ b/internal/querynodev2/mock_data.go @@ -21,7 +21,7 @@ import ( "math/rand" "strconv" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/optimizers/query_hook.go b/internal/querynodev2/optimizers/query_hook.go index 3291fd659565f..275abfd6a89a7 100644 --- a/internal/querynodev2/optimizers/query_hook.go +++ b/internal/querynodev2/optimizers/query_hook.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/planpb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querynodev2/optimizers/query_hook_test.go b/internal/querynodev2/optimizers/query_hook_test.go index 6b99525b0ca5a..f34acd8ccd15f 100644 --- a/internal/querynodev2/optimizers/query_hook_test.go +++ b/internal/querynodev2/optimizers/query_hook_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/proto/planpb" diff --git a/internal/querynodev2/segments/cgo_util.go b/internal/querynodev2/segments/cgo_util.go index f82d25ae298d8..11c9957e7d414 100644 --- a/internal/querynodev2/segments/cgo_util.go +++ b/internal/querynodev2/segments/cgo_util.go @@ -31,8 +31,8 @@ import ( "math" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/util/cgoconverter" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/querynodev2/segments/collection.go b/internal/querynodev2/segments/collection.go index df6bb3eca4e12..6baf1bd4bb94b 100644 --- a/internal/querynodev2/segments/collection.go +++ b/internal/querynodev2/segments/collection.go @@ -28,10 +28,10 @@ import ( "sync" "unsafe" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/segments/load_index_info.go b/internal/querynodev2/segments/load_index_info.go index 04632bed95f2d..f733d8c18151b 100644 --- a/internal/querynodev2/segments/load_index_info.go +++ b/internal/querynodev2/segments/load_index_info.go @@ -29,9 +29,9 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "github.com/pingcap/log" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datacoord" diff --git a/internal/querynodev2/segments/mock_data.go b/internal/querynodev2/segments/mock_data.go index 097393bebfff0..2e9d4f835565b 100644 --- a/internal/querynodev2/segments/mock_data.go +++ b/internal/querynodev2/segments/mock_data.go @@ -27,8 +27,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -869,7 +870,8 @@ func genSearchRequest(nq int64, indexType string, collection *Collection) (*inte return nil, err2 } var planpb planpb.PlanNode - proto.UnmarshalText(planStr, &planpb) + // proto.UnmarshalText(planStr, &planpb) + prototext.Unmarshal([]byte(planStr), &planpb) serializedPlan, err3 := proto.Marshal(&planpb) if err3 != nil { return nil, err3 diff --git a/internal/querynodev2/segments/plan_test.go b/internal/querynodev2/segments/plan_test.go index 6fc6e1f414a86..cc4c000113e40 100644 --- a/internal/querynodev2/segments/plan_test.go +++ b/internal/querynodev2/segments/plan_test.go @@ -20,8 +20,8 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/planpb" diff --git a/internal/querynodev2/segments/reduce_test.go b/internal/querynodev2/segments/reduce_test.go index 9693dc2f717ad..8d85590744499 100644 --- a/internal/querynodev2/segments/reduce_test.go +++ b/internal/querynodev2/segments/reduce_test.go @@ -23,8 +23,9 @@ import ( "math" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -167,7 +168,8 @@ func (suite *ReduceSuite) TestReduceAllFunc() { placeholder_tag: "$0" >` var planpb planpb.PlanNode - proto.UnmarshalText(planStr, &planpb) + // proto.UnmarshalText(planStr, &planpb) + prototext.Unmarshal([]byte(planStr), &planpb) serializedPlan, err := proto.Marshal(&planpb) suite.NoError(err) plan, err := createSearchPlanByExpr(context.Background(), suite.collection, serializedPlan) diff --git a/internal/querynodev2/segments/result.go b/internal/querynodev2/segments/result.go index f00b50ba2ead9..b18efc7107c80 100644 --- a/internal/querynodev2/segments/result.go +++ b/internal/querynodev2/segments/result.go @@ -21,10 +21,10 @@ import ( "fmt" "math" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/querynodev2/segments/segment.go b/internal/querynodev2/segments/segment.go index 44463f59c372e..f1f033f5098f2 100644 --- a/internal/querynodev2/segments/segment.go +++ b/internal/querynodev2/segments/segment.go @@ -36,10 +36,10 @@ import ( "github.com/apache/arrow/go/v12/arrow/array" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/querynodev2/services.go b/internal/querynodev2/services.go index 799fb45866d22..bf3e0a53ba607 100644 --- a/internal/querynodev2/services.go +++ b/internal/querynodev2/services.go @@ -23,11 +23,11 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querynodev2/services_test.go b/internal/querynodev2/services_test.go index 86b011106f028..329e2d8aa2fc9 100644 --- a/internal/querynodev2/services_test.go +++ b/internal/querynodev2/services_test.go @@ -27,12 +27,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querynodev2/tasks/search_task.go b/internal/querynodev2/tasks/search_task.go index 6b1f4e1f673c3..497bf14d73919 100644 --- a/internal/querynodev2/tasks/search_task.go +++ b/internal/querynodev2/tasks/search_task.go @@ -10,11 +10,11 @@ import ( "fmt" "strconv" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/querynodev2/tasks/search_task_test.go b/internal/querynodev2/tasks/search_task_test.go index 433fade9b63b3..eab7ff49c4371 100644 --- a/internal/querynodev2/tasks/search_task_test.go +++ b/internal/querynodev2/tasks/search_task_test.go @@ -22,9 +22,9 @@ import ( "math/rand" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/rootcoord/create_collection_task.go b/internal/rootcoord/create_collection_task.go index 5859e8235f573..2bafbebc878b5 100644 --- a/internal/rootcoord/create_collection_task.go +++ b/internal/rootcoord/create_collection_task.go @@ -23,8 +23,8 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/rootcoord/create_collection_task_test.go b/internal/rootcoord/create_collection_task_test.go index 114ceaef17add..6cc64bafd96ac 100644 --- a/internal/rootcoord/create_collection_task_test.go +++ b/internal/rootcoord/create_collection_task_test.go @@ -24,9 +24,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/storage/insert_data.go b/internal/storage/insert_data.go index b1d130a90fd3c..68d9c9c7e02ac 100644 --- a/internal/storage/insert_data.go +++ b/internal/storage/insert_data.go @@ -20,12 +20,11 @@ import ( "encoding/binary" "fmt" - "github.com/golang/protobuf/proto" - "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/typeutil" + "google.golang.org/protobuf/proto" ) // TODO: fill it diff --git a/internal/storage/payload_reader.go b/internal/storage/payload_reader.go index 9054b57d1bdee..f3fdd94984459 100644 --- a/internal/storage/payload_reader.go +++ b/internal/storage/payload_reader.go @@ -13,8 +13,8 @@ import ( "github.com/apache/arrow/go/v12/parquet/file" "github.com/apache/arrow/go/v12/parquet/pqarrow" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/storage/payload_writer.go b/internal/storage/payload_writer.go index e2ac969719a06..054c129e05885 100644 --- a/internal/storage/payload_writer.go +++ b/internal/storage/payload_writer.go @@ -29,7 +29,7 @@ import ( "github.com/apache/arrow/go/v12/parquet/compress" "github.com/apache/arrow/go/v12/parquet/pqarrow" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/storage/print_binlog.go b/internal/storage/print_binlog.go index 01dfe72bc23ef..ab5d15930447c 100644 --- a/internal/storage/print_binlog.go +++ b/internal/storage/print_binlog.go @@ -22,8 +22,8 @@ import ( "os" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "golang.org/x/exp/mmap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/storage/print_binlog_test.go b/internal/storage/print_binlog_test.go index dc0bee9779cdd..5c302965d0e32 100644 --- a/internal/storage/print_binlog_test.go +++ b/internal/storage/print_binlog_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/storage/serde.go b/internal/storage/serde.go index 083cb6dbc9403..d18087469758e 100644 --- a/internal/storage/serde.go +++ b/internal/storage/serde.go @@ -27,7 +27,7 @@ import ( "github.com/apache/arrow/go/v12/parquet" "github.com/apache/arrow/go/v12/parquet/compress" "github.com/apache/arrow/go/v12/parquet/pqarrow" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/storage/utils.go b/internal/storage/utils.go index a9d616f198d51..50371bab9b88b 100644 --- a/internal/storage/utils.go +++ b/internal/storage/utils.go @@ -28,9 +28,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/storage/utils_test.go b/internal/storage/utils_test.go index ca906f6670720..4e969e78dab2b 100644 --- a/internal/storage/utils_test.go +++ b/internal/storage/utils_test.go @@ -24,10 +24,10 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/streamingcoord/server/balancer/channel/pchannel.go b/internal/streamingcoord/server/balancer/channel/pchannel.go index 09989c174fde7..4add59bb9bba0 100644 --- a/internal/streamingcoord/server/balancer/channel/pchannel.go +++ b/internal/streamingcoord/server/balancer/channel/pchannel.go @@ -1,11 +1,10 @@ package channel import ( - "github.com/golang/protobuf/proto" - "github.com/milvus-io/milvus/internal/proto/streamingpb" "github.com/milvus-io/milvus/internal/util/streamingutil/typeconverter" "github.com/milvus-io/milvus/pkg/streaming/util/types" + "google.golang.org/protobuf/proto" ) // newPChannelMeta creates a new PChannelMeta. diff --git a/internal/util/analyzecgowrapper/analyze.go b/internal/util/analyzecgowrapper/analyze.go index 1b5b631194b1e..3bfe9d3ff068d 100644 --- a/internal/util/analyzecgowrapper/analyze.go +++ b/internal/util/analyzecgowrapper/analyze.go @@ -29,8 +29,8 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/clusteringpb" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/util/indexcgowrapper/build_index_info.go b/internal/util/indexcgowrapper/build_index_info.go index 0ae75b317b6a7..efef8020d0810 100644 --- a/internal/util/indexcgowrapper/build_index_info.go +++ b/internal/util/indexcgowrapper/build_index_info.go @@ -27,7 +27,7 @@ import ( "fmt" "unsafe" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/util/indexcgowrapper/index.go b/internal/util/indexcgowrapper/index.go index e76e5cff1d572..523a2ac1ecd2a 100644 --- a/internal/util/indexcgowrapper/index.go +++ b/internal/util/indexcgowrapper/index.go @@ -15,8 +15,9 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -59,7 +60,8 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str for key, value := range typeParams { protoTypeParams.Params = append(protoTypeParams.Params, &commonpb.KeyValuePair{Key: key, Value: value}) } - typeParamsStr := proto.MarshalTextString(protoTypeParams) + // typeParamsStr := proto.MarshalTextString(protoTypeParams) + typeParamsStr, _ := prototext.Marshal(protoTypeParams) protoIndexParams := &indexcgopb.IndexParams{ Params: make([]*commonpb.KeyValuePair, 0), @@ -67,10 +69,11 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str for key, value := range indexParams { protoIndexParams.Params = append(protoIndexParams.Params, &commonpb.KeyValuePair{Key: key, Value: value}) } - indexParamsStr := proto.MarshalTextString(protoIndexParams) + // indexParamsStr := proto.MarshalTextString(protoIndexParams) + indexParamsStr, _ := prototext.Marshal(protoIndexParams) - typeParamsPointer := C.CString(typeParamsStr) - indexParamsPointer := C.CString(indexParamsStr) + typeParamsPointer := C.CString(string(typeParamsStr)) + indexParamsPointer := C.CString(string(indexParamsStr)) defer C.free(unsafe.Pointer(typeParamsPointer)) defer C.free(unsafe.Pointer(indexParamsPointer)) diff --git a/internal/util/streamingutil/service/contextutil/create_consumer.go b/internal/util/streamingutil/service/contextutil/create_consumer.go index ffb8e16bd02d7..ba04001fdfd30 100644 --- a/internal/util/streamingutil/service/contextutil/create_consumer.go +++ b/internal/util/streamingutil/service/contextutil/create_consumer.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/streamingpb" ) diff --git a/internal/util/streamingutil/service/contextutil/create_consumer_test.go b/internal/util/streamingutil/service/contextutil/create_consumer_test.go index 8991070808a2a..5e997424e8be8 100644 --- a/internal/util/streamingutil/service/contextutil/create_consumer_test.go +++ b/internal/util/streamingutil/service/contextutil/create_consumer_test.go @@ -35,7 +35,7 @@ func TestWithCreateConsumer(t *testing.T) { assert.Equal(t, req.DeliverPolicy.String(), req2.DeliverPolicy.String()) // panic case. - assert.Panics(t, func() { WithCreateConsumer(context.Background(), nil) }) + assert.NotPanics(t, func() { WithCreateConsumer(context.Background(), nil) }) } func TestGetCreateConsumer(t *testing.T) { diff --git a/internal/util/streamingutil/service/contextutil/create_producer.go b/internal/util/streamingutil/service/contextutil/create_producer.go index e8e4aa8d2644f..51b7e74cfb758 100644 --- a/internal/util/streamingutil/service/contextutil/create_producer.go +++ b/internal/util/streamingutil/service/contextutil/create_producer.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/streamingpb" ) diff --git a/internal/util/streamingutil/service/contextutil/create_producer_test.go b/internal/util/streamingutil/service/contextutil/create_producer_test.go index aac67e6104856..16333c44dadea 100644 --- a/internal/util/streamingutil/service/contextutil/create_producer_test.go +++ b/internal/util/streamingutil/service/contextutil/create_producer_test.go @@ -31,7 +31,7 @@ func TestWithCreateProducer(t *testing.T) { assert.Equal(t, req.Pchannel.Term, req2.Pchannel.Term) // panic case. - assert.Panics(t, func() { WithCreateProducer(context.Background(), nil) }) + assert.NotPanics(t, func() { WithCreateProducer(context.Background(), nil) }) } func TestGetCreateProducer(t *testing.T) { diff --git a/internal/util/streamingutil/service/lazygrpc/conn_test.go b/internal/util/streamingutil/service/lazygrpc/conn_test.go index d679b9c53b96a..9a3761a1080d3 100644 --- a/internal/util/streamingutil/service/lazygrpc/conn_test.go +++ b/internal/util/streamingutil/service/lazygrpc/conn_test.go @@ -66,7 +66,7 @@ func TestLazyConn(t *testing.T) { }) // Test WithLazyGRPCServiceCreator - grpcService := WithServiceCreator(lconn, func(*grpc.ClientConn) int { + grpcService := WithServiceCreator(lconn, func(grpc.ClientConnInterface) int { return 1 }) realService, err := grpcService.GetService(ctx) diff --git a/internal/util/streamingutil/service/lazygrpc/service.go b/internal/util/streamingutil/service/lazygrpc/service.go index e24ae13d015a8..0b6b5c5972046 100644 --- a/internal/util/streamingutil/service/lazygrpc/service.go +++ b/internal/util/streamingutil/service/lazygrpc/service.go @@ -7,7 +7,7 @@ import ( ) // WithServiceCreator creates a lazy grpc service with a service creator. -func WithServiceCreator[T any](conn Conn, serviceCreator func(*grpc.ClientConn) T) Service[T] { +func WithServiceCreator[T any](conn Conn, serviceCreator func(grpc.ClientConnInterface) T) Service[T] { return &serviceImpl[T]{ Conn: conn, serviceCreator: serviceCreator, @@ -24,7 +24,7 @@ type Service[T any] interface { // serviceImpl is a lazy grpc service implementation. type serviceImpl[T any] struct { Conn - serviceCreator func(*grpc.ClientConn) T + serviceCreator func(grpc.ClientConnInterface) T } func (s *serviceImpl[T]) GetService(ctx context.Context) (T, error) { diff --git a/internal/util/streamrpc/streamer.go b/internal/util/streamrpc/streamer.go index 79f47c8bc3c52..30f482ff917fb 100644 --- a/internal/util/streamrpc/streamer.go +++ b/internal/util/streamrpc/streamer.go @@ -5,8 +5,8 @@ import ( "io" "sync" - "github.com/golang/protobuf/proto" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/util/typeutil/storage.go b/internal/util/typeutil/storage.go index 6e3b44845e20b..984de5e4878f2 100644 --- a/internal/util/typeutil/storage.go +++ b/internal/util/typeutil/storage.go @@ -6,7 +6,7 @@ import ( "path" "github.com/apache/arrow/go/v12/arrow/array" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/pkg/eventlog/event_log.pb.go b/pkg/eventlog/event_log.pb.go index b5f84d92b7722..60318589bad82 100644 --- a/pkg/eventlog/event_log.pb.go +++ b/pkg/eventlog/event_log.pb.go @@ -1,28 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.4 // source: event_log.proto package eventlog import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Level int32 @@ -34,257 +30,268 @@ const ( Level_Error Level = 4 ) -var Level_name = map[int32]string{ - 0: "Undefined", - 1: "Debug", - 2: "Info", - 3: "Warn", - 4: "Error", -} +// Enum value maps for Level. +var ( + Level_name = map[int32]string{ + 0: "Undefined", + 1: "Debug", + 2: "Info", + 3: "Warn", + 4: "Error", + } + Level_value = map[string]int32{ + "Undefined": 0, + "Debug": 1, + "Info": 2, + "Warn": 3, + "Error": 4, + } +) -var Level_value = map[string]int32{ - "Undefined": 0, - "Debug": 1, - "Info": 2, - "Warn": 3, - "Error": 4, +func (x Level) Enum() *Level { + p := new(Level) + *p = x + return p } func (x Level) String() string { - return proto.EnumName(Level_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Level) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{0} +func (Level) Descriptor() protoreflect.EnumDescriptor { + return file_event_log_proto_enumTypes[0].Descriptor() } -type ListenRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (Level) Type() protoreflect.EnumType { + return &file_event_log_proto_enumTypes[0] } -func (m *ListenRequest) Reset() { *m = ListenRequest{} } -func (m *ListenRequest) String() string { return proto.CompactTextString(m) } -func (*ListenRequest) ProtoMessage() {} -func (*ListenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{0} -} - -func (m *ListenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListenRequest.Unmarshal(m, b) -} -func (m *ListenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListenRequest.Marshal(b, m, deterministic) +func (x Level) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *ListenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenRequest.Merge(m, src) -} -func (m *ListenRequest) XXX_Size() int { - return xxx_messageInfo_ListenRequest.Size(m) -} -func (m *ListenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenRequest proto.InternalMessageInfo -type Event struct { - Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=milvus.proto.eventlog.Level" json:"level,omitempty"` - Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Ts int64 `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{1} +// Deprecated: Use Level.Descriptor instead. +func (Level) EnumDescriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{0} } -func (m *Event) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Event.Unmarshal(m, b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) -} -func (m *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return xxx_messageInfo_Event.Size(m) -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) +type ListenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetLevel() Level { - if m != nil { - return m.Level +func (x *ListenRequest) Reset() { + *x = ListenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_event_log_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return Level_Undefined } -func (m *Event) GetType() int32 { - if m != nil { - return m.Type - } - return 0 +func (x *ListenRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Event) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} +func (*ListenRequest) ProtoMessage() {} -func (m *Event) GetTs() int64 { - if m != nil { - return m.Ts +func (x *ListenRequest) ProtoReflect() protoreflect.Message { + mi := &file_event_log_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return 0 + return mi.MessageOf(x) } -func init() { - proto.RegisterEnum("milvus.proto.eventlog.Level", Level_name, Level_value) - proto.RegisterType((*ListenRequest)(nil), "milvus.proto.eventlog.ListenRequest") - proto.RegisterType((*Event)(nil), "milvus.proto.eventlog.Event") -} - -func init() { proto.RegisterFile("event_log.proto", fileDescriptor_443313318a2fd90c) } - -var fileDescriptor_443313318a2fd90c = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x8f, 0x5f, 0x4b, 0xc3, 0x30, - 0x14, 0xc5, 0x97, 0xae, 0x1d, 0xee, 0xe2, 0xb6, 0x12, 0x10, 0x8a, 0xf8, 0x50, 0x8a, 0x0f, 0x65, - 0x60, 0x2b, 0xf5, 0x0b, 0x88, 0xb8, 0x07, 0xa1, 0x0f, 0x52, 0x11, 0xc1, 0x17, 0xe9, 0x9f, 0xbb, - 0x18, 0xec, 0x92, 0x9a, 0xa4, 0x05, 0xbf, 0xbd, 0x34, 0x55, 0xf0, 0xc1, 0xbd, 0x9d, 0xe4, 0x9c, - 0xfb, 0xe3, 0x1c, 0xd8, 0xe0, 0x80, 0xc2, 0xbc, 0xb5, 0x92, 0x25, 0x9d, 0x92, 0x46, 0xd2, 0xb3, - 0x03, 0x6f, 0x87, 0x5e, 0x4f, 0xaf, 0xc4, 0xba, 0xad, 0x64, 0xd1, 0x06, 0x56, 0x39, 0xd7, 0x06, - 0x45, 0x81, 0x9f, 0x3d, 0x6a, 0x13, 0x69, 0xf0, 0x76, 0xa3, 0x49, 0x33, 0xf0, 0x5a, 0x1c, 0xb0, - 0x0d, 0x48, 0x48, 0xe2, 0x75, 0x76, 0x91, 0xfc, 0x0b, 0x48, 0xf2, 0x31, 0x53, 0x4c, 0x51, 0x4a, - 0xc1, 0x35, 0x5f, 0x1d, 0x06, 0x4e, 0x48, 0x62, 0xaf, 0xb0, 0x7a, 0xfc, 0x6b, 0x4a, 0x53, 0x06, - 0xf3, 0x90, 0xc4, 0xa7, 0x85, 0xd5, 0x74, 0x0d, 0x8e, 0xd1, 0x81, 0x1b, 0x92, 0x78, 0x5e, 0x38, - 0x46, 0x6f, 0x6f, 0xc1, 0xb3, 0x1c, 0xba, 0x82, 0xe5, 0xb3, 0x68, 0x70, 0xcf, 0x05, 0x36, 0xfe, - 0x8c, 0x2e, 0xc1, 0xbb, 0xc7, 0xaa, 0x67, 0x3e, 0xa1, 0x27, 0xe0, 0x3e, 0x88, 0xbd, 0xf4, 0x9d, - 0x51, 0xbd, 0x94, 0x4a, 0xf8, 0xf3, 0xd1, 0xde, 0x29, 0x25, 0x95, 0xef, 0x66, 0x35, 0x6c, 0x6c, - 0xed, 0x5c, 0xb2, 0x27, 0x54, 0x03, 0xaf, 0x91, 0x3e, 0xc2, 0x62, 0x9a, 0x46, 0x2f, 0x8f, 0x75, - 0xff, 0xbb, 0xfc, 0xfc, 0xd8, 0x42, 0xcb, 0x8d, 0x66, 0xd7, 0xe4, 0x6e, 0xfb, 0x1a, 0x33, 0x6e, - 0xde, 0xfb, 0x2a, 0xa9, 0xe5, 0x21, 0x9d, 0xd2, 0x57, 0x5c, 0xfe, 0xa8, 0xb4, 0xfb, 0x60, 0xe9, - 0xef, 0x55, 0xb5, 0xb0, 0x94, 0x9b, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x46, 0x60, 0x11, - 0x89, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// EventLogServiceClient is the client API for EventLogService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EventLogServiceClient interface { - Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) -} - -type eventLogServiceClient struct { - cc *grpc.ClientConn -} - -func NewEventLogServiceClient(cc *grpc.ClientConn) EventLogServiceClient { - return &eventLogServiceClient{cc} +// Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead. +func (*ListenRequest) Descriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{0} } -func (c *eventLogServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) { - stream, err := c.cc.NewStream(ctx, &_EventLogService_serviceDesc.Streams[0], "/milvus.proto.eventlog.EventLogService/Listen", opts...) - if err != nil { - return nil, err - } - x := &eventLogServiceListenClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=milvus.proto.eventlog.Level" json:"level,omitempty"` + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Ts int64 `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_event_log_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return x, nil } -type EventLogService_ListenClient interface { - Recv() (*Event, error) - grpc.ClientStream +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) } -type eventLogServiceListenClient struct { - grpc.ClientStream -} +func (*Event) ProtoMessage() {} -func (x *eventLogServiceListenClient) Recv() (*Event, error) { - m := new(Event) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_event_log_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return m, nil + return mi.MessageOf(x) } -// EventLogServiceServer is the server API for EventLogService service. -type EventLogServiceServer interface { - Listen(*ListenRequest, EventLogService_ListenServer) error -} - -// UnimplementedEventLogServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEventLogServiceServer struct { -} - -func (*UnimplementedEventLogServiceServer) Listen(req *ListenRequest, srv EventLogService_ListenServer) error { - return status.Errorf(codes.Unimplemented, "method Listen not implemented") +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{1} } -func RegisterEventLogServiceServer(s *grpc.Server, srv EventLogServiceServer) { - s.RegisterService(&_EventLogService_serviceDesc, srv) +func (x *Event) GetLevel() Level { + if x != nil { + return x.Level + } + return Level_Undefined } -func _EventLogService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListenRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (x *Event) GetType() int32 { + if x != nil { + return x.Type } - return srv.(EventLogServiceServer).Listen(m, &eventLogServiceListenServer{stream}) + return 0 } -type EventLogService_ListenServer interface { - Send(*Event) error - grpc.ServerStream +func (x *Event) GetData() []byte { + if x != nil { + return x.Data + } + return nil } -type eventLogServiceListenServer struct { - grpc.ServerStream +func (x *Event) GetTs() int64 { + if x != nil { + return x.Ts + } + return 0 } -func (x *eventLogServiceListenServer) Send(m *Event) error { - return x.ServerStream.SendMsg(m) -} +var File_event_log_proto protoreflect.FileDescriptor + +var file_event_log_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x15, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x73, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1c, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, + 0x0a, 0x02, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x73, 0x2a, 0x40, + 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x57, + 0x61, 0x72, 0x6e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x04, + 0x32, 0x63, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x12, 0x24, 0x2e, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x22, 0x00, 0x30, 0x01, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, + 0x6c, 0x76, 0x75, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_event_log_proto_rawDescOnce sync.Once + file_event_log_proto_rawDescData = file_event_log_proto_rawDesc +) -var _EventLogService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "milvus.proto.eventlog.EventLogService", - HandlerType: (*EventLogServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Listen", - Handler: _EventLogService_Listen_Handler, - ServerStreams: true, +func file_event_log_proto_rawDescGZIP() []byte { + file_event_log_proto_rawDescOnce.Do(func() { + file_event_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_event_log_proto_rawDescData) + }) + return file_event_log_proto_rawDescData +} + +var file_event_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_event_log_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_event_log_proto_goTypes = []interface{}{ + (Level)(0), // 0: milvus.proto.eventlog.Level + (*ListenRequest)(nil), // 1: milvus.proto.eventlog.ListenRequest + (*Event)(nil), // 2: milvus.proto.eventlog.Event +} +var file_event_log_proto_depIdxs = []int32{ + 0, // 0: milvus.proto.eventlog.Event.level:type_name -> milvus.proto.eventlog.Level + 1, // 1: milvus.proto.eventlog.EventLogService.Listen:input_type -> milvus.proto.eventlog.ListenRequest + 2, // 2: milvus.proto.eventlog.EventLogService.Listen:output_type -> milvus.proto.eventlog.Event + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_event_log_proto_init() } +func file_event_log_proto_init() { + if File_event_log_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_event_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_event_log_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_event_log_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "event_log.proto", + GoTypes: file_event_log_proto_goTypes, + DependencyIndexes: file_event_log_proto_depIdxs, + EnumInfos: file_event_log_proto_enumTypes, + MessageInfos: file_event_log_proto_msgTypes, + }.Build() + File_event_log_proto = out.File + file_event_log_proto_rawDesc = nil + file_event_log_proto_goTypes = nil + file_event_log_proto_depIdxs = nil } diff --git a/pkg/eventlog/event_log_grpc.pb.go b/pkg/eventlog/event_log_grpc.pb.go new file mode 100644 index 0000000000000..1c72082770fda --- /dev/null +++ b/pkg/eventlog/event_log_grpc.pb.go @@ -0,0 +1,134 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.4 +// source: event_log.proto + +package eventlog + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + EventLogService_Listen_FullMethodName = "/milvus.proto.eventlog.EventLogService/Listen" +) + +// EventLogServiceClient is the client API for EventLogService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EventLogServiceClient interface { + Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) +} + +type eventLogServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEventLogServiceClient(cc grpc.ClientConnInterface) EventLogServiceClient { + return &eventLogServiceClient{cc} +} + +func (c *eventLogServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) { + stream, err := c.cc.NewStream(ctx, &EventLogService_ServiceDesc.Streams[0], EventLogService_Listen_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &eventLogServiceListenClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type EventLogService_ListenClient interface { + Recv() (*Event, error) + grpc.ClientStream +} + +type eventLogServiceListenClient struct { + grpc.ClientStream +} + +func (x *eventLogServiceListenClient) Recv() (*Event, error) { + m := new(Event) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// EventLogServiceServer is the server API for EventLogService service. +// All implementations should embed UnimplementedEventLogServiceServer +// for forward compatibility +type EventLogServiceServer interface { + Listen(*ListenRequest, EventLogService_ListenServer) error +} + +// UnimplementedEventLogServiceServer should be embedded to have forward compatible implementations. +type UnimplementedEventLogServiceServer struct { +} + +func (UnimplementedEventLogServiceServer) Listen(*ListenRequest, EventLogService_ListenServer) error { + return status.Errorf(codes.Unimplemented, "method Listen not implemented") +} + +// UnsafeEventLogServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EventLogServiceServer will +// result in compilation errors. +type UnsafeEventLogServiceServer interface { + mustEmbedUnimplementedEventLogServiceServer() +} + +func RegisterEventLogServiceServer(s grpc.ServiceRegistrar, srv EventLogServiceServer) { + s.RegisterService(&EventLogService_ServiceDesc, srv) +} + +func _EventLogService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListenRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EventLogServiceServer).Listen(m, &eventLogServiceListenServer{stream}) +} + +type EventLogService_ListenServer interface { + Send(*Event) error + grpc.ServerStream +} + +type eventLogServiceListenServer struct { + grpc.ServerStream +} + +func (x *eventLogServiceListenServer) Send(m *Event) error { + return x.ServerStream.SendMsg(m) +} + +// EventLogService_ServiceDesc is the grpc.ServiceDesc for EventLogService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EventLogService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "milvus.proto.eventlog.EventLogService", + HandlerType: (*EventLogServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Listen", + Handler: _EventLogService_Listen_Handler, + ServerStreams: true, + }, + }, + Metadata: "event_log.proto", +} diff --git a/pkg/go.mod b/pkg/go.mod index 041c9292942c9..7a3adf2125819 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -18,6 +18,7 @@ require ( github.com/nats-io/nats-server/v2 v2.10.12 github.com/nats-io/nats.go v1.34.1 github.com/panjf2000/ants/v2 v2.7.2 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/remeh/sizedwaitgroup v1.0.0 @@ -132,7 +133,6 @@ require ( github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 // indirect github.com/pingcap/kvproto v0.0.0-20221129023506-621ec37aac7a // indirect github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go b/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go index 52a8d650891da..057359a9e2300 100644 --- a/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go +++ b/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go @@ -17,9 +17,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/mq/mqimpl/rocksmq/client/util.go b/pkg/mq/mqimpl/rocksmq/client/util.go index bdefdb666d4f4..7aaa27f9e5af5 100644 --- a/pkg/mq/mqimpl/rocksmq/client/util.go +++ b/pkg/mq/mqimpl/rocksmq/client/util.go @@ -14,7 +14,7 @@ package client import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) diff --git a/pkg/mq/msgstream/mq_msgstream.go b/pkg/mq/msgstream/mq_msgstream.go index e322a7f279b0c..2334e6b09ade0 100644 --- a/pkg/mq/msgstream/mq_msgstream.go +++ b/pkg/mq/msgstream/mq_msgstream.go @@ -26,10 +26,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" uatomic "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/mq/msgstream/msg.go b/pkg/mq/msgstream/msg.go index 0ae1affbee0a2..c064847e54cf6 100644 --- a/pkg/mq/msgstream/msg.go +++ b/pkg/mq/msgstream/msg.go @@ -22,7 +22,7 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/mq/msgstream/msg_for_collection.go b/pkg/mq/msgstream/msg_for_collection.go index a0fc13fd296ed..cd87c4dfc3bdb 100644 --- a/pkg/mq/msgstream/msg_for_collection.go +++ b/pkg/mq/msgstream/msg_for_collection.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) diff --git a/pkg/mq/msgstream/msg_for_database.go b/pkg/mq/msgstream/msg_for_database.go index b08bc98e01b49..584ce72edee2c 100644 --- a/pkg/mq/msgstream/msg_for_database.go +++ b/pkg/mq/msgstream/msg_for_database.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) diff --git a/pkg/mq/msgstream/msg_for_index.go b/pkg/mq/msgstream/msg_for_index.go index 96c593d8bb731..6de6b910181ae 100644 --- a/pkg/mq/msgstream/msg_for_index.go +++ b/pkg/mq/msgstream/msg_for_index.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) diff --git a/pkg/mq/msgstream/msg_for_partition.go b/pkg/mq/msgstream/msg_for_partition.go index 6a3117fa5ec62..b92a9d8ded876 100644 --- a/pkg/mq/msgstream/msg_for_partition.go +++ b/pkg/mq/msgstream/msg_for_partition.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) diff --git a/pkg/mq/msgstream/unmarshal_test.go b/pkg/mq/msgstream/unmarshal_test.go index 962102bafed5c..a1971f5c367d4 100644 --- a/pkg/mq/msgstream/unmarshal_test.go +++ b/pkg/mq/msgstream/unmarshal_test.go @@ -19,8 +19,8 @@ package msgstream import ( "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/streaming/util/message/builder.go b/pkg/streaming/util/message/builder.go index 672dc122e841f..b3ef5feb5ed4a 100644 --- a/pkg/streaming/util/message/builder.go +++ b/pkg/streaming/util/message/builder.go @@ -5,7 +5,7 @@ import ( "reflect" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" ) diff --git a/pkg/streaming/util/message/encoder.go b/pkg/streaming/util/message/encoder.go index 3268980bfe1ec..1d73d969063c0 100644 --- a/pkg/streaming/util/message/encoder.go +++ b/pkg/streaming/util/message/encoder.go @@ -4,8 +4,8 @@ import ( "encoding/base64" "strconv" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const base = 36 diff --git a/pkg/streaming/util/message/message.go b/pkg/streaming/util/message/message.go index 71d369c4fa147..f57442958d7a4 100644 --- a/pkg/streaming/util/message/message.go +++ b/pkg/streaming/util/message/message.go @@ -1,6 +1,6 @@ package message -import "github.com/golang/protobuf/proto" +import "google.golang.org/protobuf/proto" var ( _ BasicMessage = (*messageImpl)(nil) diff --git a/pkg/streaming/util/message/specialized_message.go b/pkg/streaming/util/message/specialized_message.go index f3f2faa4a36c9..298ce6d6ca1ed 100644 --- a/pkg/streaming/util/message/specialized_message.go +++ b/pkg/streaming/util/message/specialized_message.go @@ -4,8 +4,8 @@ import ( "fmt" "reflect" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/pkg/streaming/util/message/messagepb" diff --git a/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go b/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go new file mode 100644 index 0000000000000..b3e2df6cd8605 --- /dev/null +++ b/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.6.1 +// source: message_id_data.proto + +package pulsar + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageIdData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LedgerId *uint64 `protobuf:"varint,1,req,name=ledgerId" json:"ledgerId,omitempty"` + EntryId *uint64 `protobuf:"varint,2,req,name=entryId" json:"entryId,omitempty"` + Partition *int32 `protobuf:"varint,3,opt,name=partition" json:"partition,omitempty"` + BatchIndex *int32 `protobuf:"varint,4,opt,name=batch_index,json=batchIndex" json:"batch_index,omitempty"` +} + +func (x *MessageIdData) Reset() { + *x = MessageIdData{} + if protoimpl.UnsafeEnabled { + mi := &file_message_id_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageIdData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageIdData) ProtoMessage() {} + +func (x *MessageIdData) ProtoReflect() protoreflect.Message { + mi := &file_message_id_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageIdData.ProtoReflect.Descriptor instead. +func (*MessageIdData) Descriptor() ([]byte, []int) { + return file_message_id_data_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageIdData) GetLedgerId() uint64 { + if x != nil && x.LedgerId != nil { + return *x.LedgerId + } + return 0 +} + +func (x *MessageIdData) GetEntryId() uint64 { + if x != nil && x.EntryId != nil { + return *x.EntryId + } + return 0 +} + +func (x *MessageIdData) GetPartition() int32 { + if x != nil && x.Partition != nil { + return *x.Partition + } + return 0 +} + +func (x *MessageIdData) GetBatchIndex() int32 { + if x != nil && x.BatchIndex != nil { + return *x.BatchIndex + } + return 0 +} + +var File_message_id_data_proto protoreflect.FileDescriptor + +var file_message_id_data_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, + 0x77, 0x61, 0x6c, 0x2e, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x04, 0x52, 0x08, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, + 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x77, + 0x61, 0x6c, 0x69, 0x6d, 0x70, 0x6c, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x73, 0x2f, 0x70, 0x75, + 0x6c, 0x73, 0x61, 0x72, +} + +var ( + file_message_id_data_proto_rawDescOnce sync.Once + file_message_id_data_proto_rawDescData = file_message_id_data_proto_rawDesc +) + +func file_message_id_data_proto_rawDescGZIP() []byte { + file_message_id_data_proto_rawDescOnce.Do(func() { + file_message_id_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_id_data_proto_rawDescData) + }) + return file_message_id_data_proto_rawDescData +} + +var file_message_id_data_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_message_id_data_proto_goTypes = []interface{}{ + (*MessageIdData)(nil), // 0: milvus.proto.streaming.wal.pulsar.MessageIdData +} +var file_message_id_data_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_message_id_data_proto_init() } +func file_message_id_data_proto_init() { + if File_message_id_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_id_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageIdData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_id_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_id_data_proto_goTypes, + DependencyIndexes: file_message_id_data_proto_depIdxs, + MessageInfos: file_message_id_data_proto_msgTypes, + }.Build() + File_message_id_data_proto = out.File + file_message_id_data_proto_rawDesc = nil + file_message_id_data_proto_goTypes = nil + file_message_id_data_proto_depIdxs = nil +} diff --git a/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto b/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto new file mode 100644 index 0000000000000..44c45c5410fff --- /dev/null +++ b/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto @@ -0,0 +1,13 @@ +syntax = "proto2"; + +package milvus.proto.streaming.wal.pulsar; + +option go_package = "github.com/milvus-io/milvus/pkg/streaming/walimpls/impls/pulsar"; + + +message MessageIdData { + required uint64 ledgerId = 1; + required uint64 entryId = 2; + optional int32 partition = 3; + optional int32 batch_index = 4; +} \ No newline at end of file diff --git a/pkg/streaming/walimpls/impls/pulsar/message_id_test.go b/pkg/streaming/walimpls/impls/pulsar/message_id_test.go index c63422f20ef13..5635c939c9666 100644 --- a/pkg/streaming/walimpls/impls/pulsar/message_id_test.go +++ b/pkg/streaming/walimpls/impls/pulsar/message_id_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/apache/pulsar-client-go/pulsar" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" ) func TestMessageID(t *testing.T) { @@ -40,19 +40,6 @@ func TestMessageID(t *testing.T) { assert.Error(t, err) } -// only for pulsar id unittest. -type MessageIdData struct { - LedgerId *uint64 `protobuf:"varint,1,req,name=ledgerId" json:"ledgerId,omitempty"` - EntryId *uint64 `protobuf:"varint,2,req,name=entryId" json:"entryId,omitempty"` - Partition *int32 `protobuf:"varint,3,opt,name=partition,def=-1" json:"partition,omitempty"` - BatchIndex *int32 `protobuf:"varint,4,opt,name=batch_index,json=batchIndex,def=-1" json:"batch_index,omitempty"` -} - -func (m *MessageIdData) Reset() { *m = MessageIdData{} } -func (m *MessageIdData) String() string { return proto.CompactTextString(m) } - -func (*MessageIdData) ProtoMessage() {} - // newMessageIDOfPulsar only for test. func newMessageIDOfPulsar(ledgerID uint64, entryID uint64, batchIdx int32) pulsarID { id := &MessageIdData{ @@ -60,6 +47,7 @@ func newMessageIDOfPulsar(ledgerID uint64, entryID uint64, batchIdx int32) pulsa EntryId: &entryID, BatchIndex: &batchIdx, } + msg, err := proto.Marshal(id) if err != nil { panic(err) diff --git a/pkg/util/funcutil/placeholdergroup.go b/pkg/util/funcutil/placeholdergroup.go index 538a70fcbefcc..2fa66bdaeac88 100644 --- a/pkg/util/funcutil/placeholdergroup.go +++ b/pkg/util/funcutil/placeholdergroup.go @@ -6,7 +6,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/pkg/util/funcutil/policy.go b/pkg/util/funcutil/policy.go index 1506ff9abb8ef..db10e6a7a1d5b 100644 --- a/pkg/util/funcutil/policy.go +++ b/pkg/util/funcutil/policy.go @@ -1,12 +1,12 @@ package funcutil import ( + "errors" "fmt" "strings" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" @@ -15,34 +15,39 @@ import ( "github.com/milvus-io/milvus/pkg/util" ) -func GetVersion(m proto.GeneratedMessage) (string, error) { - md, _ := descriptor.MessageDescriptorProto(m) - if md == nil { - log.Error("MessageDescriptorProto result is nil") - return "", fmt.Errorf("MessageDescriptorProto result is nil") +func GetVersion(m interface{}) (string, error) { + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetVersion failed", zap.Error(err)) + return "", err } - extObj, err := proto.GetExtension(md.Options, milvuspb.E_MilvusExtObj) - if err != nil { + if !proto.HasExtension(pbMsg.ProtoReflect().Descriptor().Options(), milvuspb.E_MilvusExtObj) { + err := errors.New("Extension not found") log.Error("GetExtension fail", zap.Error(err)) return "", err } + extObj := proto.GetExtension(pbMsg.ProtoReflect().Descriptor().Options(), milvuspb.E_MilvusExtObj) version := extObj.(*milvuspb.MilvusExt).Version log.Debug("GetVersion success", zap.String("version", version)) return version, nil } -func GetPrivilegeExtObj(m proto.GeneratedMessage) (commonpb.PrivilegeExt, error) { - _, md := descriptor.MessageDescriptorProto(m) - if md == nil { - log.RatedInfo(60, "MessageDescriptorProto result is nil") - return commonpb.PrivilegeExt{}, fmt.Errorf("MessageDescriptorProto result is nil") +func GetPrivilegeExtObj(m interface{}) (commonpb.PrivilegeExt, error) { + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetPrivilegeExtObj failed", zap.Error(err)) + return commonpb.PrivilegeExt{}, err } - extObj, err := proto.GetExtension(md.Options, commonpb.E_PrivilegeExtObj) - if err != nil { - log.RatedInfo(60, "GetExtension fail", zap.Error(err)) + if !proto.HasExtension(pbMsg.ProtoReflect().Descriptor().Options(), commonpb.E_PrivilegeExtObj) { + err := errors.New("Extension not found") + log.RatedWarn(60, "GetPrivilegeExtObj failed", zap.Error(err)) return commonpb.PrivilegeExt{}, err } + extObj := proto.GetExtension(pbMsg.ProtoReflect().Descriptor().Options(), commonpb.E_PrivilegeExtObj) + privilegeExt := extObj.(*commonpb.PrivilegeExt) log.RatedDebug(60, "GetPrivilegeExtObj success", zap.String("resource_type", privilegeExt.ObjectType.String()), zap.String("resource_privilege", privilegeExt.ObjectPrivilege.String())) return commonpb.PrivilegeExt{ @@ -54,13 +59,20 @@ func GetPrivilegeExtObj(m proto.GeneratedMessage) (commonpb.PrivilegeExt, error) } // GetObjectName get object name from the grpc message according to the field index. The field is a string. -func GetObjectName(m proto.GeneratedMessage, index int32) string { +func GetObjectName(m interface{}, index int32) string { if index <= 0 { return util.AnyWord } - msg := proto.MessageReflect(proto.MessageV1(m)) - msgDesc := msg.Descriptor() - value := msg.Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) + + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetObjectName fail", zap.Error(err)) + return util.AnyWord + } + + msgDesc := pbMsg.ProtoReflect().Descriptor() + value := pbMsg.ProtoReflect().Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) user, ok := value.Interface().(protoreflect.Message) if ok { userDesc := user.Descriptor() @@ -73,13 +85,20 @@ func GetObjectName(m proto.GeneratedMessage, index int32) string { } // GetObjectNames get object names from the grpc message according to the field index. The field is an array. -func GetObjectNames(m proto.GeneratedMessage, index int32) []string { +func GetObjectNames(m interface{}, index int32) []string { if index <= 0 { return []string{} } - msg := proto.MessageReflect(proto.MessageV1(m)) - msgDesc := msg.Descriptor() - value := msg.Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) + + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetObjectNames fail", zap.Error(err)) + return []string{} + } + + msgDesc := pbMsg.ProtoReflect().Descriptor() + value := pbMsg.ProtoReflect().Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) names, ok := value.Interface().(protoreflect.List) if !ok { return []string{} diff --git a/pkg/util/typeutil/convension.go b/pkg/util/typeutil/convension.go index 95e138b5c50a8..4d0cbd87e0f5f 100644 --- a/pkg/util/typeutil/convension.go +++ b/pkg/util/typeutil/convension.go @@ -22,9 +22,9 @@ import ( "math" "reflect" - "github.com/golang/protobuf/proto" "github.com/x448/float16" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/log" diff --git a/pkg/util/typeutil/schema.go b/pkg/util/typeutil/schema.go index dde76212e4a17..98252c8964661 100644 --- a/pkg/util/typeutil/schema.go +++ b/pkg/util/typeutil/schema.go @@ -28,9 +28,9 @@ import ( "unsafe" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/pkg/util/typeutil/schema_test.go b/pkg/util/typeutil/schema_test.go index b671fcbc2a5fd..ec03333636292 100644 --- a/pkg/util/typeutil/schema_test.go +++ b/pkg/util/typeutil/schema_test.go @@ -23,11 +23,11 @@ import ( "reflect" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -965,7 +965,7 @@ func TestDeleteFieldData(t *testing.T) { assert.Equal(t, BFloat16Vector[0:2*Dim], result1[BFloat16VectorFieldID-common.StartOfUserFieldID].GetVectors().Data.(*schemapb.VectorField_Bfloat16Vector).Bfloat16Vector) tmpSparseFloatVector := proto.Clone(SparseFloatVector).(*schemapb.SparseFloatArray) tmpSparseFloatVector.Contents = [][]byte{SparseFloatVector.Contents[0]} - assert.EqualExportedValues(t, *tmpSparseFloatVector, *result1[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) + assert.Equal(t, tmpSparseFloatVector.Contents, result1[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector().Contents) AppendFieldData(result2, fieldDataArray2, 0) AppendFieldData(result2, fieldDataArray1, 0) diff --git a/scripts/generate_proto.sh b/scripts/generate_proto.sh index a51b1dfe2b5ad..e3981e0a417b7 100755 --- a/scripts/generate_proto.sh +++ b/scripts/generate_proto.sh @@ -29,6 +29,8 @@ API_PROTO_DIR=$ROOT_DIR/cmake_build/thirdparty/milvus-proto/proto CPP_SRC_DIR=$ROOT_DIR/internal/core PROTOC_BIN=$ROOT_DIR/cmake_build/bin/protoc +INSTALL_PATH="$1" + PROGRAM=$(basename "$0") GOPATH=$(go env GOPATH) @@ -37,7 +39,10 @@ if [ -z $GOPATH ]; then exit 1 fi -export PATH=${GOPATH}/bin:$PATH +export PATH=${INSTALL_PATH}:${GOPATH}/bin:$PATH + +echo "using protoc-gen-go: $(which protoc-gen-go)" +echo "using protoc-gen-go-grpc: $(which protoc-gen-go-grpc)" # official go code ship with the crate, so we need to generate it manually. pushd ${PROTO_DIR} @@ -63,22 +68,26 @@ mkdir -p $ROOT_DIR/cmd/tools/migration/legacy/legacypb protoc_opt="${PROTOC_BIN} --proto_path=${API_PROTO_DIR} --proto_path=." -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./etcdpb etcd_meta.proto || { echo 'generate etcd_meta.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./indexcgopb index_cgo_msg.proto || { echo 'generate index_cgo_msg failed '; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./cgopb cgo_msg.proto || { echo 'generate cgo_msg failed '; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./rootcoordpb root_coord.proto || { echo 'generate root_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./internalpb internal.proto || { echo 'generate internal.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./proxypb proxy.proto|| { echo 'generate proxy.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./indexpb index_coord.proto|| { echo 'generate index_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./datapb data_coord.proto|| { echo 'generate data_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./querypb query_coord.proto|| { echo 'generate query_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./planpb plan.proto|| { echo 'generate plan.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./segcorepb segcore.proto|| { echo 'generate segcore.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./clusteringpb clustering.proto|| { echo 'generate clustering.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./streamingpb streaming.proto|| { echo 'generate streamingpb.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./etcdpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./etcdpb etcd_meta.proto || { echo 'generate etcd_meta.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./indexcgopb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./indexcgopb index_cgo_msg.proto || { echo 'generate index_cgo_msg failed '; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./cgopb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./cgopb cgo_msg.proto || { echo 'generate cgo_msg failed '; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./rootcoordpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./rootcoordpb root_coord.proto || { echo 'generate root_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./internalpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./internalpb internal.proto || { echo 'generate internal.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./proxypb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./proxypb proxy.proto|| { echo 'generate proxy.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./indexpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./indexpb index_coord.proto|| { echo 'generate index_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./datapb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./datapb data_coord.proto|| { echo 'generate data_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./querypb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./querypb query_coord.proto|| { echo 'generate query_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./planpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./planpb plan.proto|| { echo 'generate plan.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./segcorepb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./segcorepb segcore.proto|| { echo 'generate segcore.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./clusteringpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./clusteringpb clustering.proto|| { echo 'generate clustering.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./streamingpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./streamingpb streaming.proto|| { echo 'generate streamingpb.proto failed'; exit 1; } + + +${protoc_opt} --proto_path=$ROOT_DIR/pkg/eventlog/ --go_out=paths=source_relative:../../pkg/eventlog/ --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:../../pkg/eventlog/ event_log.proto || { echo 'generate event_log.proto failed'; exit 1; } +${protoc_opt} --proto_path=$ROOT_DIR/cmd/tools/migration/backend --go_out=paths=source_relative:../../cmd/tools/migration/backend/ --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:../../cmd/tools/migration/backend backup_header.proto || { echo 'generate backup_header.proto failed'; exit 1; } ${protoc_opt} --proto_path=$ROOT_DIR/cmd/tools/migration/legacy/ \ - --go_out=plugins=grpc,paths=source_relative:../../cmd/tools/migration/legacy/legacypb legacy.proto || { echo 'generate legacy.proto failed'; exit 1; } + --go_out=paths=source_relative:../../cmd/tools/migration/legacy/legacypb legacy.proto || { echo 'generate legacy.proto failed'; exit 1; } ${protoc_opt} --cpp_out=$CPP_SRC_DIR/src/pb schema.proto|| { echo 'generate schema.proto failed'; exit 1; } ${protoc_opt} --cpp_out=$CPP_SRC_DIR/src/pb common.proto|| { echo 'generate common.proto failed'; exit 1; } @@ -93,6 +102,6 @@ popd pushd $ROOT_DIR/pkg/streaming/util/message/messagepb # streaming node message protobuf -${PROTOC_BIN} --proto_path=. --go_out=plugins=grpc,paths=source_relative:. message.proto +${protoc_opt} --go_out=paths=source_relative:./ --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./ message.proto popd \ No newline at end of file diff --git a/tests/go_client/go.mod b/tests/go_client/go.mod index bf0e7de0b959d..4e52093107c6b 100644 --- a/tests/go_client/go.mod +++ b/tests/go_client/go.mod @@ -14,7 +14,7 @@ require ( google.golang.org/grpc v1.64.0 ) -replace github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 => ../../../milvus/client +// replace github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 => ../../../milvus/client require ( github.com/beorn7/perks v1.0.1 // indirect diff --git a/tests/go_client/go.sum b/tests/go_client/go.sum index 6314e4ad36eb4..6b8914e680627 100644 --- a/tests/go_client/go.sum +++ b/tests/go_client/go.sum @@ -403,6 +403,8 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632 h1:CXig0DNtUsCLzchCFe3PR2KgOdobbz9gK2nSV7195PM= github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= +github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 h1:Qxyz3e0IlGmqf126iYgmKKEVpSbNStb6LfInpUhtFtk= +github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68/go.mod h1:13uL9ukc9KRK5ZtWqWwaORWlRccZLIysZzT6KUlOx+A= github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3 h1:ZBpRWhBa7FTFxW4YYVv9AUESoW1Xyb3KNXTzTqfkZmw= github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3/go.mod h1:jQ2BUZny1COsgv1Qbcv8dmbppW+V9J/c4YQZNb3EOm8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= diff --git a/tests/integration/alias/alias_test.go b/tests/integration/alias/alias_test.go index 85dfb1eda656e..a557007f5c9b0 100644 --- a/tests/integration/alias/alias_test.go +++ b/tests/integration/alias/alias_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/balance/balance_test.go b/tests/integration/balance/balance_test.go index b0df436e68431..01fa98af5a62f 100644 --- a/tests/integration/balance/balance_test.go +++ b/tests/integration/balance/balance_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/balance/channel_exclusive_balance_test.go b/tests/integration/balance/channel_exclusive_balance_test.go index 08799745d43b6..fd9e9aeec5176 100644 --- a/tests/integration/balance/channel_exclusive_balance_test.go +++ b/tests/integration/balance/channel_exclusive_balance_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/bloomfilter/bloom_filter_test.go b/tests/integration/bloomfilter/bloom_filter_test.go index 595ecdd025a3c..5635c2ce753b0 100644 --- a/tests/integration/bloomfilter/bloom_filter_test.go +++ b/tests/integration/bloomfilter/bloom_filter_test.go @@ -23,10 +23,10 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/channel_balance/channel_balance_test.go b/tests/integration/channel_balance/channel_balance_test.go index d69da10db2e7b..edb86ffd03115 100644 --- a/tests/integration/channel_balance/channel_balance_test.go +++ b/tests/integration/channel_balance/channel_balance_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/clustering_compaction_test.go b/tests/integration/compaction/clustering_compaction_test.go index 49f0905d3bd91..628d38de68d57 100644 --- a/tests/integration/compaction/clustering_compaction_test.go +++ b/tests/integration/compaction/clustering_compaction_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/l0_compaction_test.go b/tests/integration/compaction/l0_compaction_test.go index 984e8eb3ce5e5..7b70433879b79 100644 --- a/tests/integration/compaction/l0_compaction_test.go +++ b/tests/integration/compaction/l0_compaction_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/mix_compaction_test.go b/tests/integration/compaction/mix_compaction_test.go index b51636be5fd1e..c043d65247646 100644 --- a/tests/integration/compaction/mix_compaction_test.go +++ b/tests/integration/compaction/mix_compaction_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/coorddownsearch/search_after_coord_down_test.go b/tests/integration/coorddownsearch/search_after_coord_down_test.go index a922d15f423b5..0a0df039dc34e 100644 --- a/tests/integration/coorddownsearch/search_after_coord_down_test.go +++ b/tests/integration/coorddownsearch/search_after_coord_down_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/coordrecovery/coord_recovery_test.go b/tests/integration/coordrecovery/coord_recovery_test.go index b111eda94ff5c..2ca2a455fc33f 100644 --- a/tests/integration/coordrecovery/coord_recovery_test.go +++ b/tests/integration/coordrecovery/coord_recovery_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/datanode/compaction_test.go b/tests/integration/datanode/compaction_test.go index 051b189a388b1..8cd7e77c6a8c5 100644 --- a/tests/integration/datanode/compaction_test.go +++ b/tests/integration/datanode/compaction_test.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/datanode/datanode_test.go b/tests/integration/datanode/datanode_test.go index 0fd620ce2fe92..dc04750624026 100644 --- a/tests/integration/datanode/datanode_test.go +++ b/tests/integration/datanode/datanode_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/expression/expression_test.go b/tests/integration/expression/expression_test.go index 859a7a4e876fe..4278f7ddb09c0 100644 --- a/tests/integration/expression/expression_test.go +++ b/tests/integration/expression/expression_test.go @@ -22,9 +22,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/getvector/get_vector_test.go b/tests/integration/getvector/get_vector_test.go index d795567fd7992..7ee16d68aa1e6 100644 --- a/tests/integration/getvector/get_vector_test.go +++ b/tests/integration/getvector/get_vector_test.go @@ -22,8 +22,8 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/hellomilvus/hello_milvus_test.go b/tests/integration/hellomilvus/hello_milvus_test.go index bd6e2b04ab1c4..4361d23955fe4 100644 --- a/tests/integration/hellomilvus/hello_milvus_test.go +++ b/tests/integration/hellomilvus/hello_milvus_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/hybridsearch/hybridsearch_test.go b/tests/integration/hybridsearch/hybridsearch_test.go index 6d4ffbb2d9a3c..a0fa638c5a307 100644 --- a/tests/integration/hybridsearch/hybridsearch_test.go +++ b/tests/integration/hybridsearch/hybridsearch_test.go @@ -7,9 +7,9 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/binlog_test.go b/tests/integration/import/binlog_test.go index d1368e110d83d..29629bacdce6c 100644 --- a/tests/integration/import/binlog_test.go +++ b/tests/integration/import/binlog_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/dynamic_field_test.go b/tests/integration/import/dynamic_field_test.go index 2b6baa4137a7f..f714176af0060 100644 --- a/tests/integration/import/dynamic_field_test.go +++ b/tests/integration/import/dynamic_field_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/import_test.go b/tests/integration/import/import_test.go index e59eeffeba637..4e8c4f85f3082 100644 --- a/tests/integration/import/import_test.go +++ b/tests/integration/import/import_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/multi_vector_test.go b/tests/integration/import/multi_vector_test.go index aef5014954cf3..7738853a56bd3 100644 --- a/tests/integration/import/multi_vector_test.go +++ b/tests/integration/import/multi_vector_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/partition_key_test.go b/tests/integration/import/partition_key_test.go index b9cba86c84b50..68424f3c41f3e 100644 --- a/tests/integration/import/partition_key_test.go +++ b/tests/integration/import/partition_key_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/indexstat/get_index_statistics_test.go b/tests/integration/indexstat/get_index_statistics_test.go index 95d3b51c3cca4..eb740a70554e8 100644 --- a/tests/integration/indexstat/get_index_statistics_test.go +++ b/tests/integration/indexstat/get_index_statistics_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/insert/insert_test.go b/tests/integration/insert/insert_test.go index 7c9cc4c6d6945..bf08bb9520c77 100644 --- a/tests/integration/insert/insert_test.go +++ b/tests/integration/insert/insert_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/jsonexpr/json_expr_test.go b/tests/integration/jsonexpr/json_expr_test.go index fed41147da403..f194c877afb9f 100644 --- a/tests/integration/jsonexpr/json_expr_test.go +++ b/tests/integration/jsonexpr/json_expr_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/materialized_view/materialized_view_test.go b/tests/integration/materialized_view/materialized_view_test.go index 8322f266dd2c1..cf2c484a2a609 100644 --- a/tests/integration/materialized_view/materialized_view_test.go +++ b/tests/integration/materialized_view/materialized_view_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/meta_watcher.go b/tests/integration/meta_watcher.go index 8434f16e6333c..1fe255d8a041f 100644 --- a/tests/integration/meta_watcher.go +++ b/tests/integration/meta_watcher.go @@ -24,9 +24,9 @@ import ( "sort" "time" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/tests/integration/meta_watcher_test.go b/tests/integration/meta_watcher_test.go index 5206984224243..5a44b817065dc 100644 --- a/tests/integration/meta_watcher_test.go +++ b/tests/integration/meta_watcher_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/partialsearch/partial_search_test.go b/tests/integration/partialsearch/partial_search_test.go index 790802e63037d..2040a3c8bd584 100644 --- a/tests/integration/partialsearch/partial_search_test.go +++ b/tests/integration/partialsearch/partial_search_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/partitionkey/partition_key_test.go b/tests/integration/partitionkey/partition_key_test.go index 010525a818769..f76f1af6db09d 100644 --- a/tests/integration/partitionkey/partition_key_test.go +++ b/tests/integration/partitionkey/partition_key_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/querynode/querynode_test.go b/tests/integration/querynode/querynode_test.go index 420076d9bf085..9e04d94bf8a2c 100644 --- a/tests/integration/querynode/querynode_test.go +++ b/tests/integration/querynode/querynode_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/rangesearch/range_search_test.go b/tests/integration/rangesearch/range_search_test.go index c264ba5bcc1ea..91d4006d24fd6 100644 --- a/tests/integration/rangesearch/range_search_test.go +++ b/tests/integration/rangesearch/range_search_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/refreshconfig/refresh_config_test.go b/tests/integration/refreshconfig/refresh_config_test.go index e6b35c471d1db..df22cf7b75933 100644 --- a/tests/integration/refreshconfig/refresh_config_test.go +++ b/tests/integration/refreshconfig/refresh_config_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/rg/resource_group_test.go b/tests/integration/rg/resource_group_test.go index 02bd486f54e14..e21dc48937377 100644 --- a/tests/integration/rg/resource_group_test.go +++ b/tests/integration/rg/resource_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" diff --git a/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go b/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go index d071351b076be..44e0265230946 100644 --- a/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go +++ b/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go @@ -22,10 +22,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/sparse/sparse_test.go b/tests/integration/sparse/sparse_test.go index 482d6c9fd33ae..dbed305eeb6fb 100644 --- a/tests/integration/sparse/sparse_test.go +++ b/tests/integration/sparse/sparse_test.go @@ -22,9 +22,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/target/target_test.go b/tests/integration/target/target_test.go index e6b739d69c615..097a977c00c51 100644 --- a/tests/integration/target/target_test.go +++ b/tests/integration/target/target_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/upsert/upsert_test.go b/tests/integration/upsert/upsert_test.go index 4159352008b50..f3af8df26cb2a 100644 --- a/tests/integration/upsert/upsert_test.go +++ b/tests/integration/upsert/upsert_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/util_collection.go b/tests/integration/util_collection.go index bd8fdc0db2fc8..a327c2de9c8d2 100644 --- a/tests/integration/util_collection.go +++ b/tests/integration/util_collection.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/util_query.go b/tests/integration/util_query.go index e44c1ab162cab..f43b8a8789fab 100644 --- a/tests/integration/util_query.go +++ b/tests/integration/util_query.go @@ -25,7 +25,7 @@ import ( "strconv" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"