diff options
author | Binbin <binloveplay1314@qq.com> | 2023-05-17 02:32:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 11:32:21 -0700 |
commit | fd566f405094c77f5b6b84195c93552b9e01d4a8 (patch) | |
tree | ce0538deaa96cc18bea56d7cafb98e91fa63fc41 /src/commands/latency-history.json | |
parent | e45272884e61f266662bcf0e8f3799c986236de6 (diff) | |
download | redis-fd566f405094c77f5b6b84195c93552b9e01d4a8.tar.gz |
Fix for set max entries edge case in setTypeCreate / setTypeMaybeConvert (#12183)
In the judgment in setTypeCreate, we should judge size_hint <= max_entries.
This results in the following inconsistencies:
```
127.0.0.1:6379> config set set-max-intset-entries 5 set-max-listpack-entries 5
OK
127.0.0.1:6379> sadd intset_set1 1 2 3 4 5
(integer) 5
127.0.0.1:6379> object encoding intset_set1
"hashtable"
127.0.0.1:6379> sadd intset_set2 1 2 3 4
(integer) 4
127.0.0.1:6379> sadd intset_set2 5
(integer) 1
127.0.0.1:6379> object encoding intset_set2
"intset"
127.0.0.1:6379> sadd listpack_set1 a 1 2 3 4
(integer) 5
127.0.0.1:6379> object encoding listpack_set1
"hashtable"
127.0.0.1:6379> sadd listpack_set2 a 1 2 3
(integer) 4
127.0.0.1:6379> sadd listpack_set2 4
(integer) 1
127.0.0.1:6379> object encoding listpack_set2
"listpack"
```
This was introduced in #12019, added corresponding tests.
Diffstat (limited to 'src/commands/latency-history.json')
0 files changed, 0 insertions, 0 deletions