gopatcH:
```
@@
var d, a expression
@@
-if d < a {
- d = a
-}
-return d
+return max(d, a)
@@
var d, a expression
@@
-if d <= a {
- d = a
-}
-return d
+return max(d, a)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
When we do `object patch` with audit enabled we get several
duplicated entries in logs.
`object patch` request is logged in 2 places:
1. `(*auditPatchStream) CloseAndRecv()` - when the client closes
the request stream or when stream gets aborted.
2. `(*auditPatchStream) Send()` - when stream was NOT aborted.
`Send()` doesn't check if `err != nil` before logging.
It led to to logging on every `Send()` call.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Added `frostfs-cli object locate` subcommand. It lists info
about shards storing an object.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Added method `ListShardsForObject` to ControlService and to
StorageEngine. It returns information about shards storing
object on the node.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
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!).
SDK client for the main API uses these options by default.
Refs TrueCloudLab/frostfs-sdk-go#342
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
When we do `object put` with audit enabled we get several entries
in logs: with and without object id.
`object put` request is logged in 2 places:
1. `(*auditPutStream) CloseAndRecv()` - when the client closes the
request stream or when stream gets aborted.
2. `(*auditPutStream) Send()` - when stream was NOT aborted.
`Send()` does error check for `ErrAbortStream` because if there
is any other error - CloseAndRecv will not be called and there
won't be any audit log about failed request.
It led to logging on every object chunck put, even if `err == nil`.
Added check for `err != nil` in `Send()` to fix it.
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
* A client may open stream to server, not send anything and close
the open stream immediatly. This shouldn't cause a panic;
* Return the error if `s.patcher` is uninitialized. Uninitialized
patcher cannot be closed, this causes a panic.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
`multiaddr` is not something an average user knows. Personally, I have
never used it in CLI. On the other hand, we need to connect with TLS quite often,
so it needs to be mentioned in help.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
`newConfig` is actually target config to set config values from source
(which is called `oldConfig`).
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
- Move all initialization logic to one place
- Initialize the limiter after all RPC services are registered to be able
to validate that configured limits match the methods registered earlier
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
- Allow configuration of active RPC limits for method groups
- Apply RPC limiting for all services except the control service
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>