- 22 Jul, 2013 1 commit
-
-
antirez authored
Previously two string encodings were used for string objects: 1) REDIS_ENCODING_RAW: a string object with obj->ptr pointing to an sds stirng. 2) REDIS_ENCODING_INT: a string object where the obj->ptr void pointer is casted to a long. This commit introduces a experimental new encoding called REDIS_ENCODING_EMBSTR that implements an object represented by an sds string that is not modifiable but allocated in the same memory chunk as the robj structure itself. The chunk looks like the following: +--------------+-----------+------------+--------+----+ | robj data... | robj->ptr | sds header | string | \0 | +--------------+-----+-----+------------+--------+----+ | ^ +-----------------------+ The robj->ptr points to the contiguous sds string data, so the object can be manipulated with the same functions used to manipulate plan string objects, however we need just on malloc and one free in order to allocate or release this kind of objects. Moreover it has better cache locality. This new allocation strategy should benefit both the memory usage and the performances. A performance gain between 60 and 70% was observed during micro-benchmarks, however there is more work to do to evaluate the performance impact and the memory usage behavior.
-
- 17 Jul, 2013 1 commit
-
-
antirez authored
There are systems that when printing +/- infinte with printf-family functions will not use the usual "inf" "-inf", but different strings. Handle that explicitly. Fixes issue #930.
-
- 16 Jul, 2013 3 commits
-
-
antirez authored
-
yoav authored
-
antirez authored
This fixes issue #1194, that contains many details. However in short, it was possible for ZADD to not accept as score values that was however possible to obtain with multiple calls to ZINCRBY, like in the following example: redis 127.0.0.1:6379> zadd k 2.5e-308 m (integer) 1 redis 127.0.0.1:6379> zincrby k -2.4e-308 m "9.9999999999999694e-310" redis 127.0.0.1:6379> zscore k m "9.9999999999999694e-310" redis 127.0.0.1:6379> zadd k 9.9999999999999694e-310 m1 (error) ERR value is not a valid float The problem was due to strtod() returning ERANGE in the following case specified by POSIX: "If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE].". Now instead the returned value is accepted even when ERANGE is returned as long as the return value of the function is not negative or positive HUGE_VAL or zero.
-
- 12 Jul, 2013 6 commits
-
-
Salvatore Sanfilippo authored
Make sure the log standardizes on 'timeout'
-
Ted Nyman authored
-
antirez authored
-
antirez authored
Note that we only do it when STORE is not used, otherwise we want an absolutely locale independent and binary safe sorting in order to ensure AOF / replication consistency. This is probably an unexpected behavior violating the least surprise rule, but there is currently no other simple / good alternative.
-
antirez authored
compareStringObject was not always giving the same result when comparing two exact strings, but encoded as integers or as sds strings, since it switched to strcmp() when at least one of the strings were not sds encoded. For instance the two strings "123" and "123\x00456", where the first string was integer encoded, would result into the old implementation of compareStringObject() to return 0 as if the strings were equal, while instead the second string is "greater" than the first in a binary comparison. The same compasion, but with "123" encoded as sds string, would instead return a value < 0, as it is correct. It is not impossible that the above caused some obscure bug, since the comparison was not always deterministic, and compareStringObject() is used in the implementation of skiplists, hash tables, and so forth. At the same time, collateStringObject() was introduced by this commit, so that can be used by SORT command to return sorted strings usign collation instead of binary comparison. See next commit.
-
Salvatore Sanfilippo authored
Wrap IPv6 in brackets in the prompt.
-
- 11 Jul, 2013 4 commits
-
-
Jan-Erik Rediger authored
-
antirez authored
-
antirez authored
We use comma to play well with IPv6 addresses, but the implementation is still able to parse the old messages separated by colons.
-
antirez authored
-
- 10 Jul, 2013 3 commits
- 09 Jul, 2013 6 commits
-
-
antirez authored
-
antirez authored
-
antirez authored
We now also use it in CLIENT KILL implementation.
-
antirez authored
The function returns an unique identifier for the client, as ip:port for IPv4 and IPv6 clients, or as path:0 for Unix socket clients. See the top comment in the function for more info.
-
antirez authored
-
antirez authored
-
- 08 Jul, 2013 16 commits
-
-
antirez authored
-
Geoff Garside authored
This has been done by exposing the anetSockName() function anet.c to be used when the sentinel is publishing its existence to the masters. This implementation is very unintelligent as it will likely break if used with IPv6 as the nested colons will break any parsing of the PUBLISH string by the master.
-
Geoff Garside authored
-
Geoff Garside authored
-
Geoff Garside authored
Add commented port6 and bind6 options to default redis.conf file.
-
Geoff Garside authored
Refactor the common code from anetTcpServer into internal function which can be used by both anetTcpServer and anetTcp6Server.
-
Geoff Garside authored
This function sets the IPV6_V6ONLY option to 1 to use separate stack IPv6 sockets.
-
Geoff Garside authored
This allows anetTcpGenericConnect to try to connect to AF_INET6 addresses in addition to any resolved AF_INET addresses.
-
Geoff Garside authored
Any places which I feel might want to be updated to work differently with IPv6 have been marked with a comment starting "IPV6:". Currently the only comments address places where an IP address is combined with a port using the standard : separated form. These may want to be changed when printing IPv6 addresses to wrap the address in [] such as [2001:db8::c0:ffee]:6379 instead of 2001:db8::c0:ffee:6379 as the latter format is a technically valid IPv6 address and it is hard to distinguish the IPv6 address component from the port unless you know the port is supposed to be there.
-
Geoff Garside authored
Increase the size of character buffers being used to store printable IP addresses so that they can safely store IPv6 addresses.
-
Geoff Garside authored
In two places buffers have been created with a size of 128 bytes which could be reduced to INET6_ADDRSTRLEN to still hold a full IP address. These places have been marked as they are presently big enough to handle the needs of storing a printable IPv6 address.
-
Geoff Garside authored
Changes the sockaddr_in to a sockaddr_storage. Attempts to convert the IP address into an AF_INET or AF_INET6 before returning an "Invalid IP address" error. Handles converting the sockaddr from either AF_INET or AF_INET6 back into a string for storage in the clusterNode ip field.
-
Geoff Garside authored
Change the sockaddr_in to sockaddr_storage which is capable of storing both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family to correctly return the printable IP address and port. Function makes the assumption that the buffer is of at least REDIS_CLUSTER_IPLEN bytes in size.
-
Geoff Garside authored
Change REDIS_CLUSTER_IPLEN to INET6_ADDRSTRLEN so that the clusterNode ip character buffer is big enough to hold an IPv6 address.
-
Geoff Garside authored
Change the sockaddr_in to sockaddr_storage which is capable of storing both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family to correctly return the printable IP address and port.
-