antirez [Tue, 28 Feb 2012 23:46:50 +0000 (00:46 +0100)]
Better system for additional commands replication.
The new code uses a more generic data structure to describe redis operations.
The new design allows for multiple alsoPropagate() calls within the scope of a
single command, that is useful in different contexts. For instance there
when there are multiple clients doing BRPOPLPUSH against the same list,
and a variadic LPUSH is performed against this list, the blocked clients
will both be served, and we should correctly replicate multiple LPUSH
commands after the replication of the current command.
antirez [Tue, 28 Feb 2012 17:03:08 +0000 (18:03 +0100)]
Added a new API to replicate an additional command after the replication of the currently executed command, in order to propagte the LPUSH originating from RPOPLPUSH and indirectly by BRPOPLPUSH.
antirez [Wed, 22 Feb 2012 08:52:10 +0000 (09:52 +0100)]
zzlIsInRange() now is capable of handling empty sorted sets that may end inside the data set when loading very old RDB files produced by early-stage versions of Redis.
Pieter Noordhuis [Sat, 14 Jan 2012 01:49:16 +0000 (17:49 -0800)]
Don't expire keys when loading an RDB after a SYNC
The cron is responsible for expiring keys. When keys are expired at
load time, it is possible that the snapshot of a master node gets
modified. This can in turn lead to inconsistencies in the data set.
A more concrete example of this behavior follows. A user reported a
slave that would show an monotonically increase input buffer length,
shortly after completing a SYNC. Also, `INFO` output showed a single
blocked client, which could only be the master link. Investigation
showed that indeed the `BRPOP` command was fed by the master. This
command can only end up in the stream of write operations when it did
NOT block, and effectively executed `RPOP`. However, when the key
involved in the `BRPOP` is expired BEFORE the command is executed, the
client executing it will block. The client in this case, is the master
link.
antirez [Tue, 14 Feb 2012 15:15:20 +0000 (16:15 +0100)]
add -f flag to cp when installing, otherwise stopping the server is
needed when installing a new Redis version. Thanks to Scott Kevill.
Fixes issue #335.
antirez [Sat, 4 Feb 2012 13:05:54 +0000 (14:05 +0100)]
This fixes issue #327, is a very complex fix (unfortunately), details:
1) sendReplyToClient() now no longer stops transferring data to a single
client in the case we are out of memory (maxmemory-wise).
2) in processCommand() the idea of we being out of memory is no longer
the naive zmalloc_used_memory() > server.maxmemory. To say if we can
accept or not write queries is up to the return value of
freeMemoryIfNeeded(), that has full control about that.
3) freeMemoryIfNeeded() now does its math without considering output
buffers size. But at the same time it can't let the output buffers to
put us too much outside the max memory limit, so at the same time it
makes sure there is enough effort into delivering the output buffers to
the slaves, calling the write handler directly.
This three changes are the result of many tests, I found (partially
empirically) that is the best way to address the problem, but maybe
we'll find better solutions in the future.
antirez [Thu, 2 Feb 2012 15:30:52 +0000 (16:30 +0100)]
Now Lua scripts dispatch Redis commands properly calling the call() function. In order to make this possible call() was improved with a new flags argument that controls how the Redis command is executed.
antirez [Wed, 1 Feb 2012 16:49:03 +0000 (17:49 +0100)]
Added tests checking ability of the scripting engine to reorder the output of commands with a random output regarding signle elements position in the multi bulk reply.
antirez [Wed, 1 Feb 2012 14:22:28 +0000 (15:22 +0100)]
SORT is now more deterministic: does not accept to compare by score items that have scores not representing a valid double. Also items with the same score are compared lexycographically. At the same time the scripting side introduced the ability to sort the output of SORT when sort uses the BY <constant> optimization, resulting in no specific ordering. Since in this case the user may use GET, and the result of GET can be null, converted into false as Lua data type, this commit also introduces the ability to sort Lua tables containining false, only if the first (faster) attempt at using just table.sort with a single argument fails.
antirez [Tue, 31 Jan 2012 15:09:21 +0000 (16:09 +0100)]
Order output of commands returning random arrays using table.sort when called from Lua, partially fixing issue #165. The issue is yet not completely fixed since we can't add the REDIS_CMD_SORT_FOR_SCRIPT flag in SORT currently, both because it may contain NULLs and because it is not cool to re-sort everything at every call when instead this should be sorted only if BY <constant> is used.
antirez [Wed, 25 Jan 2012 15:46:19 +0000 (16:46 +0100)]
Fixed a non critical bug signaled by clang static analyzer thanks to Mukund Sivaraman for reporting it: there was a not initialized field populating the cluster message header, but it is always fixed at later time before sending the packet.