Skip to content

Commit

Permalink
Sync from server repo (49a48c41aa8)
Browse files Browse the repository at this point in the history
  • Loading branch information
releng committed Nov 8, 2024
1 parent 9c10874 commit 18a0651
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vclusterops/start_subcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func (vcc VClusterCommands) VStartSubcluster(options *VStartScOptions) (VCoordin
if err != nil {
return vdb, err
}
err = options.validateNewHosts(&vdb, options.NewHostList)
if err != nil {
return vdb, err
}

nodesToStart := options.collectDownHosts(&vdb)
if len(nodesToStart) == 0 {
Expand Down Expand Up @@ -203,6 +207,15 @@ func (options *VStartScOptions) collectDownHosts(vdb *VCoordinationDatabase) (no
return nodesToStart
}

func (options *VStartScOptions) validateNewHosts(vdb *VCoordinationDatabase, newHosts []string) error {
for _, h := range newHosts {
if _, exists := vdb.HostNodeMap[h]; exists {
return fmt.Errorf("host %s is already a part of the database, please provide a new host ip to start the subcluster", h)
}
}
return nil
}

// Unbound nodes that need to be started need to be re-ip'd and require node directories to be set up
func (options *VStartScOptions) checkPrepDirs(vdb *VCoordinationDatabase,
nodesToStart map[string]string, logger vlog.Printer) error {
Expand Down

0 comments on commit 18a0651

Please sign in to comment.