Commit Graph

265 Commits

Author SHA1 Message Date
antirez
84bcd3aa24 It is now possible to enable/disable RDB checksum computation from redis.conf or via CONFIG SET/GET. Also CONFIG SET support added for rdbcompression as well. 2012-04-10 15:47:10 +02:00
antirez
88c1d9550d crc64.c modified for incremental computation. 2012-04-09 12:20:47 +02:00
antirez
2cbdab903f For coverage testing use exit() instead of _exit() when termiating saving children. 2012-04-07 12:11:23 +02:00
Salvatore Sanfilippo
d84f776e87 Merge pull request #426 from anydot/fix-rm-vm-comments
remove mentions of VM in comments
2012-04-05 01:54:09 -07:00
antirez
9510d65dc8 CRC64 implementation added to Redis code base. 2012-04-02 12:31:44 +02:00
Premysl Hruby
8918de9202 remove mentions of VM in comments 2012-04-02 11:56:03 +02:00
antirez
04d360fdcd Better syncio.c with millisecond resolution. 2012-03-31 11:21:45 +02:00
Joseph Jang
f892797e1b Fixed a memory leak with replication
occurs when two or more dbs are replicated and at least one of them is >db10
2012-03-30 10:34:29 +02:00
antirez
179e54d2a9 Fix for slaves chains. Force resync of slaves (simply disconnecting them) when SLAVEOF turns a master into a slave. 2012-03-29 09:24:02 +02:00
antirez
a7d12cbaf1 Log from signal handlers is now safer. 2012-03-28 13:45:39 +02:00
antirez
1043c8064b Merge branch 'watchdog' into unstable 2012-03-28 13:16:19 +02:00
Premysl Hruby
8af9fe841c declare hashDictType as external too 2012-03-27 18:18:57 +02:00
antirez
39bd025c29 Redis software watchdog. 2012-03-27 11:47:51 +02:00
antirez
c1d01b3c57 New INFO field aof_delayed_fsync introduced.
This new field counts all the times Redis is configured with AOF enabled and
fsync policy 'everysec', but the previous fsync performed by the
background thread was not able to complete within two seconds, forcing
Redis to perform a write against the AOF file while the fsync is still
in progress (likely a blocking operation).
2012-03-25 11:27:35 +02:00
antirez
f3fd419fc9 Support for read-only slaves. Semantical fixes.
This commit introduces support for read only slaves via redis.conf and CONFIG GET/SET commands. Also various semantical fixes are implemented here:

1) MULTI/EXEC with only read commands now work where the server is into a state where writes (or commands increasing memory usage) are not allowed. Before this patch everything inside a transaction would fail in this conditions.

2) Scripts just calling read-only commands will work against read only
slaves, when the server is out of memory, or when persistence is into an
error condition. Before the patch EVAL always failed in this condition.
2012-03-20 17:32:48 +01:00
antirez
ae22bf1ef6 Reclaim space from the client querybuf if needed. 2012-03-14 15:32:30 +01:00
antirez
e74dca73d9 Client creation time in redisClient structure. New age field in CLIENT LIST output. 2012-03-13 13:05:08 +01:00
antirez
8562798308 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
antirez
250e7f6908 Instantaneous ops/sec figure in INFO output. 2012-03-08 16:15:37 +01:00
antirez
91d664d6ce run_id added to INFO output.
The Run ID is a field that identifies a single execution of the Redis
server. It can be useful for many purposes as it makes easy to detect if
the instance we are talking about is the same, or if it is a different
one or was rebooted. An application of run_id will be in the partial
synchronization of replication, where a slave may request a partial sync
from a given offset only if it is talking with the same master. Another
application is in failover and monitoring scripts.
2012-03-08 10:13:36 +01:00
antirez
44f508f1a8 clusterGetRandomName() generalized into getRandomHexChars() so that we can use it for the run_id field as well. 2012-03-08 10:08:44 +01:00
antirez
4d3bbf3590 By default Redis refuses writes with an error if the latest BGSAVE failed (and at least one save point is configured). However people having good monitoring systems may prefer a server that continues to work, since they are notified that there are problems by their monitoring systems. This commit implements the ability to turn the feature on or off via redis.conf and CONFIG SET. 2012-03-07 18:02:26 +01:00
antirez
c25e7eafef Refuse writes if can't persist on disk.
Redis now refuses accepting write queries if RDB persistence is
configured, but RDB snapshots can't be generated for some reason.
The status of the latest background save operation is now exposed
in the INFO output as well. This fixes issue #90.
2012-03-07 13:05:53 +01:00
antirez
e31b615e62 Better MONITOR output, now includes client ip:port or the lua string if the command was executed by the scripting engine. 2012-03-07 12:12:15 +01:00
antirez
9494f1f15b TIME command. 2012-03-07 10:38:01 +01:00
antirez
c1db214eeb Better implementation for BRPOP/BLPOP in the non blocking case. 2012-02-29 14:41:57 +01:00
antirez
78d6a22dc3 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.
2012-02-29 00:46:50 +01:00
antirez
eeb34eff52 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. 2012-02-28 18:03:08 +01:00
antirez
d8b1228bf6 propagate() prototype added to redis.h 2012-02-28 16:20:41 +01:00
antirez
ad08d059d0 Added command propagation API. 2012-02-28 16:17:00 +01:00
antirez
8b7c3455b9 freeMemoryIfNeeded() minor refactoring 2012-02-06 16:56:42 +01:00
antirez
f6b32c14f4 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.
2012-02-04 14:05:54 +01:00
antirez
355f859134 Use less memory when emitting the protocol, by using more shared objects for commonly emitted parts of the protocol. 2012-02-04 08:58:37 +01:00
antirez
ce8b772be7 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. 2012-02-02 16:30:52 +01:00
antirez
75eaac5c74 Added a server.arch_bits field instead of computing it at runtime for INFO. 2012-02-02 10:23:31 +01:00
antirez
2c861050c1 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. 2012-02-01 15:22:28 +01:00
antirez
548efd91e5 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. 2012-01-31 16:09:21 +01:00
antirez
3c08fdae71 64 bit instances are no longer limited to have at max 2^32-1 elements in lists. 2012-01-31 10:35:52 +01:00
antirez
7fe8d49a70 Client output buffer limits: configuration of parameters for the different classes of clients implemented. 2012-01-24 10:43:30 +01:00
antirez
06b3dced99 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. 2012-01-24 09:32:39 +01:00
antirez
7eac2a75a4 Implementation of the internals that make possible to terminate clients overcoming configured output buffer (soft and hard) limits. 2012-01-23 16:12:37 +01:00
antirez
890da62eea Merge branch 'unstable' into limits 2012-01-23 10:36:07 +01:00
antirez
eea8c7a4f8 added support to dump registers on crash on Linux x64 2012-01-20 12:54:15 +01:00
antirez
d4d208595c 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. 2012-01-20 12:20:45 +01:00
antirez
498dc5557c Introduced three client limit classes: normal, slave, pubsub 2012-01-17 12:43:01 +01:00
antirez
3853c16839 Track the length of the client pending output buffers (still to transfer) in a new field in the client structure. 2012-01-17 12:23:25 +01:00
antirez
00010fa96f On crash print information about the current client (if any), command vector, and object associated to first argument assuming it is a key. 2012-01-12 16:02:57 +01:00
Pieter Noordhuis
ebd85e9a45 Encode small hashes with a ziplist 2012-01-02 22:14:10 -08:00
antirez
11e0c4c55b 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. 2011-12-31 16:09:46 +01:00
antirez
f42e2f1bd7 Protocol and I/O related defines moved into a separated section of redis.h 2011-12-31 15:37:33 +01:00