291 Commits

Author SHA1 Message Date
antirez
26c1bf2a61 Cluster: don't rewrite slaveof config directive in cluster mode. 2014-01-20 11:10:42 +01:00
antirez
4dff037c2b Cluster: fix error reporting when slaveof is found in config. 2014-01-20 11:08:14 +01:00
antirez
c571290943 Fix CONFIG REWRITE handling of unknown options.
There were two problems with the implementation.

1) "save" was not correctly processed when no save point was configured,
   as reported in issue #1416.
2) The way the code checked if an option existed in the "processed"
   dictionary was wrong, as we add the element with as a key associated
   with a NULL value, so dictFetchValue() can't be used to check for
   existance, but dictFind() must be used, that returns NULL only if the
   entry does not exist at all.
2013-12-23 12:50:27 +01:00
antirez
9dc5817de7 CONFIG REWRITE: no special handling or include and rename-command.
CONFIG REWRITE is now wiser and does not touch what it does not
understand inside redis.conf.
2013-12-19 15:57:11 +01:00
Yubao Liu
9846af124d CONFIG REWRITE: don't throw some options on config rewrite
Those options will be thrown without this patch:
  include, rename-command, min-slaves-to-write, min-slaves-max-lag,
appendfilename.
2013-12-19 15:56:48 +01:00
antirez
5131d7da74 CONFIG REWRITE: old development comments removed. 2013-12-19 15:30:06 +01:00
antirez
f075607239 CONFIG REWRITE: don't wipe unknown options.
With this commit options not explicitly rewritten by CONFIG REWRITE are
not touched at all. These include new options that may not have support
for REWRITE, and other special cases like rename-command and include.
2013-12-19 15:25:45 +01:00
antirez
c8bbc084d5 Merge branch 'newsentinel' into unstable 2013-11-21 15:01:25 +01:00
antirez
19f625ed5c CONFIG REWRITE: don't add the signature if it already exists.
At the end of the file, CONFIG REWRITE adds a comment line that:

    # Generated by CONFIG REWRITE

Followed by the additional config options required. However this was
added again and again at every rewrite in praticular conditions (when a
given set of options change in a given time during the time).

Now if it was alrady encountered, it is not added a second time.

This is especially important for Sentinel that rewrites the config at
every state change.
2013-11-19 17:58:11 +01:00
antirez
45666c4c22 Sentinel: CONFIG REWRITE support for Sentinel config. 2013-11-19 09:48:12 +01:00
antirez
33ccfbb624 Fix typo 'configuraiton' in rewriteConfigRewriteLine() comment. 2013-11-18 18:18:10 +01:00
antirez
e4b341a335 Cluster: time switched from seconds to milliseconds.
All the internal state of cluster involving time is now using mstime_t
and mstime() in order to use milliseconds resolution.

Also the clusterCron() function is called with a 10 hz frequency instead
of 1 hz.

The cluster node_timeout must be also configured in milliseconds by the
user in redis.conf.
2013-10-09 16:19:26 +02:00
antirez
1560b70889 Cluster: cluster stuff moved from redis.h to cluster.h. 2013-10-09 15:38:05 +02:00
antirez
de86e24ba6 Add REWRITE to CONFIG subcommands help message. 2013-10-04 12:27:26 +02:00
antirez
aa32f92338 Introduction of a new string encoding: EMBSTR
Previously two string encodings were used for string objects:

1) REDIS_ENCODING_RAW: a string object with obj->ptr pointing to an sds
stirng.

2) REDIS_ENCODING_INT: a string object where the obj->ptr void pointer
is casted to a long.

This commit introduces a experimental new encoding called
REDIS_ENCODING_EMBSTR that implements an object represented by an sds
string that is not modifiable but allocated in the same memory chunk as
the robj structure itself.

The chunk looks like the following:

+--------------+-----------+------------+--------+----+
| robj data... | robj->ptr | sds header | string | \0 |
+--------------+-----+-----+------------+--------+----+
                     |                       ^
                     +-----------------------+

The robj->ptr points to the contiguous sds string data, so the object
can be manipulated with the same functions used to manipulate plan
string objects, however we need just on malloc and one free in order to
allocate or release this kind of objects. Moreover it has better cache
locality.

This new allocation strategy should benefit both the memory usage and
the performances. A performance gain between 60 and 70% was observed
during micro-benchmarks, however there is more work to do to evaluate
the performance impact and the memory usage behavior.
2013-07-22 10:31:38 +02:00
antirez
bd9b1251ac Ability to bind multiple addresses. 2013-07-04 18:50:15 +02:00
antirez
37b5ec9425 Only allow basenames for dbfilename and appendfilename.
This fixes issue #1094.
2013-07-02 12:14:28 +02:00
antirez
f4805fa45a CONFIG SET maxclients. 2013-06-28 17:08:03 +02:00
Salvatore Sanfilippo
a59318f0a4 Merge pull request #1111 from yamt/netbsd3
netbsd support
2013-06-26 06:17:02 -07:00
Jan-Erik Rediger
21afa5dbed Initialize char* to NULL to remove compiler warning 2013-06-20 17:53:35 +03:00
antirez
9aa989d073 CONFIG SET: accept slave-priority zero, it is valid. 2013-05-31 19:31:36 +02:00
antirez
45ff68db75 Refresh good slaves count after CONFIG SET min-slaves-...
This way just after the CONFIG SET enabling the min-slaves feature it is
possible to write to the database without delays.
2013-05-30 12:23:41 +02:00
antirez
cb76f29230 min-slaves-to-write: don't accept writes with less than N replicas.
This feature allows the user to specify the minimum number of
connected replicas having a lag less or equal than the specified
amount of seconds for writes to be accepted.
2013-05-30 11:30:04 +02: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
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
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
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
ce5afa1403 CONFIG SET server.masterauth aesthetic change.
This is just to make the code exactly like the above instance used for
requirepass. No actual change nor the original code violated the Redis
coding style.
2013-05-02 17:20:49 +02:00
Michel Martens
8482c99e14 Reset masterauth if an empty string is configured. 2013-05-02 17:19:11 +02:00
antirez
bd638d72ee Config option to turn AOF rewrite incremental fsync on/off. 2013-04-24 10:57:07 +02:00
antirez
8f6ad5206e Cluster: CONFIG SET cluster-node-timeout. 2013-04-09 11:29:51 +02:00
antirez
da03b66774 Cluster: CONFIG GET cluster-node-timeout. 2013-04-04 14:21:01 +02:00
antirez
0c0db1bc3d Cluster: node timeout is now configurable. 2013-04-04 12:29:10 +02:00
NanXiao
7b7ebdc11c Update config.c
Fix bug in configGetCommand function: get correct masterauth value.
2013-03-14 13:52:43 +08:00
antirez
adb45867b8 Handle a non-impossible empty argv in loadServerConfigFromString().
Usually this does not happens since we trim for " \t\r\n", but if there
are other chars that return true with isspace(), we may end with an
empty argv. Better to handle the condition in an explicit way.
2013-03-06 12:40:48 +01:00