Commit graph

271 commits

Author SHA1 Message Date
Evgenii Stratonikov
1ac6b819c5 [#44] signature: move package from neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:52:41 +03:00
Evgenii Stratonikov
372468c320 [#41] container: move id from neofs-api-go
Change `Marshal` signature to `Marshal() ([]byte, error)`.
Dependency update in SDK itself should be done after moving client
as `pool` package has some dependent function signatures.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:52:27 +03:00
Evgenii Stratonikov
ee42623a3e [#43] owner: move package from neofs-api-go
Also remove neofs-crypto dependency.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:51:55 +03:00
Evgenii Stratonikov
46353456f1 [#48] pool/test: add missing EXPECT calls
Another possible panic (though quite rare).
```
--- FAIL: TestTwoNodes (0.00s)
    pool.go:185: Unexpected call to *pool.MockClient.EndpointInfo([context.Background.WithCancel.WithDeadline(2021-10-26 15:50:50.005585875 +0300 MSK m=+1.216577808 [-940.323µs])]) at /home/dzeta/repo/neofs-sdk-go/pool/pool.go:185 because: there are no expected calls of the method "EndpointInfo" for that receiver
    pool.go:185: Unexpected call to *pool.MockClient.EndpointInfo([context.Background.WithCancel.WithDeadline(2021-10-26 15:50:50.005715623 +0300 MSK m=+1.216707547 [-1.351991ms])]) at /home/dzeta/repo/neofs-sdk-go/pool/pool.go:185 because: there are no expected calls of the method "EndpointInfo" for that receiver
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:51:21 +03:00
Evgenii Stratonikov
f3f8ce01d3 [#48] pool/test: add go:generate line for mocks generation
We also don't use mocks for `Pool`.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:51:21 +03:00
Evgenii Stratonikov
cd5e08d725 [#48] pool: add Close method
Fix occasional panic in tests:
```
> for i in (seq 1 100); go test -race -count=1 ./pool/... ; end
...
{"level":"warn","ts":1635251466.567485,"caller":"pool/pool.go:122","msg":"failed to create neofs session token for client","address":"peer0","error":"error session"}
panic: Fail in goroutine after TestTwoNodes has completed

goroutine 6 [running]:
testing.(*common).Fail(0xc0002e1380)
        /usr/lib/go/src/testing/testing.go:710 +0x1b4
testing.(*common).FailNow(0xc0002e1380)
        /usr/lib/go/src/testing/testing.go:732 +0x2f
testing.(*common).Fatalf(0xc000074070, {0xd9d816, 0x2e}, {0xc000094050, 0x5, 0x5})
        /usr/lib/go/src/testing/testing.go:830 +0x85
github.com/golang/mock/gomock.(*Controller).Call.func1(0xc0002f4120, {0xd68380, 0xc0002dac30}, {0xd8847f, 0xc}, {0xc000074020, 0x1, 0x1})
        /home/dzeta/go/pkg/mod/github.com/golang/mock@v1.6.0/gomock/controller.go:231 +0x44d
github.com/golang/mock/gomock.(*Controller).Call(0xc0002f4120, {0xd68380, 0xc0002dac30}, {0xd8847f, 0xc}, {0xc000074020, 0x1, 0x1})
        /home/dzeta/go/pkg/mod/github.com/golang/mock@v1.6.0/gomock/controller.go:247 +0xce
github.com/nspcc-dev/neofs-sdk-go/pool.(*MockClient).EndpointInfo(0xc0002dac30, {0xe85528, 0xc00008a120}, {0x0, 0x0, 0x0})
        /home/dzeta/repo/neofs-sdk-go/pool/mock_test.go:186 +0x298
github.com/nspcc-dev/neofs-sdk-go/pool.updateNodesHealth.func1(0x1, {0xe950d8, 0xc0002dac30})
        /home/dzeta/repo/neofs-sdk-go/pool/pool.go:183 +0x188
created by github.com/nspcc-dev/neofs-sdk-go/pool.updateNodesHealth
        /home/dzeta/repo/neofs-sdk-go/pool/pool.go:174 +0x233
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:51:21 +03:00
Evgenii Stratonikov
d541aab1ff [#48] pool/test: remove defer for controller close
We have go1.16 in go.mod and `gomock.NewController` comment indicates:
```
New in go1.14+, if you are passing a *testing.T into this function you no
longer need to call ctrl.Finish() in your test methods.
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-01 17:51:21 +03:00
Alex Vanin
a64aa36c1a [#39] accounting: Move decimal structure to SDK
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-28 14:52:59 +03:00
Evgenii Stratonikov
22ea9687af [#42] policy: use SDK netmap version
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-28 14:50:33 +03:00
Evgenii Stratonikov
369bd382b3 [#42] netmap: move package from neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-28 14:50:33 +03:00
Evgenii Stratonikov
1bd89bf797 [#42] go.mod: update neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-28 14:50:33 +03:00
Evgenii Stratonikov
9435f4171b [#40] acl: move ACL types from neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-27 19:42:38 +03:00
Angira Kekteeva
5d2a913355 [#37] ci: Add github workflows
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-10-15 17:37:18 +03:00
Angira Kekteeva
2a90ddbda4 [#37] ci: Replace golint by revive
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-10-15 17:37:18 +03:00
Evgenii Stratonikov
6e3836cb1d [#35] policy: remove netmap/v2 dependency
Also, fix tests.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-09-14 10:21:56 +03:00
Denis Kirillov
880f3a61e5 [#32] Require at least one healthy node
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-09-09 14:46:46 +03:00
Alex Vanin
234373f249 [#31] pool: Do not invoke EndpointInfo to find the address
Since we transformed the pool of gRPC connection into the pool of
neofs clients, we don't need to call EndpointInfo to fetch the
address of the node for the beautiful error output.

Moreover it is done incorrectly, because c.CreateSession may return
context.Cancelled error (graceful shutdown). We will reuse the same
context for the EndpointInfo call which will lead to a
timeout freeze.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-07 13:54:34 +03:00
Alex Vanin
c55ae2c13f
Merge pull request #30 from masterSplinter01/misc/26-move-pkg-subfolders
Move /pkg subfolders to the root
2021-07-28 15:21:17 +03:00
Angira Kekteeva
c0101c6561 [#26] policy: Update imports
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-07-28 13:47:27 +03:00
Angira Kekteeva
628ae20c72 [#26] *: Move pkg content to root
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-07-28 13:47:27 +03:00
Denis Kirillov
d95d722d61 [#28] Add recreating session token
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-07-28 12:37:55 +03:00
Alex Vanin
cb0a844cae
Merge pull request #27 from KirillovDenis/feature/16-pool_tests
[#16] Add pool tests
2021-07-26 15:45:45 +03:00
Denis Kirillov
9d2c7d9a04 [#16] Update neo-go version
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-07-26 15:23:27 +03:00
Denis Kirillov
3af734a723 [#16] Add mock
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-07-23 12:07:30 +03:00
Denis Kirillov
7a0128e6ff [#16] Fix TestHealthyReweight
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-07-20 11:06:45 +03:00
Denis Kirillov
edc1382178 [#16] Add pool tests with mock node
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-07-20 11:02:14 +03:00
Alex Vanin
393034fd73
Merge pull request #25 from masterSplinter01/24-update-api-go
Update api go
2021-07-07 17:24:03 +03:00
Angira Kekteeva
6ad584e11d Add vendor directory to gitignore
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-07-07 17:20:36 +03:00
Angira Kekteeva
317d4400a5 [#24] Update api-go vesion to 1.28.3
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-07-07 17:20:36 +03:00
Alex Vanin
3904339f2f
Merge pull request #23 from cthulhu-rider/upd-apigo-v1.28.2
Update NeoFS API Go library to v1.28.2
2021-07-06 14:53:13 +03:00
Leonard Lyubich
9c906987ca [#23] Remove usage of deprecated code elements in API Go v1.28.2
Remove usage of deprecated `NodeInfo.Address` method. Replace it with new
methods which work with group of addresses.
2021-07-06 12:22:54 +03:00
Leonard Lyubich
0aa14a6d82 [#23] Update NeoFS API Go library to v1.28.2
Release includes fix of session token corruption by `Client`.
2021-07-06 12:22:51 +03:00
Kirillov Denis
0348eb331c
Merge pull request #22 from masterSplinter01/fix/session-token-overlap
Change order of CallOptions in return of pool.conn
2021-06-24 10:23:35 +03:00
Angira Kekteeva
11abaa7f68 Change order of CallOptions in return of pool.conn
Moved WithSession with session token got from pool.Connection
to the top of returned slice because it overlaps WithSession in
'option' parameter

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-06-23 17:55:39 +03:00
Roman Khimov
aef1e3fc7c
Merge pull request #21 from masterSplinter01/fix/add-check-to-interface
Add WaitFotContainerPresence to Pool Interface
2021-06-22 18:02:03 +03:00
Angira Kekteeva
7065831db4 Add WaitFotContainerPresence to Pool Interface
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-06-22 17:55:47 +03:00
Roman Khimov
bcceec6e8b
Merge pull request #20 from masterSplinter01/feature/19-client-container-in-pool
[#19] Implement client.Container interface in pool
2021-06-22 15:03:21 +03:00
Roman Khimov
3fc452458f
Merge pull request #18 from KirillovDenis/bugfix/15-sampler_healthy_reweight
[#15] Added healthy node rebalance
2021-06-22 15:00:24 +03:00
Denis Kirillov
0e873fc5ca [#15] Added healthy node rebalance
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-06-22 14:08:20 +03:00
Angira Kekteeva
7776237d0b [#19] Implement client.Container interface in pool
Also addded function polling is container created.

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-06-22 13:51:58 +03:00
Roman Khimov
29f860b4dd
Merge pull request #17 from KirillovDenis/feature/14-sampler_tests
[#14] Added tests for sampler
2021-06-18 16:27:40 +03:00
Denis Kirillov
eeeaa8a4fd [#14] Added tests for sampler
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-06-18 16:24:57 +03:00
Roman Khimov
56ef32f21e
Merge pull request #3 from fyrchik/policy-parser
Use ANTLR for policy parsing
2021-06-15 13:21:34 +03:00
Evgenii Stratonikov
4a0ed2f6ea [#3] policy: update doc.go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-15 11:42:14 +03:00
Evgenii Stratonikov
f5413e94b5 [#3] policy/test: increase test coverage
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-15 11:42:14 +03:00
Evgenii Stratonikov
e78eb268a9 [#3] policy/test: remove debug print 2021-06-15 11:42:14 +03:00
Evgenii Stratonikov
0f5ce2e8bb [#3] policy: allow to use brackets in filters
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-15 11:42:14 +03:00
Evgenii Stratonikov
3aeeafe79e [#3] policy: use ANTLRv4 parser generator
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-15 11:42:14 +03:00
Roman Khimov
86a9aa9259
Merge pull request #13 from KirillovDenis/feature/12-impl_client_object
[#12] Implemented client.Object in Pool
2021-06-15 10:49:44 +03:00
Denis Kirillov
8d8a5f8a86 [#12] Ensuring that pool implements interface
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-06-15 10:46:44 +03:00