From 6a04373c263b7917a343cebc2ed2a4dbd10a041b Mon Sep 17 00:00:00 2001 From: "maksim.konovalov" Date: Tue, 14 Jan 2025 13:52:24 +0300 Subject: [PATCH] Release v2.0.0 --- CHANGELOG.md | 12 +++++++++++- README.md | 6 +++--- README_ru.md | 10 +++++----- docs/doc_ru.md | 4 ++-- go.mod | 5 +++-- go.sum | 6 ++++-- mocks/topology/topology_controller.go | 2 +- providers/etcd/provider.go | 2 +- providers/etcd/provider_integration_test.go | 5 +++-- providers/static/provider.go | 2 +- providers/static/provider_test.go | 2 +- providers/viper/moonlibs/convert.go | 2 +- providers/viper/provider.go | 6 +++--- providers/viper/provider_test.go | 2 +- providers/viper/tarantool3/convert.go | 2 +- providers_test.go | 2 +- replicaset_test.go | 2 +- tarantool_test.go | 6 +++--- tests/tnt/call_bench_test.go | 4 ++-- tests/tnt/cfgmaker.go | 2 +- tests/tnt/concurrent_topology_test.go | 2 +- tests/tnt/replicaset_test.go | 4 ++-- tests/tnt/tnt_test.go | 2 +- topology_test.go | 2 +- vshard_shadow_test.go | 4 ++-- 25 files changed, 56 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f6b54..3bbc2d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -## Unreleased +## v2.0.0 + +We are excited to announce the release of version v2! +This major update was necessary due to the initial design of interfaces that were either incorrect or redundant. +In addition, we have fully adapted to work with Tarantool 3, +eliminating the dependency on UUID-based replica sets and instances. +While you can still use these elements for supplementary information, they are no longer mandatory. +The update also includes changes to several previously public methods, +which were not intended to be exposed in the original vshard implementation. +We would like to express our gratitude to everyone who shared their migration issues with us, +as your feedback was invaluable in shaping the current state of the interfaces. FEATURES: diff --git a/README.md b/README.md index fcfda17..c1c07bc 100644 --- a/README.md +++ b/README.md @@ -71,14 +71,14 @@ graph TD With [Go module](https://github.com/golang/go/wiki/Modules) support, simply add the following import ``` -import "github.com/tarantool/go-vshard-router" +import "github.com/tarantool/go-vshard-router/v2" ``` to your code, and then `go [build|run|test]` will automatically fetch the necessary dependencies. Otherwise, run the following Go command to install the `go-vshard-router` package: ```sh -$ go get -u github.com/tarantool/go-vshard-router +$ go get -u github.com/tarantool/go-vshard-router/v2 ``` ### Running Go-Vshard-Router @@ -95,7 +95,7 @@ import ( "time" vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + "github.com/tarantool/go-vshard-router/v2/providers/static" "github.com/google/uuid" "github.com/tarantool/go-tarantool/v2" diff --git a/README_ru.md b/README_ru.md index 79903d2..1b46a5d 100644 --- a/README_ru.md +++ b/README_ru.md @@ -70,14 +70,14 @@ graph TD С помощью [Go module](https://github.com/golang/go/wiki/Modules) можно добавить следующий импорт ``` -import "github.com/tarantool/go-vshard-router" +import "github.com/tarantool/go-vshard-router/v2" ``` в ваш код, а затем `go [build|run|test]` автоматически получит необходимые зависимости. В противном случае выполните следующую команду Go, чтобы установить пакет go-vshard-router: ```sh -$ go get -u github.com/tarantool/go-vshard-router +$ go get -u github.com/tarantool/go-vshard-router/v2 ``` ### Использование Go-Vshard-Router @@ -93,8 +93,8 @@ import ( "strconv" "time" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" "github.com/google/uuid" "github.com/tarantool/go-tarantool/v2" @@ -215,7 +215,7 @@ func main() { ![Image alt](docs/static/not-direct.png) -[actions-badge]: https://github.com/tarantool/go-vshard-router/actions/workflows/main.yml/badge.svg +[actions-badge]: https://github.com/tarantool/go-vshard-router/v2/actions/workflows/main.yml/badge.svg [actions-url]: https://github.com/tarantool/go-vshard-router/actions/workflows/main.yml [coverage-badge]: https://coveralls.io/repos/github/tarantool/go-vshard-router/badge.svg?branch=master [coverage-url]: https://coveralls.io/github/tarantool/go-vshard-router?branch=master \ No newline at end of file diff --git a/docs/doc_ru.md b/docs/doc_ru.md index fdedcd2..612515e 100644 --- a/docs/doc_ru.md +++ b/docs/doc_ru.md @@ -79,8 +79,8 @@ import ( "github.com/google/uuid" "github.com/tarantool/go-tarantool/v2" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" ) func main() { diff --git a/go.mod b/go.mod index 9a13892..874df35 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tarantool/go-vshard-router +module github.com/tarantool/go-vshard-router/v2 go 1.22 @@ -8,11 +8,12 @@ require ( github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 github.com/tarantool/go-tarantool/v2 v2.2.1 + github.com/tarantool/go-vshard-router v1.3.2 github.com/vmihailenco/msgpack/v5 v5.4.1 go.etcd.io/etcd/client/v2 v2.305.17 go.etcd.io/etcd/client/v3 v3.5.17 go.etcd.io/etcd/server/v3 v3.5.17 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.10.0 ) require ( diff --git a/go.sum b/go.sum index aa24e4a..59b4669 100644 --- a/go.sum +++ b/go.sum @@ -350,6 +350,8 @@ github.com/tarantool/go-iproto v1.1.0 h1:HULVOIHsiehI+FnHfM7wMDntuzUddO09DKqu2Wn github.com/tarantool/go-iproto v1.1.0/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo= github.com/tarantool/go-tarantool/v2 v2.2.1 h1:ldzMVfkmTuJl4ie3ByMIr+mmPSKDVTcSkN8XlVZEows= github.com/tarantool/go-tarantool/v2 v2.2.1/go.mod h1:hKKeZeCP8Y8+U6ZFS32ot1jHV/n4WKVP4fjRAvQznMY= +github.com/tarantool/go-vshard-router v1.3.2 h1:30ZQIZGj5U6TaAK8NXgTUYgpns938KDQKApnkcqz2Ps= +github.com/tarantool/go-vshard-router v1.3.2/go.mod h1:+ZRedQeNcP5EUjtQg2BKHS9b40u2A3V+IEo2QqTpKJY= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -468,8 +470,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/mocks/topology/topology_controller.go b/mocks/topology/topology_controller.go index e41a0c1..f67e8a6 100644 --- a/mocks/topology/topology_controller.go +++ b/mocks/topology/topology_controller.go @@ -8,7 +8,7 @@ import ( uuid "github.com/google/uuid" mock "github.com/stretchr/testify/mock" - vshard_router "github.com/tarantool/go-vshard-router" + vshard_router "github.com/tarantool/go-vshard-router/v2" ) // TopologyController is an autogenerated mock type for the TopologyController type diff --git a/providers/etcd/provider.go b/providers/etcd/provider.go index 422b376..db6fec3 100644 --- a/providers/etcd/provider.go +++ b/providers/etcd/provider.go @@ -6,7 +6,7 @@ import ( "path/filepath" "github.com/google/uuid" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" "go.etcd.io/etcd/client/v2" ) diff --git a/providers/etcd/provider_integration_test.go b/providers/etcd/provider_integration_test.go index 84ef59c..c3b2519 100644 --- a/providers/etcd/provider_integration_test.go +++ b/providers/etcd/provider_integration_test.go @@ -5,10 +5,11 @@ package etcd import ( "fmt" - mocktopology "github.com/tarantool/go-vshard-router/mocks/topology" - "go.etcd.io/etcd/client/v2" "testing" "time" + + mocktopology "github.com/tarantool/go-vshard-router/v2/mocks/topology" + "go.etcd.io/etcd/client/v2" ) func TestNewProvider(t *testing.T) { diff --git a/providers/static/provider.go b/providers/static/provider.go index 9965829..7629598 100644 --- a/providers/static/provider.go +++ b/providers/static/provider.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) // Check that provider implements TopologyProvider interface diff --git a/providers/static/provider_test.go b/providers/static/provider_test.go index 1007142..cf376fd 100644 --- a/providers/static/provider_test.go +++ b/providers/static/provider_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) func TestNewProvider(t *testing.T) { diff --git a/providers/viper/moonlibs/convert.go b/providers/viper/moonlibs/convert.go index 6426590..bd99807 100644 --- a/providers/viper/moonlibs/convert.go +++ b/providers/viper/moonlibs/convert.go @@ -4,7 +4,7 @@ import ( "log" "github.com/google/uuid" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) func (cfg *Config) Convert() map[vshardrouter.ReplicasetInfo][]vshardrouter.InstanceInfo { diff --git a/providers/viper/provider.go b/providers/viper/provider.go index 1cdfeb3..1c41ff3 100644 --- a/providers/viper/provider.go +++ b/providers/viper/provider.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" srcviper "github.com/spf13/viper" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/viper/moonlibs" - "github.com/tarantool/go-vshard-router/providers/viper/tarantool3" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/viper/moonlibs" + "github.com/tarantool/go-vshard-router/v2/providers/viper/tarantool3" ) // Check that provider implements TopologyProvider interface diff --git a/providers/viper/provider_test.go b/providers/viper/provider_test.go index 121d846..3c926ce 100644 --- a/providers/viper/provider_test.go +++ b/providers/viper/provider_test.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/viper" _ "github.com/spf13/viper/remote" "github.com/stretchr/testify/require" - vprovider "github.com/tarantool/go-vshard-router/providers/viper" + vprovider "github.com/tarantool/go-vshard-router/v2/providers/viper" clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/server/v3/embed" ) diff --git a/providers/viper/tarantool3/convert.go b/providers/viper/tarantool3/convert.go index 1cd2e37..7bd0d8e 100644 --- a/providers/viper/tarantool3/convert.go +++ b/providers/viper/tarantool3/convert.go @@ -1,7 +1,7 @@ package tarantool3 import ( - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) func (cfg *Config) Convert() map[vshardrouter.ReplicasetInfo][]vshardrouter.InstanceInfo { diff --git a/providers_test.go b/providers_test.go index 0d16071..8a7a809 100644 --- a/providers_test.go +++ b/providers_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) var ( diff --git a/replicaset_test.go b/replicaset_test.go index e1a4658..78decfc 100644 --- a/replicaset_test.go +++ b/replicaset_test.go @@ -12,7 +12,7 @@ import ( "github.com/tarantool/go-tarantool/v2" "github.com/vmihailenco/msgpack/v5" - mockpool "github.com/tarantool/go-vshard-router/mocks/pool" + mockpool "github.com/tarantool/go-vshard-router/v2/mocks/pool" ) func TestReplicasetInfo_String(t *testing.T) { diff --git a/tarantool_test.go b/tarantool_test.go index c7067bc..78fe6e4 100644 --- a/tarantool_test.go +++ b/tarantool_test.go @@ -15,9 +15,9 @@ import ( "github.com/tarantool/go-tarantool/v2/box" "github.com/tarantool/go-tarantool/v2/pool" "github.com/tarantool/go-tarantool/v2/test_helpers" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" - chelper "github.com/tarantool/go-vshard-router/test_helper" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" + chelper "github.com/tarantool/go-vshard-router/v2/test_helper" "github.com/vmihailenco/msgpack/v5" ) diff --git a/tests/tnt/call_bench_test.go b/tests/tnt/call_bench_test.go index 39a7758..ae09fd5 100644 --- a/tests/tnt/call_bench_test.go +++ b/tests/tnt/call_bench_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tarantool/go-tarantool/v2" "github.com/tarantool/go-tarantool/v2/pool" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" ) type Product struct { diff --git a/tests/tnt/cfgmaker.go b/tests/tnt/cfgmaker.go index 6a7ba01..27e5f4c 100644 --- a/tests/tnt/cfgmaker.go +++ b/tests/tnt/cfgmaker.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/google/uuid" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) type cfgmaker struct { diff --git a/tests/tnt/concurrent_topology_test.go b/tests/tnt/concurrent_topology_test.go index 6ecd4ad..7f1e406 100644 --- a/tests/tnt/concurrent_topology_test.go +++ b/tests/tnt/concurrent_topology_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/stretchr/testify/require" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) type concurrentTopologyProvider struct { diff --git a/tests/tnt/replicaset_test.go b/tests/tnt/replicaset_test.go index 94a1d21..bbfe270 100644 --- a/tests/tnt/replicaset_test.go +++ b/tests/tnt/replicaset_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tarantool/go-tarantool/v2" "github.com/tarantool/go-tarantool/v2/pool" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" ) func TestReplicsetCallAsync(t *testing.T) { diff --git a/tests/tnt/tnt_test.go b/tests/tnt/tnt_test.go index 3852e9a..32ff5ee 100644 --- a/tests/tnt/tnt_test.go +++ b/tests/tnt/tnt_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - vshardrouter "github.com/tarantool/go-vshard-router" + vshardrouter "github.com/tarantool/go-vshard-router/v2" ) const ( diff --git a/topology_test.go b/topology_test.go index 4611068..5a06ce0 100644 --- a/topology_test.go +++ b/topology_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - mockpool "github.com/tarantool/go-vshard-router/mocks/pool" + mockpool "github.com/tarantool/go-vshard-router/v2/mocks/pool" ) func TestRouter_Topology(t *testing.T) { diff --git a/vshard_shadow_test.go b/vshard_shadow_test.go index 63e06a3..6677565 100644 --- a/vshard_shadow_test.go +++ b/vshard_shadow_test.go @@ -8,8 +8,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - vshardrouter "github.com/tarantool/go-vshard-router" - "github.com/tarantool/go-vshard-router/providers/static" + vshardrouter "github.com/tarantool/go-vshard-router/v2" + "github.com/tarantool/go-vshard-router/v2/providers/static" ) type errorTopologyProvider struct{}