Commit Graph

439 Commits

Author SHA1 Message Date
f2f2ba1b3a Comment typo fixed. Clusetr -> Cluster. 2012-04-11 10:57:02 +02:00
0b913c650d Check write(2) return value to avoid warnings, because in this context failing write is not critical. 2012-04-10 16:48:28 +02:00
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
2cbdab903f For coverage testing use exit() instead of _exit() when termiating saving children. 2012-04-07 12:11:23 +02:00
618a922957 New INFO field in persistence section: bgrewriteaof_scheduled. 2012-04-06 21:12:50 +02:00
0d5f4ba7cd Merge pull request #431 from anydot/f-signal
allocate alternate signal stack, change of sigaction flags for sigterm
2012-04-05 01:52:40 -07:00
4b8c966140 Structure field controlling the INFO field master_link_down_since_seconds initialized correctly to avoid strange INFO output at startup when a slave has yet to connect to its master. 2012-04-04 18:32:22 +02:00
5ad1faa090 New "os" field in INFO output providing information about the operating system. 2012-04-04 15:38:13 +02:00
bb0fbc840d SLAVEOF is not a write command. 2012-04-04 15:11:30 +02:00
9a322ab730 Print milliseconds of the current second in log lines timestamps. Sometimes precise timing is very important for debugging. 2012-04-04 15:11:17 +02:00
c575766202 allocate alternate signal stack, change of sigaction flags for sigterm 2012-04-03 17:40:31 +02:00
e7957ca628 When the user-provided 'maxclients' value is too big for the max number of files we can open, at least try to search the max the OS is allowing (in steps of 256 filedes). 2012-04-03 11:53:45 +02:00
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
5471b8babd Fixes for redisLogFromHandler(). 2012-03-28 13:51:23 +02:00
a7d12cbaf1 Log from signal handlers is now safer. 2012-03-28 13:45:39 +02:00
1043c8064b Merge branch 'watchdog' into unstable 2012-03-28 13:16:19 +02:00
d194905449 use server.unixtime instead of time(NULL) where possible (cluster.c not checked though) 2012-03-27 17:39:58 +02:00
39bd025c29 Redis software watchdog. 2012-03-27 11:47:51 +02:00
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
1b247d1333 Add used allocator in redis-server -v output. 2012-03-24 11:53:03 +01:00
b22eab8faf Correctly create shared.oomerr as an sds string. 2012-03-21 12:11:07 +01:00
7dcdd281f5 DEBUG should not be flagged as w otherwise we can not call DEBUG DIGEST and other commands against read only slaves. 2012-03-20 17:53:47 +01:00
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
bb0aadbe21 Read-only flag removed from PUBLISH command. 2012-03-19 19:16:41 +01:00
d033ccb0af More memory tests implemented. Default number of iterations lowered to a more acceptable value of 50. 2012-03-18 18:03:27 +01:00
1a197a3c1a Number of iteration of --test-memory is now 300 (several minutes per gigabyte). Memtest86 and Memtester links are also displayed while running the test. 2012-03-18 17:25:00 +01:00
c5166e3fc5 First implementation of --test-memory. Still a work in progress. 2012-03-16 17:17:39 +01:00
c9d3dda29c Fix for issue #391.
Use a simple protocol between clientsCron() and helper functions to
understand if the client is still valind and clientsCron() should
continue processing or if the client was freed and we should continue
with the next one.
2012-03-15 20:55:14 +01:00
ae22bf1ef6 Reclaim space from the client querybuf if needed. 2012-03-14 15:32:30 +01:00
529bde82ec Call all the helper functions needed by clientsCron() as clientsCronSomething() for clarity. 2012-03-14 09:56:22 +01:00
d19015be12 Process async client checks like client timeouts and BLPOP timeouts incrementally using a circular list. 2012-03-13 18:05:11 +01:00
8562798308 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
250e7f6908 Instantaneous ops/sec figure in INFO output. 2012-03-08 16:15:37 +01:00
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
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
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
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
9494f1f15b TIME command. 2012-03-07 10:38:01 +01:00
c1db214eeb Better implementation for BRPOP/BLPOP in the non blocking case. 2012-02-29 14:41:57 +01:00
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
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
ad08d059d0 Added command propagation API. 2012-02-28 16:17:00 +01:00
b129c6df45 debugging messages removed from freeMemoryIfNeeded() 2012-02-08 00:10:20 +01:00
609baba8a2 Fixes to c->reply_bytes computation, and debug messages to closely study the behavior of memory pressure + slaves + maxmemory + blocked slaves. 2012-02-07 17:41:31 +01:00
8b7c3455b9 freeMemoryIfNeeded() minor refactoring 2012-02-06 16:56:42 +01:00
c1ef6ffe8a Also remove size of AOF buffers from used memory when doing the math for freeMemoryIfNeeded() 2012-02-06 16:35:43 +01:00
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
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
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
d876678b5e Set a 3.5 GB maxmemory limit with noeviction policy if a 32 bit instance without user-provided memory limits is detected. 2012-02-02 10:26:20 +01:00