1959 Commits

Author SHA1 Message Date
antirez
0332a321ba Typo in comment. 2012-07-09 12:02:01 +02:00
antirez
b998ebe904 REPLCONF internal command introduced.
The REPLCONF command is an internal command (not designed to be directly
used by normal clients) that allows a slave to set some replication
related state in the master before issuing SYNC to start the
replication.

The initial motivation for this command, and the only reason currently
it is used by the implementation, is to let the slave instance
communicate its listening port to the slave, so that the master can
show all the slaves with their listening ports in the "replication"
section of the INFO output.

This allows clients to auto discover and query all the slaves attached
into a master.

Currently only a single option of the REPLCONF command is supported, and
it is called "listening-port", so the slave now starts the replication
process with something like the following chat:

    REPLCONF listening-prot 6380
    SYNC

Note that this works even if the master is an older version of Redis and
does not understand REPLCONF, because the slave ignores the REPLCONF
error.

In the future REPLCONF can be used for partial replication and other
replication related features where there is the need to exchange
information between master and slave.

NOTE: This commit also fixes a bug: the INFO outout already carried
information about slaves, but the port was broken, and was obtained
with getpeername(2), so it was actually just the ephemeral port used
by the slave to connect to the master as a client.
2012-07-09 11:59:42 +02:00
antirez
a328c73386 Redis 2.4.15 2.4.15 2012-06-21 15:04:37 +02:00
antirez
05ad034902 Added time.h include in redis-cli.
redis-cli.c uses the time() function to seed the PRNG, but time.h was
not included. This was not noticed since sys/time.h is included and was
enough in most systems (but not correct). With Ubuntu 12.04 GCC
generates a warning that made us aware of the issue.
2012-06-02 15:27:42 +02:00
Premysl Hruby
ba712cec4a future-proof version comparison 2012-06-02 15:27:01 +02:00
antirez
d44437b182 Deleted jemalloc.orig from /deps.
In the commit upgrading jemalloc to version 3.0.0 I added the old
version of Jemalloc in the 'jemalloc.orig' directory for an error.
This commit removes the not useful version of jemalloc.
2012-06-02 15:19:45 +02:00
antirez
699cdb0f5e Jemalloc updated to 3.0.0.
Full changelog here:

http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git;a=blob_plain;f=ChangeLog;hb=master

Notable improvements from the point of view of Redis:

1) Bugfixing.
2) Support for Valgrind.
3) Support for OSX Lion, FreeBSD.
2012-06-02 15:19:39 +02:00
antirez
81b89a5cb5 Fixed typo in the 2.4.14 release note. 2012-05-23 11:40:57 +02:00
antirez
0155386608 Redis 2.4.14 2.4.14 2012-05-23 11:32:58 +02:00
jokea
c6ee2fd595 Set fd to writable when poll(2) detects POLLERR or POLLHUP event. 2012-05-23 11:29:21 +02:00
ThePicard
8a599d36c0 Fixed a typo in install_server.sh 2012-05-23 11:12:22 +02:00
antirez
496e8133c9 No longer used TODO file removed. 2012-05-23 11:10:17 +02:00
antirez
b0a2093956 Fixed issue #516 (ZINTERSTORE mixing sets and zsets).
Weeks ago trying to fix an harmless GCC warning I introduced a bug in
the ziplist-encoded implementations of sorted sets.

The bug completely broke zuiNext() iterator, that is used in the
ZINTERSTORE and ZUNIONSTORE implementation, so those two commands are no
longer reliable starting from Redis version 2.4.12 and latest 2.6.0-RC
releases.

This commit fixes the problem and adds a regression test.
2012-05-23 11:08:33 +02:00
antirez
cd2f985a5e Add an implementation of mstime() to 2.4.
Commit 9419eb0 back ported a better expired keys collection algorithm
that is more incremental but for it to compile and work we need an
implementation of the mstime() function that was missing in 2.4.
2012-05-12 09:40:38 +02:00
antirez
47d8dab2b1 redis-cli pipe mode: handle EINTR properly as well so that SIGSTOP/SIGCONT are handled correctly. 2012-05-12 09:37:14 +02:00
antirez
b074461732 redis-cli pipe mode: handle EAGAIN while writing to socket. 2012-05-12 09:37:09 +02:00
antirez
f1af84d714 redis-cli --pipe for mass import. 2012-05-12 09:37:01 +02:00
antirez
59b084b7cf If the computer running the Redis test is slow, we revert to --clients 1 to avoid false positives. 2012-05-12 09:34:12 +02:00
antirez
735b0e0142 Comment improved so that the code goal is more clear. Thx to @agladysh. 2012-05-12 09:33:51 +02:00
antirez
9419eb0ffd More incremental active expired keys collection process.
If a large amonut of keys are all expiring about at the same time, the
"active" expired keys collection cycle used to block as far as the
percentage of already expired keys was >= 25% of the total population of
keys with an expire set.

This could block the server even for many seconds in order to reclaim
memory ASAP. The new algorithm uses at max a small amount of
milliseconds per cycle, even if this means reclaiming the memory less
promptly it also means a more responsive server.
2012-05-12 09:33:47 +02:00
antirez
6375e5dc0e memtest.c: integer overflow fixed. 2012-05-11 16:05:08 +02:00
antirez
d8769edf15 Macros ULONG_ONEZERO / ULONG_ZEROONE were inverted in #ifdef to test 32/64 bit arch. 2012-05-11 16:04:27 +02:00
antirez
e2c0197d98 Fix PREFIX typo in Makefile. 2012-05-09 20:45:00 +02:00
antirez
2cf55e3a47 Allow PREFIX to be overrided in Makefile. 2012-05-09 10:35:01 +02:00
antirez
e74fe10b00 Redis 2.4.13 2.4.13 2012-05-02 12:14:48 +02:00
Pieter Noordhuis
f2ffb59294 Use safe dictionary iterator from KEYS
Every matched key in a KEYS call is checked for expiration. When the key
is set to expire, the call to `getExpire` will assert that the key also
exists in the main dictionary. This in turn causes a rehashing step to
be executed. Rehashing a dictionary when there is an iterator active may
result in the iterator emitting duplicate entries, or not emitting some
entries at all. By using a safe iterator, the rehash step is omitted.
2012-05-01 10:52:27 +02:00
antirez
9cb09c4d2c Redis 2.4.12 2.4.12 2012-04-30 12:27:50 +02:00
antirez
fc7ea2f7cd Properly wait the slave to sync with master in BRPOPLPUSH test. 2012-04-30 11:50:42 +02:00
antirez
fb38fd3c89 A more lightweight implementation of issue 141 regression test. 2012-04-30 11:48:32 +02:00
antirez
9e066ae051 Redis test: More reliable BRPOPLPUSH replication test.
Now it uses the new wait_for_condition testing primitive.
Also wait_for_condition implementation was fixed in this commit to properly
escape the expr command and its argument.
2012-04-30 11:48:16 +02:00
antirez
28500d193f Testing framework fixes and improvements backported from 2.6. 2012-04-30 11:47:47 +02:00
antirez
63bae7c553 A few compiler warnings suppressed. 2012-04-29 17:20:56 +02:00
antirez
379ac85eed memtest.c fixed to actually use v1 and v2 in memtest_fill_value(). 2012-04-29 17:17:44 +02:00
antirez
df10c797e0 Limit memory used by big SLOWLOG entries.
Two limits are added:

1) Up to SLOWLOG_ENTRY_MAX_ARGV arguments are logged.
2) Up to SLOWLOG_ENTRY_MAX_STRING bytes per argument are logged.
3) slowlog-max-len is set to 128 by default (was 1024).

The number of remaining arguments / bytes is logged in the entry
so that the user can understand better the nature of the logged command.
2012-04-21 21:50:25 +02:00
antirez
f743cacc85 Redis 2.4.11 2.4.11 2012-04-19 14:56:16 +02:00
antirez
922283b553 New redis-cli backported from unstable. 2012-04-18 21:20:35 +02:00
antirez
32fef1566a Marginally cleaner lookupKeyByPattern() implementation.
just fieldobj itself as sentinel of the fact a field object is used or
not, instead of using the filed length, that may be confusing both for
people and for the compiler emitting a warning.
2012-04-18 11:40:48 +02:00
antirez
8e5e8f0eca lookupKeyByPattern() used by SORT GET/BY rewritten. Fixes issue #460.
lookupKeyByPattern() was implemented with a trick to speedup the lookup
process allocating two fake Redis obejcts on the stack. However now that
we propagate expires to the slave as DEL operations the lookup of the
key may result into a call to expireIfNeeded() having the stack
allocated object as argument, that may in turn use it to create the
protocol to send to the slave. But since this fake obejcts are
inherently read-only this is a problem.

As a side effect of this fix there are no longer size limits in the
pattern to be used with GET/BY option of SORT.

See https://github.com/antirez/redis/issues/460 for bug details.
2012-04-17 18:27:18 +02:00
jokea
7b4dc9b979 implement aeWait using poll(2). Fixes issue #267. 2012-04-06 11:49:40 +02:00
antirez
95c6a1a5b8 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:31:37 +02:00
antirez
1fa954a558 Redis 2.4.10 2.4.10 2012-03-30 13:07:18 +02:00
antirez
06665b7191 Useless GCC warning suppressed. 2012-03-30 13:02:08 +02:00
Salvatore Sanfilippo
3c38b0876e Merge pull request #417 from josephjang/e95ca1db21b2dbe82f39a3f7f6390cb5f58dafae
a memory leak with replication on two or more dbs including >= db10
2012-03-30 01:28:58 -07:00
Joseph Jang
e95ca1db21 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 02:17:21 +09:00
antirez
6938960b66 Fix for slaves chains. Force resync of slaves (simply disconnecting them) when SLAVEOF turns a master into a slave. 2012-03-29 09:31:39 +02:00
antirez
9a5cbf9f7e Memory addressing test implemented. 2012-03-19 14:03:00 +01:00
antirez
1dfe75a09b Redis 2.4.9 2.4.9 2012-03-18 22:14:28 +01:00
antirez
8122954b9a Memory test feature backported into 2.4. 2012-03-18 22:08:44 +01:00
antirez
f5f95b35d5 More memory tests implemented. Default number of iterations lowered to a more acceptable value of 50. 2012-03-18 22:00:08 +01:00
antirez
015dba6adb Fixed typo. 2012-03-18 22:00:04 +01:00