forked from TrueCloudLab/frostfs-node
[#1298] writecache: Add shrink
flag for Seal command
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
5c01bd5be8
commit
36efccd862
12 changed files with 255 additions and 187 deletions
|
@ -9,7 +9,10 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const restoreModeFlag = "restore-mode"
|
||||
const (
|
||||
restoreModeFlag = "restore-mode"
|
||||
shrinkFlag = "shrink"
|
||||
)
|
||||
|
||||
var writecacheShardCmd = &cobra.Command{
|
||||
Use: "writecache",
|
||||
|
@ -29,11 +32,13 @@ func sealWritecache(cmd *cobra.Command, _ []string) {
|
|||
|
||||
ignoreErrors, _ := cmd.Flags().GetBool(ignoreErrorsFlag)
|
||||
restoreMode, _ := cmd.Flags().GetBool(restoreModeFlag)
|
||||
shrink, _ := cmd.Flags().GetBool(shrinkFlag)
|
||||
|
||||
req := &control.SealWriteCacheRequest{Body: &control.SealWriteCacheRequest_Body{
|
||||
Shard_ID: getShardIDList(cmd),
|
||||
IgnoreErrors: ignoreErrors,
|
||||
RestoreMode: restoreMode,
|
||||
Shrink: shrink,
|
||||
}}
|
||||
|
||||
signRequest(cmd, pk, req)
|
||||
|
@ -73,6 +78,7 @@ func initControlShardsWritecacheCmd() {
|
|||
ff.Bool(shardAllFlag, false, "Process all shards")
|
||||
ff.Bool(ignoreErrorsFlag, true, "Skip invalid/unreadable objects")
|
||||
ff.Bool(restoreModeFlag, false, "Restore writecache's mode after sealing")
|
||||
ff.Bool(shrinkFlag, false, "Shrink writecache's internal storage")
|
||||
|
||||
sealWritecacheShardCmd.MarkFlagsMutuallyExclusive(shardIDFlag, shardAllFlag)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue