971e740ea3
[ #35 ] network: Use AppendComponent() for TLS encapsulation
...
DCO / DCO (pull_request) Successful in 30s
Code generation / Generate proto (pull_request) Successful in 37s
Tests and linters / Tests (pull_request) Successful in 1m0s
Tests and linters / Lint (pull_request) Successful in 1m51s
As advocated explicitly in https://github.com/multiformats/go-multiaddr/blob/master/v015-MIGRATION.md
Answering a question about safety:
AppendComponent() appends to `a.ma`` in place.
`a.ma` is created by FromString() function,
so there is only a single goroutine appending to it.
Thus, assuming `FromString()` itself is called from a single goroutine,
no data race is introduced.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-12 21:19:30 +03:00
fc8f9637fe
[ #35 ] go.mod: Update go-multiaddr to v0.15.0
...
New multiaddr release is incompatible with the old one:
https://github.com/multiformats/go-multiaddr/releases/tag/v0.15.0
https://github.com/multiformats/go-multiaddr/blob/master/v015-MIGRATION.md
Thankfully, it seems we are not affected by any breaking changes.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-12 21:19:30 +03:00
d282cd094f
[ #355 ] netmap: Cache price and capacity attributes
...
DCO / DCO (pull_request) Successful in 23s
Code generation / Generate proto (pull_request) Successful in 1m27s
Tests and linters / Tests (pull_request) Successful in 1m27s
Tests and linters / Lint (pull_request) Successful in 2m35s
They are used by HRW sorting and it makes sense to store them separately
instead of iterating over all attributes each time we need them.
It also simplifies code: we already parse them in NodeInfo.readFromV2(),
so just save the result.
```
goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
│ old │ new │
│ sec/op │ sec/op vs base │
Netmap_ContainerNodes/REP_2-8 5.923µ ± 0% 5.209µ ± 1% -12.05% (p=0.000 n=10)
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 5.931µ ± 7% 5.088µ ± 1% -14.22% (p=0.000 n=10)
geomean 5.927µ 5.148µ -13.14%
│ old │ new │
│ B/op │ B/op vs base │
Netmap_ContainerNodes/REP_2-8 7.609Ki ± 0% 8.172Ki ± 0% +7.39% (p=0.000 n=10)
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.031Ki ± 0% 7.469Ki ± 0% +6.22% (p=0.000 n=10)
geomean 7.315Ki 7.812Ki +6.81%
│ old │ new │
│ allocs/op │ allocs/op vs base │
Netmap_ContainerNodes/REP_2-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹
geomean 77.00 77.00 +0.00%
¹ all samples are equal
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 17:47:08 +03:00
338faaf308
[ #355 ] netmap: Remove unnecessary err declaration
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 17:47:08 +03:00
16fd3bafe0
[ #354 ] api/netmap: Return a slice of parameters directly
...
`IterateParameters` does a poor job:
- it doesn't encapsulate well, because it returns a pointer,
- it has a clunky interface, compared to range loop.
I have decided to return parameter slice and not `iter.Seq` for 2
reasons:
1. There already is `SetParameters`, so `NetworkConfig` struct is
expected to be modified.
2. This iterator uses pointers, so even with this interface the slice
can already be changed.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 14:39:47 +00:00
661adf17bb
[ #353 ] Format deprecated notices properly
...
They should be in a separate paragraph, otherwise they are not
recognized.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:12:27 +00:00
f158a6b2e1
[ #353 ] pool: Remove deprecated IterateNetworkEndpoints()
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:12:27 +00:00
a0e4d16dbb
[ #352 ] container: Implement iterators over attributes
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:12:13 +00:00
88bc9eeb26
[ #356 ] netmap: Check for attribute duplicates in NodeInfo.readFromV2()
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:10:32 +00:00
684050b570
[ #356 ] netmap/test: Cover NodeInfo.ReadFromV2() with tests
...
Untested code never works.
Qed.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:10:32 +00:00
1b12c9beae
[ #356 ] netmap: Fix typo in NodeInfo.readFromV2()
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-07 09:10:32 +00:00
fb999fecac
[ #357 ] netmap: Provide slice to append to in flattenNodes()
...
Code generation / Generate proto (pull_request) Successful in 33s
DCO / DCO (pull_request) Successful in 41s
Tests and linters / Tests (pull_request) Successful in 1m9s
Tests and linters / Lint (pull_request) Successful in 2m11s
```
goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
│ old │ new │
│ sec/op │ sec/op vs base │
Netmap_ContainerNodes/REP_2-8 5.867µ ± 1% 5.821µ ± 0% -0.79% (p=0.000 n=10)
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 5.786µ ± 2% 5.810µ ± 1% ~ (p=1.000 n=10)
geomean 5.826µ 5.815µ -0.19%
│ old │ new │
│ B/op │ B/op vs base │
Netmap_ContainerNodes/REP_2-8 7.609Ki ± 0% 7.328Ki ± 0% -3.70% (p=0.000 n=10)
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 7.031Ki ± 0% 6.859Ki ± 0% -2.44% (p=0.000 n=10)
geomean 7.315Ki 7.090Ki -3.07%
│ old │ new │
│ allocs/op │ allocs/op vs base │
Netmap_ContainerNodes/REP_2-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹
Netmap_ContainerNodes/REP_2_IN_X_CBF_2_SELECT_2_FROM_*_AS_X-8 77.00 ± 0% 77.00 ± 0% ~ (p=1.000 n=10) ¹
geomean 77.00 77.00 +0.00%
¹ all samples are equal
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-05 11:36:33 +03:00
6458c11e83
[ #345 ] api/netmap: Drop deprecated single-address methods
...
DCO / DCO (pull_request) Successful in 25s
Code generation / Generate proto (pull_request) Successful in 29s
Tests and linters / Tests (pull_request) Successful in 1m1s
Tests and linters / Lint (pull_request) Successful in 2m23s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-04 18:22:10 +03:00
4b9b54a901
[ #345 ] netmap: Implement an iterator over node attributes
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-04 18:22:10 +03:00
b27f172de9
[ #345 ] netmap: Implement an iterator over node endpoints
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-04 18:22:09 +03:00
5be3415961
[ #345 ] go.mod: Bump min go version to 1.23
...
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-04-04 17:26:35 +03:00
4d36a49d39
[ #349 ] object: Make patcher apply patching for split header
...
DCO / DCO (pull_request) Successful in 26s
Code generation / Generate proto (pull_request) Successful in 27s
Tests and linters / Tests (pull_request) Successful in 40s
Tests and linters / Lint (pull_request) Successful in 1m23s
* Change `PatchApplier` interface: `ApplyAttributesPatch` -> `ApplyHeaderPatch`.
Make `ApplyHeaderPatch` receive `ApplyHeaderPatchPrm` as parameter;
* Fix `patcher`: apply patch for split header;
* Fix `patcher` unit-tests. Add test-case for split header;
* Extend `Patch` struct with `NewSplitHeader`;
* Change `ObjectPatcher` interface for client: `PatchAttributes` -> `PatchHeader`.
Fix `objectPatcher`.
* Fix object transformer: since object header sets `SplitHeader` if it's passed.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2025-03-26 13:17:39 +03:00
76265fe9be
[ #349 ] object: Introduce SplitHeader
type
...
* Also introduce `SplitHeader` getter and `SetSplitHeader` setter
for `Object` type.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2025-03-26 13:17:37 +03:00
826df9303c
[ #349 ] object: Regenerate protobuf for Patch
method
...
* `PatchRequestBody` got `NewSplitHeader` field
* Introduce `SetNewSplitHeader`, `GetNewSplitHeader`
* Fix converter and marshaler
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2025-03-26 13:17:24 +03:00
87bb55f992
[ #51 ] add address to logs
...
Code generation / Generate proto (pull_request) Successful in 30s
DCO / DCO (pull_request) Successful in 33s
Tests and linters / Tests (pull_request) Successful in 44s
Tests and linters / Lint (pull_request) Successful in 1m31s
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2025-03-17 11:28:14 +03:00
a262a0038f
[ #343 ] pool: Fix Yoda condition
...
DCO / DCO (pull_request) Successful in 24s
Code generation / Generate proto (pull_request) Successful in 31s
Tests and linters / Tests (pull_request) Successful in 43s
Tests and linters / Lint (pull_request) Successful in 2m8s
go-staticcheck recommends not to use Yoda conditions.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2025-03-10 19:24:58 +03:00
fe5b28e6bf
[ #338 ] pool: Support avg request time for ListContainerStream
...
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2025-03-10 19:24:58 +03:00
749b4e9ab5
[ #344 ] netmap: Add method Clone
...
DCO / DCO (pull_request) Successful in 26s
Code generation / Generate proto (pull_request) Successful in 30s
Tests and linters / Tests (pull_request) Successful in 41s
Tests and linters / Lint (pull_request) Successful in 2m25s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2025-03-07 18:02:02 +03:00
f70c0c9081
[ #300 ] pool: Remove obvious comments
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
17177697b5
[ #300 ] pool/cm: Remove unused mutex in 'statistics'
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
56046935b0
[ #300 ] pool: Move 'clientWrapper' to separate file
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
cee7f9de47
[ #300 ] pool: Move 'connectionManager' to separate file
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
d77a8742bc
[ #300 ] pool: Move 'healthCheck' to separate file
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
b083bf8546
[ #300 ] pool: Extract healthCheck functionality from 'connectionManager' to 'healthCheck'
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
b480df99ca
[ #300 ] pool: Extract connection handler functionality to 'connectionManager'
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-03-07 11:45:31 +00:00
69b0711d12
[ #342 ] client: Disable service config query
...
By default, gRPC fetches TXT report while resolving a domain.
0914bba6c5/internal/resolver/dns/dns_resolver.go (L336)
This leads to a hanging dial if DNS is unavailable, even though the host
may be specified in `/etc/hosts` (hello, localhost!).
Use `grpc.WithDisableServiceConfig()` to override the default.
This option seems impossible to override with `WithGRPCDialOpts()`,
but we do not use service config anyway.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-03-06 09:24:16 +00:00
7a37613988
[ #339 ] pool/tree: Improve code after review
...
DCO / DCO (pull_request) Successful in 29s
Code generation / Generate proto (pull_request) Successful in 39s
Tests and linters / Tests (pull_request) Successful in 46s
Tests and linters / Lint (pull_request) Successful in 1m34s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-05 14:40:45 +03:00
d592bb931e
[ #339 ] pool/tree: Configure circuit breaker parameters
...
Code generation / Generate proto (pull_request) Successful in 29s
DCO / DCO (pull_request) Successful in 32s
Tests and linters / Lint (pull_request) Failing after 42s
Tests and linters / Tests (pull_request) Successful in 42s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 14:49:07 +03:00
06ef257ddc
[ #339 ] pool/tree: Do not lock mutex on circuit break function
...
DCO / DCO (pull_request) Successful in 29s
Code generation / Generate proto (pull_request) Successful in 30s
Tests and linters / Lint (pull_request) Failing after 39s
Tests and linters / Tests (pull_request) Successful in 44s
Circuit break function may take some time to execute so it should
not be executed when lock is enabled.
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 14:41:01 +03:00
2d08fa5240
[ #339 ] pool/tree: Close replaced connection in client map
...
There is a race condition: multiple clients are created and dialled,
but only one is stored in the map. Others are remaining active but not
used.
With this change, new connection replaces old connection and closes
it.
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 14:41:01 +03:00
c5991fc66d
[ #339 ] pool/tree: Fix linter issues
...
DCO / DCO (pull_request) Successful in 28s
Code generation / Generate proto (pull_request) Successful in 32s
Tests and linters / Tests (pull_request) Successful in 44s
Tests and linters / Lint (pull_request) Successful in 1m27s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 12:22:38 +03:00
f78fb6dcb0
[ #339 ] pool/tree: Make circuit breaker more generic
...
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 12:21:11 +03:00
c8d71c450a
[ #339 ] pool/tree: Add circuit breaker
...
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-03-04 12:20:58 +03:00
2b8329e026
[ #336 ] pool/tree: Increase test coverage in TestStreamRetry
...
DCO / DCO (pull_request) Successful in 26s
Code generation / Generate proto (pull_request) Successful in 33s
Tests and linters / Tests (pull_request) Successful in 44s
Tests and linters / Lint (pull_request) Successful in 1m36s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-02-28 12:32:56 +03:00
ada0513504
[ #336 ] pool/tree: Do probe in getSubTree to handle error in advance
...
DCO / DCO (pull_request) Successful in 28s
Code generation / Generate proto (pull_request) Successful in 33s
Tests and linters / Tests (pull_request) Successful in 45s
Tests and linters / Lint (pull_request) Successful in 1m35s
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2025-02-28 10:46:01 +03:00
c3f7378887
[ #294 ] user: Implement Cmp() function for ID struct
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-02-17 15:22:55 +00:00
bcb5fd22d4
[ #294 ] container: Implement Cmp() function for ID struct
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-02-17 15:22:55 +00:00
148a341b6f
[ #294 ] object: Implement Cmp() function for ID struct
...
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2025-02-17 15:22:55 +00:00
56892e48ac
[ #334 ] rpc: Use DeadlineExceeded error when creating stream failed by timeout
...
DCO / DCO (pull_request) Successful in 28s
Code generation / Generate proto (pull_request) Successful in 32s
Tests and linters / Tests (pull_request) Successful in 45s
Tests and linters / Lint (pull_request) Successful in 1m53s
According to https://pkg.go.dev/context#pkg-variables , ContextCancelled
should be returned when the context is canceled for some reason other
than its deadline passing. So creating gRPC stream with dial timeout fits
better for context.DeadlineExceeded.
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2025-02-17 16:06:11 +03:00
7bdc78f2b5
[ #332 ] client/status: Support RESOURCE_EXHAUSTED
status
...
DCO / DCO (pull_request) Successful in 30s
Code generation / Generate proto (pull_request) Successful in 34s
Tests and linters / Tests (pull_request) Successful in 46s
Tests and linters / Lint (pull_request) Successful in 1m53s
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2025-02-06 11:38:57 +03:00
cf0bbd03ae
[ #332 ] api/status: Regenerate common statuses
...
Introduced a new common status `RESOURCE_EXHAUSTED`.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2025-02-06 11:38:45 +03:00
5a35fa4353
[ #331 ] pool: Fix 'sortServers' in tree pool server test
...
DCO / DCO (pull_request) Successful in 30s
Code generation / Generate proto (pull_request) Successful in 36s
Tests and linters / Tests (pull_request) Successful in 47s
Tests and linters / Lint (pull_request) Successful in 1m37s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-02-05 10:44:03 +03:00
4ecbfb0edf
[ #331 ] pool: Add mocked test tree service and check goroutine leak
...
DCO / DCO (pull_request) Successful in 29s
Code generation / Generate proto (pull_request) Successful in 32s
Tests and linters / Tests (pull_request) Successful in 46s
Tests and linters / Lint (pull_request) Successful in 1m35s
Use real gRPC connection in new mocked tree service.
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-02-04 21:15:15 +03:00
f08a7f0b3c
[ #331 ] pool: Avoid connection leak in tree pool with netmap support
...
To avoid connection leak, call `close()` immediately after connection
is established. In regular tree pool, unhealthy connections are handled
by background goroutine which calls `redialIfNecessary()` to reestablish
connection. Here it is not viable so connection must be close.
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2025-02-04 21:15:10 +03:00
8389887a34
[ #319 ] object/transformer: Add expiration epoch to each part
...
DCO / DCO (pull_request) Successful in 32s
Code generation / Generate proto (pull_request) Successful in 42s
Tests and linters / Tests (pull_request) Successful in 46s
Tests and linters / Lint (pull_request) Successful in 1m47s
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2025-02-02 18:14:21 +03:00