Currently, we allow using `--local-dump` in `morph init` command.
We also have this flag in other commands, but no `--protocol` which is
also needed. And in new command we do not have the ability to use local
dump at all.
This commit makes it possible to work either with an RPC or with
local-dump in every command.
Refs #1035.
Refs TrueCloudLab/frostfs-dev-env#42.
Writing gopatch this time was really satisfying, btw:
```
@@
var flags expression
@@
-flags.StringP(commonflags.EndpointFlag, ...)
+commonflags.InitRPC(flags)
@@
var flags expression
@@
-_ = viper.BindPFlag(commonflags.EndpointFlag, flags.Lookup(...))
+commonflags.BindRPC(flags)
```
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
* Use `cmd/internal/common/ape` parser commands within `ape`
subcommands
* Use flag names from `cmd/internal/common/ape
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Use `cmd/internal/common/ape` parser commands within `generate-ape-override`
subcommand
* Use flag names from `cmd/internal/common/ape`
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Refactor ape-manager subcommands
* Use `cmd/internal/common/ape` parser commands within ape-manager subcommands
* Use flag names from `cmd/internal/common/ape`
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Refactor local override managing subcommands
* Use `cmd/internal/common/ape` parser commands within local
override subcommands
* Use flag names from `cmd/internal/common/ape`
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Introduce common parsing commands to use them in `frostfs-cli`
and `frostfs-adm` APE-related subcommands
* Introduce common flags for these parsing commands
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Both `frostfs-cli` and `frostfs-adm` APE-related subcommands use
`PrintHumanReadableAPEChain` to print a parsed APE-chain. So, it's
more correct to have it in a common package over `frostfs-cli` and
`frostfs-adm` folders.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* `ConvertEACLToAPE` is useful method which couldn't be imported
out of frostfs-node so far as it has been in `internal`
* Since `ConvertEACLToAPE` and related structures and unit-tests
are placed in `pkg/util`
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
DropGraves() is only used to drop gravemarks after a tombstone
removal. Thus, it makes sense to do Inhume() and DropGraves() in one
transaction. It has less overhead and no unexpected problems in case
of sudden power failure.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
- Remove `testNewShard` and `setInitializedShards` because they
violated the default engine workflow. The correct workflow is:
first use `New()`, followed by `Open()`, and then `Init()`. As a
result, adding new logic to `(*StorageEngine).Init` caused several
tests to fail with a panic when attempting to access uninitialized
resources. Now, all engines created with the test utils must be
initialized manually. The new helper method `prepare` can be used
for that purpose.
- Additionally, `setInitializedShards` hardcoded the shard worker
pool size, which prevented it from being configured in tests and
benchmarks. This has been fixed as well.
- Ensure engine initialization is done wherever it was missing.
- Refactor `setShardsNumOpts`, `setShardsNumAdditionalOpts`, and
`setShardsNum`. Make them all depend on `setShardsNumOpts`.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Move `BenchmarkExists` from `engine_test.go` to `exists_test.go`
for better organization and clarity.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
The slice returned from bucket.Get() is only valid during the tx
lifetime. Cloning it is not necessary everywhere, but better safe than
sorry.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Concurrent Apply can lead to child node applies before parent, so
undo/redo operations will perform. This leads to performance degradation
in case of tree with many sublevels.
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
* Register GRPC services for both neo.fs.v2 and frost.fs namespaces
* Use this temporary solution until all nodes are updated
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>