Skip to content

Commit

Permalink
Sync from server repo (4a337830fea)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Spilchen committed Sep 27, 2023
1 parent dadafc1 commit e824c52
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "vcluster",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/vclusterops"
},
{
"name": "commands",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/commands"
}
]
}
2 changes: 2 additions & 0 deletions commands/cmd_add_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func makeCmdAddNode() *CmdAddNode {
addNodeOptions.ConfigDirectory = newCmd.parser.String("config-directory", "",
util.GetOptionalFlagMsg("Directory where "+vclusterops.ConfigFileName+" is located"))
addNodeOptions.DataPrefix = newCmd.parser.String("data-path", "", util.GetOptionalFlagMsg("Path of data directory"))
addNodeOptions.ForceRemoval = newCmd.parser.Bool("force-removal", false,
util.GetOptionalFlagMsg("Force removal of existing directories before adding nodes"))
addNodeOptions.SkipRebalanceShards = newCmd.parser.Bool("skip-rebalance-shards", false,
util.GetOptionalFlagMsg("Skip the subcluster shards rebalancing"))

Expand Down
5 changes: 4 additions & 1 deletion vclusterops/add_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type VAddNodeOptions struct {
DepotSize *string // like 10G
// Skip rebalance shards if true
SkipRebalanceShards *bool
// Use force remove if true
ForceRemoval *bool

// Names of the existing nodes in the cluster.
// This options can be used to remove partially added nodes from catalog.
Expand All @@ -56,6 +58,7 @@ func (o *VAddNodeOptions) SetDefaultValues() {
o.SCName = new(string)
o.SkipRebalanceShards = new(bool)
o.DepotSize = new(string)
o.ForceRemoval = new(bool)
}

func (o *VAddNodeOptions) validateEonOptions() error {
Expand Down Expand Up @@ -363,7 +366,7 @@ func (vcc *VClusterCommands) produceAddNodeInstructions(vdb *VCoordinationDataba
// contains the hosts to add.
newHostNodeMap := vdb.copyHostNodeMap(options.NewHosts)
nmaPrepareDirectoriesOp, err := makeNMAPrepareDirectoriesOp(newHostNodeMap,
false /*force cleanup*/, false /*for db revive*/)
*options.ForceRemoval /*force cleanup*/, false /*for db revive*/)
if err != nil {
return instructions, err
}
Expand Down

0 comments on commit e824c52

Please sign in to comment.