decr on Int64.MaxValue fails with "CLIENT_ERROR cannot increment or decrement non-numeric value"

245 views
Skip to first unread message

Sean

unread,
Feb 7, 2012, 4:25:03 PM2/7/12
to memcached
Here's the repro on the largest unsigned 64-bit integer
18446744073709551615 with telnet on memcached 1.4.5

>set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 20
18446744073709551615
STORED
>get aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b
VALUE aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 20
18446744073709551615
END
>decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 100
CLIENT_ERROR cannot increment or decrement non-numeric value


Is this a known bug?

Sean

unread,
Feb 7, 2012, 4:38:07 PM2/7/12
to memcached
It seems that anything greater than 2^63-1 wont' work. So essentially,
the counter only support 63-bit unsigned integer.

>set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 19
9223372036854775809
STORED
>decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 100
CLIENT_ERROR cannot increment or decrement non-numeric value

>set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 19
9223372036854775807
STORED
>get aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b
VALUE aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 19
9223372036854775807
END
>decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 100
9223372036854775707

dormando

unread,
Feb 7, 2012, 4:38:39 PM2/7/12
to memcached

The max is 18446744073709551614 - as per strtoull(3) I guess.

Sean

unread,
Feb 7, 2012, 4:42:58 PM2/7/12
to memcached
See my second post. Even 9223372036854775809 won't work.
9223372036854775807 works.

dormando

unread,
Feb 7, 2012, 4:46:58 PM2/7/12
to memcached
What's your platform?

Escape character is '^]'.
version
VERSION 1.4.5
set foo 0 0 20
18446744073709551614
STORED
decr foo 5
18446744073709551609

fwiw, always report bugs against latest versions of software :P

like I said, it's just calling strtoull(3) internally, so it's whatever
that function likes on your platform.

Sean

unread,
Feb 7, 2012, 4:58:45 PM2/7/12
to memcached
version 1.4.5_4_gaa7839e on windows 2008 R2 64-bit

On Feb 7, 1:46 pm, dormando <dorma...@rydia.net> wrote:
> What's your platform?
>
> Escape character is '^]'.
> version
> VERSION 1.4.5
> set foo 0 0 20
> 18446744073709551614
> STORED
> decr foo 5
> 18446744073709551609
>
> fwiw, always report bugs against latest versions of software :P
>
> like I said, it's just calling strtoull(3) internally, so it's whatever
> that function likes on your platform.
>
>
>
>
>
>
>
> On Tue, 7 Feb 2012, Sean wrote:
> > See my second post. Even 9223372036854775809 won't work.
> > 9223372036854775807 works.
>

Sean

unread,
Feb 7, 2012, 5:04:15 PM2/7/12
to memcached
If the key length is small, it works fine on my machine too:
>set mykey 0 2000 20
18446744073709551614
STORED
>decr mykey 5
18446744073709551609


However, when I change to use GUID as the cache key, it doesn't work
on numbers greater than 2^63-1:

>set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 20
18446744073709551614
STORED
>get aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b
VALUE aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 20
18446744073709551614
END
>decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 5
CLIENT_ERROR cannot increment or decrement non-numeric value

dormando

unread,
Feb 7, 2012, 5:10:53 PM2/7/12
to memcached
set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 20
18446744073709551614
STORED
decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 5
18446744073709551609

Unfortunately we don't really support the windows builds... they're
"unofficial", and we have no way of troubleshooting or updating them :/

Henrik Schröder

unread,
Feb 9, 2012, 6:17:52 PM2/9/12
to memc...@googlegroups.com
Works for me on Windows7 x64 using the version that's bundled with Couchbase:

version
VERSION membase_1.7.1.1

set aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 200 20
18446744073709551614

STORED
get aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b
VALUE aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 0 20
18446744073709551614
END
decr aad2ac07-2fd5-42bb-88b9-e7bae3b55f5b 5
18446744073709551609


/Henrik
Reply all
Reply to author
Forward
0 new messages