279 Commits

Author SHA1 Message Date
antirez
6a424b5e36 RDMF (Redis/Disque merge friendlyness) refactoring WIP 1. 2015-07-26 15:17:18 +02:00
Jiahao Huang
4e4a00e86a config tcp-keepalive should be numerical field not bool 2015-07-16 15:53:44 +08:00
antirez
aeba514612 Config: improve loglevel message error. 2015-03-12 14:43:07 +01:00
antirez
6f54cf9b6f CONFIG GET syslog-facility added.
Was missing for some reason. Trivial to add after config.c refactoring.
2015-03-12 09:59:10 +01:00
antirez
9f591427f7 CONFIG SET refactoring: use enums in more places. 2015-03-11 23:21:04 +01:00
antirez
804534462f CONFIG refactoring: configEnum abstraction.
Still many things to convert inside config.c in the next commits.
Some const safety in String objects creation and addReply() family
functions.
2015-03-11 17:00:13 +01:00
antirez
b764bd74ed CONFIG SET: memory and special field macros. 2015-03-11 09:02:04 +01:00
antirez
5cbdf469c7 CONFIG SET: additional 2 numerical fields refactored. 2015-03-10 13:00:36 +01:00
antirez
570fcd198b CONFIG SET refactoring of bool and value fields.
Not perfect since The Solution IMHO is to have a DSL with a table of
configuration functions with type, limits, and aux functions to handle
the odd ones. However this hacky macro solution is already better and
forces to put limits in the range of numerical fields.

More field types to be refactored in the next commits hopefully.
2015-03-10 12:37:39 +01:00
antirez
3713dc1c1b Config: activerehashing option support in CONFIG SET. 2015-03-08 15:33:42 +01:00
antirez
75a2dbffa8 Extend memory unit support in CONFIG SET.
Related to PR #2357.
2015-02-12 16:51:20 +01:00
Chris Lamb
5494a90bdb Tidy grammar in CONFIG SET maxmemory warning.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
2015-02-04 18:37:34 +00:00
Chris Lamb
260e6f9f00 Support "1G" etc. units in CONFIG SET maxmemory
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
2015-02-04 18:36:38 +00:00
Matt Stancliff
02b75aac5a Supervise redis processes only if configured
Adds configuration option 'supervised [no | upstart | systemd | auto]'

Also removed 'bzero' from the previous implementation because it's 2015.
(We could actually statically initialize those structs, but clang
throws an invalid warning when we try, so it looks bad even though it
isn't bad.)

Fixes #2264
2015-01-09 15:19:18 -05:00
Matt Stancliff
16cda6f076 Config: Add quicklist, remove old list options
This removes:
  - list-max-ziplist-entries
  - list-max-ziplist-value

This adds:
  - list-max-ziplist-size
  - list-compress-depth

Also updates config file with new sections and updates
tests to use quicklist settings instead of old list settings.
2015-01-02 11:16:10 -05:00
Matt Stancliff
90eef6c8bc Add maxmemory_policy to INFO output
Also refactors getting human string values from
the defined value in `server.maxmemory_policy`
into a common function.
2014-12-11 10:45:22 -05:00
antirez
7265428d8e Diskless sync delay is now configurable. 2014-10-27 10:36:30 +01:00
antirez
d7a9be4319 Diskless replication: redis.conf and CONFIG SET/GET support. 2014-10-16 10:22:02 +02:00
Ezequiel Lovelle
c9f3399e94 Fix typo
Closes #2029
2014-09-29 06:49:09 -04:00
antirez
aea347d60c Cluster: new option to work with partial slots coverage. 2014-09-17 11:10:09 +02:00
antirez
d881e15dfe Make aof-load-truncated option actually configurable. 2014-09-08 10:56:52 +02:00
antirez
6b132288b6 Sentinel: announce ip/port changes + rewrite.
The original implementation was modified in order to allow to
selectively announce a different IP or port, and to rewrite the two
options in the config file after a rewrite.
2014-09-04 11:23:31 +02:00
antirez
2e94ffb1d1 Remove warnings and improve integer sign correctness. 2014-08-13 11:44:38 +02:00
cubicdaiya
e53ba28f8e Use 'void' for zero-argument functions
According to the C standard,
it is desirable to give the type 'void'
to functions have no argument.

Closes #1631
2014-08-08 10:05:32 +02:00
antirez
71c60780e1 Latency monitor trheshold value is now configurable.
This commit adds both support for redis.conf and CONFIG SET/GET.
2014-07-02 12:28:17 +02:00
antirez
1c94889182 No more trailing spaces in Redis source code. 2014-06-26 18:48:40 +02:00
antirez
fb93fe727b Client types generalized.
Because of output buffer limits Redis internals had this idea of type of
clients: normal, pubsub, slave. It is possible to set different output
buffer limits for the three kinds of clients.

However all the macros and API were named after output buffer limit
classes, while the idea of a client type is a generic one that can be
reused.

This commit does two things:

1) Rename the API and defines with more general names.
2) Change the class of clients executing the MONITOR command from "slave"
   to "normal".

"2" is a good idea because you want to have very special settings for
slaves, that are not a good idea for MONITOR clients that are instead
normal clients even if they are conceptually slave-alike (since it is a
push protocol).

The backward-compatibility breakage resulting from "2" is considered to
be minimal to care, since MONITOR is a debugging command, and because
anyway this change is not going to break the format or the behavior, but
just when a connection is closed on big output buffer issues.
2014-06-16 10:43:05 +02:00
antirez
aec8e92316 Cluster: slave validity factor is now user configurable.
Check the commit changes in the example redis.conf for more information.
2014-05-22 16:57:54 +02:00
antirez
1dca87d69c User-defined switch point between sparse-dense HLL encodings. 2014-04-15 17:46:51 +02:00
Matt Stancliff
b8247b4686 Fix maxclients error handling
Everywhere in the Redis code base, maxclients is treated
as an int with (int)maxclients or `maxclients = atoi(source)`,
so let's make maxclients an int.

This fixes a bug where someone could specify a negative maxclients
on startup and it would work (as well as set maxclients very high)
because:

    unsigned int maxclients;
    char *update = "-300";
    maxclients = atoi(update);
    if (maxclients < 1) goto fail;

But, (maxclients < 1) can only catch the case when maxclients
is exactly 0.  maxclients happily sets itself to -300, which isn't
-300, but rather 4294966996, which isn't < 1, so... everything
"worked."

maxclients config parsing checks for the case of < 1, but maxclients
CONFIG SET parsing was checking for case of < 0 (allowing
maxclients to be set to 0).  CONFIG SET parsing is now updated to
match config parsing of < 1.

It's tempting to add a MINIMUM_CLIENTS define, but... I didn't.

These changes were inspired by antirez#356, but this doesn't
fix that issue.
2014-03-24 10:17:33 -04:00
antirez
624be01ff0 Unify stats reset for CONFIG RESETSTAT / initServer().
Now CONFIG RESETSTAT makes sure to reset all the fields, and in the
future it will be simpler to avoid missing new fields.
2014-03-19 12:55:49 +01:00
Matt Stancliff
234ff93b35 Reset op_sec_last_sample_ops when reset requested
This value needs to be set to zero (in addition to
stat_numcommands) or else people may see
a negative operations per second count after they
run CONFIG RESETSTAT.

Fixes antirez/redis#1577
2014-03-06 18:00:08 +01:00
antirez
6319a51ac2 Cast saveparams[].seconds to long for %ld format specifier. 2014-03-05 11:26:18 +01:00
antirez
46a06ee210 CONFIG REWRITE should be logged at WARNING level. 2014-03-04 16:39:47 +01:00
antirez
dda8bc1eff Log when CONFIG REWRITE goes bad. 2014-02-13 14:32:44 +01:00
antirez
2d253d1543 Option "backlog" renamed "tcp-backlog".
This is especially important since we already have a concept of backlog
(the replication backlog).
2014-01-31 14:56:10 +01:00
Nenad Merdanovic
ca81272ea4 Add support for listen(2) backlog definition
In high RPS environments, the default listen backlog is not sufficient, so
giving users the power to configure it is the right approach, especially
since it requires only minor modifications to the code.
2014-01-31 14:52:10 +01:00
antirez
bc300b22af Cluster: configurable replicas migration barrier.
It is possible to configure the min number of additional working slaves
a master should be left with, for a slave to migrate to an orphaned
master.
2014-01-31 11:26:36 +01:00
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