Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure preferred placement is a flag not an arg #1209

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/consumer_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func configureConsumerCommand(app commandHost) {
conClusterDown := conCluster.Command("step-down", "Force a new leader election by standing down the current leader").Alias("elect").Alias("down").Alias("d").Action(c.leaderStandDownAction)
conClusterDown.Arg("stream", "Stream to act on").StringVar(&c.stream)
conClusterDown.Arg("consumer", "Consumer to act on").StringVar(&c.consumer)
conClusterDown.Arg("preferred", "Prefer placing the leader on a specific host").StringVar(&c.placementPreferred)
conClusterDown.Flag("preferred", "Prefer placing the leader on a specific host").StringVar(&c.placementPreferred)
conClusterDown.Flag("force", "Force leader step down ignoring current leader").Short('f').UnNegatableBoolVar(&c.force)

conClusterBalance := conCluster.Command("balance", "Balance consumer leaders").Action(c.balanceAction)
Expand Down Expand Up @@ -700,7 +700,7 @@ func (c *consumerCmd) leaderStandDownAction(_ *fisk.ParseContext) error {
return err
}

p.Preferred = c.placementPreferred
p = &api.Placement{Preferred: c.placementPreferred}
}

log.Printf("Requesting leader step down of %q in a %d peer RAFT group", leader, len(info.Cluster.Replicas)+1)
Expand Down
4 changes: 2 additions & 2 deletions cli/stream_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ Finding streams with certain subjects configured:
strCluster := str.Command("cluster", "Manages a clustered Stream").Alias("c")
strClusterDown := strCluster.Command("step-down", "Force a new leader election by standing down the current leader").Alias("stepdown").Alias("sd").Alias("elect").Alias("down").Alias("d").Action(c.leaderStandDown)
strClusterDown.Arg("stream", "Stream to act on").StringVar(&c.stream)
strClusterDown.Arg("preferred", "Prefer placing the leader on a specific host").StringVar(&c.placementPreferred)
strClusterDown.Flag("preferred", "Prefer placing the leader on a specific host").StringVar(&c.placementPreferred)
strClusterDown.Flag("force", "Force leader step down ignoring current leader").Short('f').UnNegatableBoolVar(&c.force)

strClusterBalance := strCluster.Command("balance", "Balance stream leaders").Action(c.balanceAction)
Expand Down Expand Up @@ -950,7 +950,7 @@ func (c *streamCmd) leaderStandDown(_ *fisk.ParseContext) error {
return err
}

p.Preferred = c.placementPreferred
p = &api.Placement{Preferred: c.placementPreferred}
}

log.Printf("Requesting leader step down of %q for stream %q in a %d peer cluster group", leader, stream.Name(), len(info.Cluster.Replicas)+1)
Expand Down
Loading