3610 Commits

Author SHA1 Message Date
antirez
25e71b041d Version bumped to 2.9.11 2013-05-27 11:44:04 +02:00
antirez
b19e3de1d7 redis.conf updated: repl-timeout now uesd by masters as well. 2013-05-27 11:42:45 +02:00
antirez
8752adc059 Close connection with timedout slaves.
Now masters, using the time at which the last REPLCONF ACK was received,
are able to explicitly disconnect slaves that are no longer responding.

Previously the only chance was to see a very long output buffer, that
was highly suboptimal.
2013-05-27 11:42:42 +02:00
antirez
8304ed9a06 Send ACK to master once every second.
ACKs can be also used as a base for synchronous replication. However in
that case they'll be explicitly requested by the master when the client
sends a request that needs to be replicated synchronously.
2013-05-27 11:42:38 +02:00
antirez
c9af89d8cd Don't ACK the master after every command.
Sending an ACK is now moved into the replicationSendAck() function.
2013-05-27 11:42:35 +02:00
antirez
dfc2575703 Make sure that REPLCONF ACK really has no return value. 2013-05-27 11:42:30 +02:00
antirez
84c7d48a80 Replication: send REPLCONF ACK to master. 2013-05-27 11:42:25 +02:00
antirez
6d2b8f5845 REPLCONF ACK command.
This special command is used by the slave to inform the master the
amount of replication stream it currently consumed.

it does not return anything so that we not need to consume additional
bandwidth needed by the master to reply something.

The master can do a number of things knowing the amount of stream
processed, such as understanding the "lag" in bytes of the slave, verify
if a given command was already processed by the slave, and so forth.
2013-05-27 11:42:17 +02:00
antirez
e29d536e17 Fixed a bug in no queueing replies to master. 2013-05-25 01:00:07 +02:00
antirez
f1a7fd7a95 Replication: don't even queue replies to master commands.
When master send commands, there is no need for the slave to reply.
Redis used to queue the reply in the output buffer and discard the reply
later, this is a waste of work and it is not clear why it was this way
(I sincerely don't remember).

This commit changes it in order to don't queue the reply at all.

All tests passing.
2013-05-24 18:58:57 +02:00
antirez
f06f9dacb7 Top comment for prepareClientToWrite() clarified.
We don't write the output buffer to the client socket for slaves only if
the slave is not online.
2013-05-24 18:41:43 +02:00
ioddly
d56c9e48ff Try to report source of bad Lua API calls 2013-05-22 18:17:58 -05:00
antirez
53890a2973 Don't stop reading redis.conf if line has no args.
Should be "continue" and was "return".

This fixes issue #1110
2013-05-18 16:21:52 +02:00
YAMAMOTO Takashi
2e829fc15d don't assume time_t == long
time_t is always 64bit on recent versions of NetBSD.
2013-05-17 17:22:39 +09:00
YAMAMOTO Takashi
321c1a5905 use nanosleep instead of usleep
SUSv3 says that:
	The useconds argument shall be less than one million. If the value of
	useconds is 0, then the call has no effect.
and actually NetBSD's implementation rejects such a value with EINVAL.
use nanosleep which has no such a limitation instead.
2013-05-17 17:21:28 +09:00
YAMAMOTO Takashi
ed23c6ff59 rename popcount to popcount_binary to avoid a conflict with NetBSD libc
NetBSD-current's libc has a function named popcount.
hiding these extensions using feature macros is not possible because
redis uses other extensions covered by the same feature macro.
eg. inet_aton
2013-05-17 17:21:28 +09:00
YAMAMOTO Takashi
f08d4ed811 don't define _XOPEN_SOURCE for NetBSD
on NetBSD, defining _XOPEN_SOURCE hides extensions
like inet_aton, strcasecmp, etc.
2013-05-17 17:19:02 +09:00
antirez
5049902df5 Merge branch 'config-rewrite' into unstable 2013-05-15 11:58:21 +02:00
antirez
2dd77ca691 Use memtoll() when parsing the backlog-size option. 2013-05-15 11:55:14 +02:00
antirez
55f9928677 CONFIG REWRITE: backlog size is a bytes option. 2013-05-15 11:39:29 +02:00
antirez
856fef5d34 CONFIG REWRITE: bindaddr -> bind. 2013-05-15 11:38:43 +02:00
antirez
40ef57bd89 CONFIG REWRITE: when rewriting amount of bytes use GB, MB, KB if possible. 2013-05-15 11:33:02 +02:00
antirez
e5bd70d9f5 CONFIG REWRITE: correctly escape the notify-keyspace-events option. 2013-05-15 11:15:31 +02:00
antirez
a5bbd0b5cc CONFIG REWRITE: "active-rehashing" -> "activerehashing". 2013-05-15 11:09:19 +02:00
antirez
baec7c4443 CONFIG REWRITE: fixed typo in AOF fsync policy. 2013-05-15 11:06:56 +02:00
antirez
9840f28db4 CONFIG REWRITE: repl-disable-tcp-nodelay is a boolean option. 2013-05-15 11:04:53 +02:00
antirez
bde71cbd48 Test default config modified to set logfile to empty string.
Required because of recent changes in the way logfile is set to standard
output.
2013-05-15 10:19:14 +02:00
antirez
cc475c9fed Added a define for most configuration defaults.
Also the logfile option was modified to always have an explicit value
and to log to stdout when an empty string is used as log file.

Previously there was special handling of the string "stdout" that set
the logfile to NULL, this always required some special handling.
2013-05-15 10:12:29 +02:00
antirez
743429956f CONFIG REWRITE: Use sane perms when creating redis.conf from scratch. 2013-05-14 12:45:04 +02:00
antirez
7ff7f14de7 CONFIG REWRITE: actually rewrite the config file, atomically. 2013-05-14 12:32:25 +02:00
antirez
40949481f9 redis-cli: help.h updated. 2013-05-14 11:23:16 +02:00
antirez
e213123474 CONFIG REWRITE: remove orphaned lines. 2013-05-14 11:17:18 +02:00
antirez
6c8e735585 CONFIG REWRITE: strip multiple empty lines. 2013-05-14 10:22:55 +02:00
antirez
df802fd3a1 CONFIG REWRITE: support for client-output-buffer-limit. 2013-05-13 18:34:18 +02:00
antirez
b0b49c4496 CONFIG REWRITE: support for dir and slaveof. 2013-05-13 11:26:49 +02:00
antirez
9c26dfdc04 CONFIG REWRITE: support for save and syslog-facility. 2013-05-13 11:11:45 +02:00
antirez
d193366479 CONFIG REWRITE: Initial support code and design. 2013-05-13 11:11:12 +02:00
antirez
792459e84a Obtain absoute path of configuration file, expose it in INFO. 2013-05-09 16:57:59 +02:00
antirez
020b660322 Test: more PSYNC tests (backlog TTL). 2013-05-09 12:52:04 +02:00
antirez
1590ba7d59 Version bumped to 2.9.10 2013-05-08 15:24:40 +02:00
antirez
78abe60d77 Test: check that replication partial sync works if we break the link.
The test checks both successful syncs and unsuccessful ones by changing
the backlog size.
2013-05-08 13:01:44 +02:00
antirez
3a649224bd Test: various issues with the replication-4.tcl test fixed.
The test actually worked, but vars for master and slave were inverted
and sometimes used incorrectly.
2013-05-08 11:58:26 +02:00
antirez
e6b3fd7a1c Revert "use long long instead of size_t make it more safe"
This reverts commit 47f730ba26cffd207169b960f51f0de4406c82e5.

After further analysis, it is very unlikely that we'll raise the
string size limit to > 512MB, and at the same time such big strings
will be used in 32 bit systems.

Better to revert to size_t so that 32 bit processors will not be
forced to use a 64 bit counter in normal operations, that is currently
completely useless.
2013-05-08 10:01:27 +02:00
Salvatore Sanfilippo
366cedffe9 Merge pull request #1093 from july2993/unstable
in 32bit machine, popcount don't work with a input string length up to 5...
2013-05-08 00:49:33 -07:00
antirez
1570ca254a Added more info about 32 bit builds into README. 2013-05-08 09:48:38 +02:00
Jiahao Huang
47f730ba26 use long long instead of size_t make it more safe 2013-05-07 23:37:22 +08:00
Jiahao Huang
69227d8b76 in 32bit machine, popcount don't work with a input string length up to 512 MB,
bitcount commant may return negtive integer with string length more than 256 MB
2013-05-07 19:55:57 +08:00
antirez
4f96bde1e2 Cluster: link reconnection on delayed PONG reply.
When the PONG delay is half the cluster node timeout, the link gets
disconnected (and later automatically reconnected) in order to ensure
that it's not just a dead connection issue.

However this operation is only performed if the link is old enough, in
order to avoid to disconnect the same link again and again (and among
the other problems, never receive the PONG because of that).

Note: when the link is reconnected, the 'ping_sent' field is not updated
even if a new ping is sent using the new connection, so we can still
reliably detect a node ping timeout.
2013-05-03 15:43:03 +02:00
antirez
9a3532afa8 Cluster: restore PING sent time on reconnections. 2013-05-03 15:42:59 +02:00
antirez
bff532a1f1 Cluster: PING/PONG handling redesigned. 2013-05-03 15:42:38 +02:00