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.
antirez [Wed, 25 Jan 2012 09:35:47 +0000 (10:35 +0100)]
aeCreateEventLoop() cleanup on error unified in a single block (original
patch by Mukund Sivaraman, modified by me to make it simpler and to use
my coding style).
antirez [Tue, 24 Jan 2012 08:32:39 +0000 (09:32 +0100)]
asyncCloseClientOnOutputBufferLimitReached() now ignores clients with REDIS_CLOSE_ASAP flag already set. Return value of the function changed from int to void since it is not used. Fixed logging of the client scheduled to be closed.
antirez [Fri, 20 Jan 2012 11:20:45 +0000 (12:20 +0100)]
all the stack trace related functions are now in debug.c. Now Redis dumps registers and stack content on crash. Currently osx supported, adding Linux right now.
antirez [Mon, 16 Jan 2012 15:50:24 +0000 (16:50 +0100)]
It is now posible to flush all the previous saving points in redis.conf by using a save directive with a single empty string argument, like it happens for CONFIG SET save.
antirez [Mon, 16 Jan 2012 10:27:22 +0000 (11:27 +0100)]
Don't change the replication state if SLAVE OF is called with arguments specifying the same master we are already connected with. This fixes issues #290.
antirez [Sat, 31 Dec 2011 15:09:46 +0000 (16:09 +0100)]
Protections against protocol desyncs, leading to infinite query buffer growing, due to nul-terms in specific bytes of the request or indefinitely long multi bulk or bulk count strings without newlines. This bug is related to Issue #141 as well.
antirez [Fri, 30 Dec 2011 18:34:40 +0000 (19:34 +0100)]
Fixed replication when multiple slaves are attaching at the same time. The output buffer was not copied correctly between slaves. This fixes issue #141.
BigCat [Mon, 19 Dec 2011 11:29:46 +0000 (19:29 +0800)]
Fix issue #247 : Accepting non-integer parameters when shouldn't
Using `getLongFromObjectOrReply` instead of `atoi` if possible.
The following functions are modified.