Commit Graph

1206 Commits

Author SHA1 Message Date
antirez
d22248ae99 Removed handling of deprecated hash-max-zipmap-entries nad hash-map-zipmap-value. Pieter is too good with users ;). Better to have them switch to a saner configuration ASAP after the 2.6 upgrade. 2012-03-10 10:41:39 +01:00
antirez
addc032756 Added a top-function comment to rioWriteHashIteratorCursor() to better specify what the function does. Not immediately clear from the name. 2012-03-10 10:36:51 +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
0823e48fb9 Support for all the redis.conf fields in CONFIG GET. config.c refactored a bit. 2012-03-08 12:14:23 +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
7b845b6228 anetPeerToString() automatically populates ip/port with something that may be provided to the user as output in case of errors. 2012-03-07 11:30:30 +01:00
antirez
9494f1f15b TIME command. 2012-03-07 10:38:01 +01:00
antirez
60893c6cc6 redis-cli: CSV output added, used for the --slave mode. 2012-02-29 17:43:06 +01:00
antirez
b8283ab218 Initial implementation of redis-cli --slave support. 2012-02-29 17:10:21 +01:00
antirez
a950a84303 Ping the slave using the standard protocol instead of the inline one. 2012-02-29 16:33:54 +01:00
antirez
c1db214eeb Better implementation for BRPOP/BLPOP in the non blocking case. 2012-02-29 14:41:57 +01:00
antirez
cd8bdea31b lpush arguments vector rewrite modified for more speed and to memory leak removal. 2012-02-29 13:38:30 +01:00
antirez
b67feecacd Version bumped to 2.9.5 2012-02-29 00:54:52 +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
edba65d090 Var renamed into pushGenericCommand() to better reflect what it means. 2012-02-28 16:17:55 +01:00
antirez
ad08d059d0 Added command propagation API. 2012-02-28 16:17:00 +01:00
Jakub Wieczorek
1d6628c088 Fix the build on Mac OS X, where features.h is non-existent 2012-02-26 15:13:05 +01:00
Premysl Hruby
80ff1fc6d0 use gcc sync builtins for memory counter when possible 2012-02-26 11:45:52 +01:00
Premysl Hruby
59132e4212 fix redis-benchmark memory leak 2012-02-26 10:01:27 +01:00
antirez
63505e0b59 Lua_cmsgpack added to Redis scripting. 2012-02-24 15:45:16 +01:00
antirez
f6da155bde redis-benchmark: a few fixes to pipelining implementation. 2012-02-23 15:39:26 +01:00
antirez
b9474282f8 redis-benchmark: Initial support for pipelining. 2012-02-23 15:02:43 +01:00
antirez
62c394e219 unstable version called 2.9.4 2012-02-22 17:44:18 +01:00
antirez
a5bd08487f Fix for issue #306, thanks to tchajed (on github) for the pull request. The original patch was reworked a bit. 2012-02-22 16:07:06 +01:00
antirez
4eb3b3e970 Redis-cli should accept help command even if there is no connection to the server. 2012-02-22 15:16:11 +01:00
antirez
467d703ead Merge remote-tracking branch 'origin/unstable' into unstable 2012-02-22 09:52:29 +01:00
antirez
feb282883b 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. 2012-02-22 09:52:10 +01:00
Pieter Noordhuis
ca2344f991 Solaris has backtrace(3) 2012-02-21 10:20:28 -08:00
Pieter Noordhuis
57be47758e Also force SIGSEGV without HAVE_BACKTRACE 2012-02-21 10:20:01 -08:00
antirez
7c96b467c1 Fixed undefined behavior in *INCR style functions overflow detection. Sorry clang! 2012-02-21 18:26:11 +01:00
antirez
fe7be46025 bzero -> memset 2012-02-21 10:06:04 +01:00
antirez
b66e5add82 The hiredis lib shipped with Redis was updated to latest version. 2012-02-19 20:26:50 +01:00
Pieter Noordhuis
cb598cdd59 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.
2012-02-16 17:21:13 +01:00
antirez
a400a9b2d7 Now HINCRBY can detect overflows too. Fix for issue #330. 2012-02-16 16:09:08 +01:00
antirez
6e09ad1c15 Return ASAP from checkClientOutputBufferLimits() if c->reply_bytes is zero. 2012-02-16 12:20:56 +01:00
antirez
48a32944e6 Merge branch 'issue327' into unstable 2012-02-16 09:40:27 +01:00
antirez
3b0600c777 Add stdint.h in endianconv.h to fix issue #336. 2012-02-15 12:21:04 +01:00
antirez
4a701b3801 redis-check-aof is now large files safe also on 32 bit systems. 2012-02-14 19:57:51 +01:00
antirez
120a36f22b 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.
2012-02-14 16:15:24 +01:00
antirez
7a3e372025 endian.c/h -> endianconv.c/h to avoid issues with broken libraries search paths. 2012-02-14 16:11:46 +01:00
antirez
18aa2b87b6 Merge remote-tracking branch 'origin/unstable' into unstable 2012-02-14 16:02:04 +01:00
antirez
6136a16bd1 intset.c endianess fixes. 2012-02-14 15:35:50 +01:00
lsbardel
2f75bbab02 added lua struct c extension 2012-02-13 21:05:21 +00:00
antirez
66d1b021ec ziplist.c endianess fixes, chapter 5. 2012-02-09 17:09:01 +01:00
antirez
cab1105c6e ziplist.c endianess fixes, chapter 4. 2012-02-09 16:36:25 +01:00
antirez
3fa19b7dfc ziplist.c endianess fixes, chapter 3. 2012-02-09 16:28:35 +01:00
antirez
8e0ef249a2 more ziplist.c endianess fixes 2012-02-08 23:20:39 +01:00
antirez
5653847714 ziplist.c fixes for bigendian 2012-02-08 22:59:35 +01:00
antirez
ac834d237a A few small BSD related fixes. 2012-02-08 22:24:59 +01:00
antirez
b129c6df45 debugging messages removed from freeMemoryIfNeeded() 2012-02-08 00:10:20 +01:00
antirez
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
antirez
442246dde2 Precision of getClientOutputBufferMemoryUsage() greatily improved, see issue #327 for more information. 2012-02-07 13:05:36 +01:00
antirez
8b7c3455b9 freeMemoryIfNeeded() minor refactoring 2012-02-06 16:56:42 +01:00
antirez
c1ef6ffe8a Also remove size of AOF buffers from used memory when doing the math for freeMemoryIfNeeded() 2012-02-06 16:35:43 +01:00
antirez
7441fcdd56 Redis Manifesto moved from src to root dir 2012-02-05 09:37:08 +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
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
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
b80b1c5914 Only incremnet stats for key miss/hit when the key is semantically accessed in read-only. 2012-02-01 21:51:20 +01:00
antirez
de79a2ee12 Make SORT BY <constant> STORE ... to always produce the same output by force sorting, so that we have deterministic replication of this command. 2012-02-01 17:05:45 +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
8dd19d818f Fixed redis-benchmark --help output typo 2012-01-31 11:43:32 +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
d1c4c94ebf Merge remote-tracking branch 'origin/unstable' into unstable 2012-01-30 10:40:28 +01:00
Salvatore Sanfilippo
eb7d19ed69 Merge pull request #319 from fawek/lua-error-location
Lua reports line numbers off by one in error messages
2012-01-30 01:40:17 -08:00
antirez
89f6f6abcf setKey(): call the higher level wrapper setModifiedKey() instead of touchWatchedKey() even if currently they are exactly the same. 2012-01-30 10:27:50 +01:00
Michal Kwiatkowski
a0bf8d0ad8 SORT with STORE removes key if result is empty. This fixes issue #227. 2012-01-30 07:36:49 +01:00
Jakub Wieczorek
4d776dba3c Lua reports line numbers off by one in error messages 2012-01-29 14:53:49 +01:00
Pieter Noordhuis
80586cb894 Test that zipmap from RDB is correctly converted 2012-01-25 13:28:11 -08:00
antirez
c715c9b8bf Fixed typo in getClientLimitClassByName() 2012-01-25 18:07:56 +01:00
antirez
d329031fad Fixed another possible bug in cluster.c found by clang --analyze. 2012-01-25 16:59:36 +01:00
antirez
9b810f1cde Merge branch 'unstable' into limits 2012-01-25 16:46:53 +01:00
antirez
6710ff24d0 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. 2012-01-25 16:46:35 +01:00
antirez
c69ad1f24e Merge branch 'unstable' into limits 2012-01-25 10:41:25 +01:00
antirez
ecc5702145 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).
2012-01-25 10:37:32 +01:00
Mukund Sivaraman
caa63a3821 If aeApiCreate() fails, there's probably not much one can do, but in the name of consistency... 2012-01-25 10:27:37 +01:00
antirez
2f0f0d95c0 lenght -> length 2012-01-24 15:33:15 +01:00
antirez
7957c67604 after all closing a client for output buffer limit overcoming is a WARNING level message. 2012-01-24 12:03:48 +01:00
antirez
c8a607f2b6 client-output-buffer-limit documented in redis.conf 2012-01-24 11:23:23 +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
51669c5ac1 client buffer handling refactoring and optimization 2012-01-23 17:15:49 +01:00
antirez
8c43e66346 actually call the function to async free clients in serverCron(). 2012-01-23 16:17:22 +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
b362c111da fixed typo in hahs function seed default value. It is no longer used but fixed to retain the old constant as default anyway. 2012-01-22 01:40:23 +01:00
antirez
06c5523a88 typo in comment fixed 2012-01-21 23:34:06 +01:00
antirez
a48c8d873b Fix for hash table collision attack. We simply randomize hash table initialization value at startup time. 2012-01-21 23:30:13 +01:00
antirez
447ebf3bc7 Better looking registers/stack dump 2012-01-20 16:40:43 +01:00
antirez
632da60583 added support to dump registers on crash on Linux x32 2012-01-20 14:37:50 +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
4aac3ff247 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. 2012-01-16 16:50:24 +01:00
antirez
ebdfad69dc 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. 2012-01-16 11:29:47 +01:00
antirez
1596d6a61e Obsolete SDS_ABORT_ON_OOM removed from sds.c 2012-01-16 10:08:33 +01:00
antirez
bd068b15c2 sds.c no longe pre-allocate more than 1MB of free space ahead. This fixes issue #252. 2012-01-16 10:03:38 +01:00
antirez
7faa1f075b added a comment on top of the zslRandomLevel() function 2012-01-16 09:39:04 +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
antirez
d8bd12f984 error in comment fixed 2012-01-11 20:25:51 +01:00
antirez
5db904bdc5 show GCC version in INFO output. 2012-01-10 18:37:16 +01:00
antirez
68fe1b9b99 version bumped to 2.9.3 2012-01-07 12:54:48 +01:00
Pieter Noordhuis
fe45840201 Implements ziplistFind
To improve the performance of the ziplist implementation, some
functions have been converted to macros to avoid unnecessary stack
movement and duplicate variable assignments.
2012-01-03 16:13:42 -08:00
Pieter Noordhuis
ebd85e9a45 Encode small hashes with a ziplist 2012-01-02 22:14:10 -08:00
Pieter Noordhuis
9ea54feef0 string2* functions take a const pointer 2012-01-02 15:24:50 -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
antirez
35c6032cfa A few no longer used defines removed from redis.h 2011-12-31 15:34:02 +01:00
antirez
1824e3a3a3 Fixed replication when multiple slaves are attaching at the same time. The output buffer was not copied correctly between slaves. This fixes issue #141. 2011-12-30 19:40:43 +01:00
antirez
256356ffd8 Prevent NaN scores in sorted sets resulting from calls to ZUNIONSTORE and ZINTERSTORE. 2011-12-23 09:27:31 +01:00
antirez
d334281c80 Merge remote-tracking branch 'origin/unstable' into unstable 2011-12-21 17:13:31 +01:00
antirez
e51b79f315 sligthly better AOF related logs 2011-12-21 17:12:23 +01:00
antirez
b941417c1b Log when the child rewriting the AOF is killed by stopAppendOnly() 2011-12-21 16:37:22 +01:00
antirez
1844f9900f server.replstate -> server.repl_state 2011-12-21 12:23:18 +01:00
antirez
f48cd4b90c some RDB server struct fields renamed. 2011-12-21 12:22:13 +01:00
antirez
ff2145adac more AOF server struct fields renamed. 2011-12-21 12:17:02 +01:00
antirez
2c915bcf6d AOF fileds in the global server state, and define names, renamed with more consistent names. More work to do. 2011-12-21 11:58:42 +01:00
antirez
e394114d95 AOF refactoring, now with three states: ON, OFF, WAIT_REWRITE. 2011-12-21 10:31:34 +01:00
antirez
c6ac7d0302 server.appendonly -> server.aof_state, and many comments added in the server global state structure in the process. 2011-12-21 10:05:32 +01:00
antirez
efb6022529 Do not propagate DEBUG LOADAOF 2011-12-20 17:52:57 +01:00
antirez
af77acc310 startAppendOnly() fixed to set server.appendonly to 0 if the start failed. 2011-12-20 17:00:50 +01:00
antirez
fc96409f91 Merge remote-tracking branch 'origin/unstable' into aof-fixes 2011-12-20 10:29:33 +01:00
BigCat
706b32e0e0 Fix issue #247 : Accepting non-integer parameters when shouldn't
Using `getLongFromObjectOrReply` instead of `atoi` if possible.
The following functions are modified.

* lrangeCommand
* ltrimCommand
* lremCommand
* lindexCommand
* lsetCommand
* zunionInterGenericCommand
* genericZrangebyscoreCommand
* sortCommand
2011-12-19 19:48:35 +08:00
antirez
0e59a94728 version bumped to 2.9.2 2011-12-19 10:55:31 +01:00
antirez
0a466a7542 Fixed memleak in CLIENT INFO, added simple test that will work as regression test on mac os x and in the CI when running over valgrind. This fixes issue #256 2011-12-19 10:16:37 +01:00
antirez
a244a13b4c added assertion in zslInsert() that ensures the inserted element score is not NaN 2011-12-18 11:12:58 +01:00
antirez
24accab2aa Merge remote-tracking branch 'origin/unstable' into unstable 2011-12-16 09:56:12 +01:00
antirez
18d0ef4bf0 ae.c: solved a memory leak with no practical effects (since the event
loop is never destroyed in Redis). Thanks to @anydot for noticing it.
2011-12-16 09:55:06 +01:00
antirez
087f414090 Fix: when aof_write_rewrite is true don't append on the AOF buffer but accumulate the differences for the rewrite. 2011-12-15 20:03:28 +01:00
antirez
e7a2e7c1f7 AOF fixes in the context of replicaiton (when AOF is used by slave) and CONFIG SET appendonly yes/no. 2011-12-15 16:07:49 +01:00
antirez
36dda9554a ae_epoll.c typo introduced in the previous commit fixed. 2011-12-15 11:50:15 +01:00
antirez
e074416be4 Max limit to 10k clients removed, this implements feature request on issue #194 2011-12-15 11:42:40 +01:00
antirez
503d87a818 List connected slaves with ip,port,state information in INFO, as requested by github issue #219 2011-12-14 15:11:11 +01:00
antirez
19951d965a version bumped to 2.9.1 2011-12-13 18:07:21 +01:00
antirez
e2f313899b redis-cli --eval implemented 2011-12-13 16:22:28 +01:00
antirez
54ecc0e777 Hash type AOF rewrite using HMSET. 2011-12-13 11:10:51 +01:00
antirez
7df9b1412b Sorted Set type AOF rewrite using variadic ZADD. 2011-12-13 11:10:46 +01:00
antirez
8d875ccb7a Set type AOF rewrite using variadic SADD. 2011-12-13 11:10:41 +01:00
antirez
38c06fa037 List type AOF rewrite using variadic RPUSH for the linked list encoding. 2011-12-13 11:10:31 +01:00