1970 Commits

Author SHA1 Message Date
antirez
545a0b4be5 Redis 2.4.18 2.4.18 2012-11-28 18:50:19 +01:00
antirez
b85cb4ce4b Jemalloc updated to version 3.2.0. 2012-11-28 18:42:51 +01:00
antirez
3756e141a1 Make sure that SELECT argument is an integer or return an error.
Unfortunately we had still the lame atoi() without any error checking in
place, so "SELECT foo" would work as "SELECT 0". This was not an huge
problem per se but some people expected that DB can be strings and not
just numbers, and without errors you get the feeling that they can be
numbers, but not the behavior.

Now getLongFromObjectOrReply() is used as almost everybody else across
the code, generating an error if the number is not an integer or
overflows the long type.

Thanks to @mipearson for reporting that on Twitter.
2012-09-11 10:34:51 +02:00
antirez
03a851e55b Redis 2.4.17 2.4.17 2012-08-30 17:42:47 +02:00
antirez
62c8fa38a9 Sentinel: added documentation about slave-priority in redis.conf 2012-08-30 15:05:00 +02:00
antirez
dfdbb2272d Sentinel: Redis-side support for slave priority.
A Redis slave can now be configured with a priority, that is an integer
number that is shown in INFO output and can be get and set using the
redis.conf file or the CONFIG GET/SET command.

This field is used by Sentinel during slave election. A slave with lower
priority is preferred. A slave with priority zero is never elected (and
is considered to be impossible to elect even if it is the only slave
available).

A next commit will add support in the Sentinel side as well.
2012-08-30 15:04:31 +02:00
antirez
96fbd4333f run_id added to INFO output (backported from 2.6).
This change is required to make Redis 2.4 compatible with Sentinel.

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-08-30 14:52:29 +02:00
Michael Parker
18711f1878 Use correct variable name for value to convert.
Note by @antirez: this code was never compiled because utils.c lacked the
float.h include, so we never noticed this variable was mispelled in the
past.

This should provide a noticeable speed boost when saving certain types
of databases with many sorted sets inside.
2012-08-22 12:01:02 +02:00
Pieter Noordhuis
7de2f7e03a Set p to its new offset before modifying it 2012-08-22 11:41:26 +02:00
antirez
2a18c2c416 Redis 2.4.16 2.4.16 2012-08-01 11:59:08 +02:00
jokea
95bf36fc66 mark fd as writable when EPOLLERR or EPOLLHUP is returned by epoll_wait. 2012-07-09 12:15:11 +02:00
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