439 Commits

Author SHA1 Message Date
antirez
5a39fc973d Comment typo fixed. Clusetr -> Cluster. 2012-04-11 10:57:02 +02:00
antirez
670b1e8985 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
antirez
372430fcc0 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
04c1bc9106 For coverage testing use exit() instead of _exit() when termiating saving children. 2012-04-07 12:11:23 +02:00
antirez
cb455b7258 New INFO field in persistence section: bgrewriteaof_scheduled. 2012-04-06 21:12:50 +02:00
Salvatore Sanfilippo
a8f0a0c982 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
antirez
461ffdabca 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
antirez
82e4f722ee New "os" field in INFO output providing information about the operating system. 2012-04-04 15:38:13 +02:00
antirez
e7d86b04ca SLAVEOF is not a write command. 2012-04-04 15:11:30 +02:00
antirez
540d395377 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
Premysl Hruby
e0f4de6aaf allocate alternate signal stack, change of sigaction flags for sigterm 2012-04-03 17:40:31 +02:00
antirez
974c66a26b 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
Joseph Jang
2e7ff37280 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
3946c0afe7 Fixes for redisLogFromHandler(). 2012-03-28 13:51:23 +02:00
antirez
740f77af69 Log from signal handlers is now safer. 2012-03-28 13:45:39 +02:00
antirez
8ff012c473 Merge branch 'watchdog' into unstable 2012-03-28 13:16:19 +02:00
Premysl Hruby
f3fa6655c6 use server.unixtime instead of time(NULL) where possible (cluster.c not checked though) 2012-03-27 17:39:58 +02:00
antirez
25d500767a Redis software watchdog. 2012-03-27 11:47:51 +02:00
antirez
6afb293b49 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
ef34aec719 Add used allocator in redis-server -v output. 2012-03-24 11:53:03 +01:00
antirez
118caec1a8 Correctly create shared.oomerr as an sds string. 2012-03-21 12:11:07 +01:00
antirez
3cd475b254 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
antirez
a15f004026 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
e47e5e87a2 Read-only flag removed from PUBLISH command. 2012-03-19 19:16:41 +01:00
antirez
c577014461 More memory tests implemented. Default number of iterations lowered to a more acceptable value of 50. 2012-03-18 18:03:27 +01:00
antirez
eec3337856 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
antirez
26330d4a06 First implementation of --test-memory. Still a work in progress. 2012-03-16 17:17:39 +01:00
antirez
74d1cad274 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
antirez
696c28fcf9 Reclaim space from the client querybuf if needed. 2012-03-14 15:32:30 +01:00
antirez
94df4c639f Call all the helper functions needed by clientsCron() as clientsCronSomething() for clarity. 2012-03-14 09:56:22 +01:00
antirez
5bab1baf21 Process async client checks like client timeouts and BLPOP timeouts incrementally using a circular list. 2012-03-13 18:05:11 +01:00
antirez
afadac1728 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
antirez
4002005dc4 Instantaneous ops/sec figure in INFO output. 2012-03-08 16:15:37 +01:00
antirez
6c939b3752 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
bab3ce5a09 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
a380c4ad9c 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
8c0915285d 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
ebf37c3156 TIME command. 2012-03-07 10:38:01 +01:00
antirez
6b56c5fd03 Better implementation for BRPOP/BLPOP in the non blocking case. 2012-02-29 14:41:57 +01:00
antirez
332a430de8 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
2b84687811 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
4ff7b78ddf Added command propagation API. 2012-02-28 16:17:00 +01:00
antirez
bd66a75484 debugging messages removed from freeMemoryIfNeeded() 2012-02-08 00:10:20 +01:00
antirez
97f45bad9b 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
antirez
0de0faf4a0 freeMemoryIfNeeded() minor refactoring 2012-02-06 16:56:42 +01:00
antirez
31ae67e8ce Also remove size of AOF buffers from used memory when doing the math for freeMemoryIfNeeded() 2012-02-06 16:35:43 +01:00
antirez
ee273aa92c 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
ea71e06988 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
67c4a45d53 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
90754849a9 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