Skip to content

Conversation

@enjoy-binbin
Copy link
Contributor

It used to returns slots as strings, like:

redis> cluster shards
1) 1) "slots"
   2) 1) "10923"
      2) "16383"

CLUSTER SHARDS docs and the top comment of #10293 says that it returns integers.
Note other commands like CLUSTER SLOTS, it returns slots as integers.
Use addReplyLongLong instead of addReplyBulkLongLong, now it returns slots as integers:

redis> cluster shards
1) 1) "slots"
   2) 1) (integer) 10923
      2) (integer) 16383

This is a small breaking change, introduced in 7.0.0 (7.0 RC3, #10293)

Fixes #10680

It used to returns slots as strings, like:
```
redis> cluster shards
1) 1) "slots"
   2) 1) "10923"
      2) "16383"
```

CLUSTER SHARDS docs and the top comment of redis#10293 says that it returns integers.
Note other commands like CLUSTER SLOTS, it returns slots as integers.
Use addReplyLongLong instead of addReplyBulkLongLong, now it returns slots as integers:
```
redis> cluster shards
1) 1) "slots"
   2) 1) (integer) 10923
      2) (integer) 16383
```

This is a small breaking change, introduced in 7.0.0 (7.0 RC3, redis#10293)

Fixes redis#10680
@enjoy-binbin enjoy-binbin requested a review from madolson May 5, 2022 16:33
Copy link
Contributor

@hpatro hpatro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. Thanks for helping with the fix.

@madolson madolson added breaking-change This change can potentially break existing application state:major-decision Requires core team consensus labels May 6, 2022
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label May 8, 2022
Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redis/core-team please approve (breaking fix for new command)

@oranagra oranagra merged commit 2a1ea8c into redis:unstable May 10, 2022
@enjoy-binbin enjoy-binbin deleted the cluster_shards_slots_integer branch May 10, 2022 11:52
@oranagra oranagra mentioned this pull request Jun 8, 2022
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
…0683)

It used to returns slots as strings, like:
```
redis> cluster shards
1) 1) "slots"
   2) 1) "10923"
      2) "16383"
```

CLUSTER SHARDS docs and the top comment of redis#10293 says that it returns integers.
Note other commands like CLUSTER SLOTS, it returns slots as integers.
Use addReplyLongLong instead of addReplyBulkLongLong, now it returns slots as integers:
```
redis> cluster shards
1) 1) "slots"
   2) 1) (integer) 10923
      2) (integer) 16383
```

This is a small breaking change, introduced in 7.0.0 (7.0 RC3, redis#10293)

Fixes redis#10680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This change can potentially break existing application release-notes indication that this issue needs to be mentioned in the release notes state:major-decision Requires core team consensus

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] cluster shards returns slots as strings, not integers

5 participants