Skip to content

Commit

Permalink
roachprod: rewrite roachprod start
Browse files Browse the repository at this point in the history
This is quite the workhorse, and does a lot and has to be compatible
with a lot of existing CRDB versions. It's grown organically as a result
and I'm finding it a bit difficult to maintain, breaking it down a bit
makes it clearer what the structure of it all is and would've perhaps
prevented me introducing bugs like cockroachdb#51497.

Do scrutinize the PR closely, we use `roachprod start` everywhere. It's
mostly mindless code movement but I did sneak in the fix for cockroachdb#51497
where I'd broken node ID assignments for when `roachprod start` is
called with the `--sequential` flag (true by default). I did so by
explicitly initializing the first node, and then having the remaining
nodes join on to it.

Release note: None
  • Loading branch information
irfansharif committed Jul 22, 2020
1 parent f10ba17 commit 5d14709
Show file tree
Hide file tree
Showing 2 changed files with 358 additions and 260 deletions.
8 changes: 7 additions & 1 deletion pkg/cmd/roachprod/install/cluster_synced.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ func (c *SyncedCluster) IsLocal() bool {
return c.Name == config.Local
}

// ServerNodes TODO(peter): document
// ServerNodes is the fully expanded, ordered list of nodes that any given
// roachprod command is intending to target.
//
// $ roachprod create local -n 4
// $ roachprod start local # [1, 2, 3, 4]
// $ roachprod start local:2-4 # [2, 3, 4]
// $ roachprod start local:2,1,4 # [1, 2, 4]
func (c *SyncedCluster) ServerNodes() []int {
return append([]int{}, c.Nodes...)
}
Expand Down
Loading

0 comments on commit 5d14709

Please sign in to comment.