Skip to content

Commit 987ea8b

Browse files
xbaselmadolson
authored andcommitted
valkey-cli: Count databases correctly in --cluster subcommands (valkey-io#2046)
Fixes a valkey-cli check that caused it to miscount the number of databases and led to resharding failures. This change makes the `--cluster` subcommands imply cluster mode as if the `-c` flag had been given. --------- Signed-off-by: xbasel <[email protected]> Signed-off-by: Madelyn Olson <[email protected]> Co-authored-by: Madelyn Olson <[email protected]>
1 parent 6c4307d commit 987ea8b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/valkey-cli.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,6 +2729,7 @@ static int parseOptions(int argc, char **argv) {
27292729
int err = createClusterManagerCommand(cmd, j - i, argv + i + 1);
27302730
if (err) exit(err);
27312731
i = j;
2732+
config.cluster_mode = 1;
27322733
} else if (!strcmp(argv[i], "--cluster") && lastarg) {
27332734
usage(1);
27342735
} else if (!strcmp(argv[i], "--cluster-only-masters") || !strcmp(argv[i], "--cluster-only-primaries")) {

0 commit comments

Comments
 (0)