createULongLongConfig is only used by server.config. When we set the value of server.config greater than 9223372036854775807b, it will be converted to 9223372036854775807. This means that although the valid range of server.config is [0, ULLONG_MAX] when the suffix is "b", it is actually Is [0,LLONG_MAX].

127.0.0.1:6379> config set maxmemory 18446744073709551610b OK 127.0.0.1:6379> config get maxmemory 1) "maxmemory" 2) "9223372036854775807"

We obviously want such behavior:

127.0.0.1:6379> config set maxmemory 18446744073709551610b OK 127.0.0.1:6379> config get maxmemory 1) "maxmemory" 2) "18446744073709551610"

The cause of the problem is numericConfigSet, all values are converted using memtoll, which uses strtoll to parse strings, so this problem occurs.

My solution to this problem is to provide a memtoull to solve the problem, and at the same time take out the basic code from memtoll, named memconvert, memtoll and memtoull as the upper interface.

But this will change a lot of code, because server.maxmemory rarely exceeds LLONG_MAX, even if it exceeds, other suffixes can be used. So is this necessary?

Comment From: hwware

@Super-long Could you please check PR https://github.com/redis/redis/pull/9313, and see if this is a good solution? Thanks