summaryrefslogtreecommitdiff
path: root/src/config.c
Commit message (Collapse)AuthorAgeFilesLines
* User-defined switch point between sparse-dense HLL encodings.antirez2014-04-151-0/+8
|
* Fix maxclients error handlingMatt Stancliff2014-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Unify stats reset for CONFIG RESETSTAT / initServer().antirez2014-03-191-9/+1
| | | | | Now CONFIG RESETSTAT makes sure to reset all the fields, and in the future it will be simpler to avoid missing new fields.
* Reset op_sec_last_sample_ops when reset requestedMatt Stancliff2014-03-061-0/+1
| | | | | | | | | 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
* Cast saveparams[].seconds to long for %ld format specifier.antirez2014-03-051-1/+1
|
* CONFIG REWRITE should be logged at WARNING level.antirez2014-03-041-0/+1
|
* Log when CONFIG REWRITE goes bad.antirez2014-02-131-0/+1
|
* Option "backlog" renamed "tcp-backlog".antirez2014-01-311-5/+5
| | | | | This is especially important since we already have a concept of backlog (the replication backlog).
* Add support for listen(2) backlog definitionNenad Merdanovic2014-01-311-0/+7
| | | | | | 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.
* Cluster: configurable replicas migration barrier.antirez2014-01-311-0/+14
| | | | | | 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.
* Cluster: don't rewrite slaveof config directive in cluster mode.antirez2014-01-201-2/+3
|
* Cluster: fix error reporting when slaveof is found in config.antirez2014-01-201-1/+6
|
* Fix CONFIG REWRITE handling of unknown options.antirez2013-12-231-1/+3
| | | | | | | | | | | | 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.
* CONFIG REWRITE: no special handling or include and rename-command.antirez2013-12-191-12/+1
| | | | | CONFIG REWRITE is now wiser and does not touch what it does not understand inside redis.conf.
* CONFIG REWRITE: don't throw some options on config rewriteYubao Liu2013-12-191-13/+16
| | | | | | Those options will be thrown without this patch: include, rename-command, min-slaves-to-write, min-slaves-max-lag, appendfilename.
* CONFIG REWRITE: old development comments removed.antirez2013-12-191-32/+4
|
* CONFIG REWRITE: don't wipe unknown options.antirez2013-12-191-9/+50
| | | | | | 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.
* Merge branch 'newsentinel' into unstableantirez2013-11-211-1/+10
|\
| * CONFIG REWRITE: don't add the signature if it already exists.antirez2013-11-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Sentinel: CONFIG REWRITE support for Sentinel config.antirez2013-11-191-0/+5
| |
* | Fix typo 'configuraiton' in rewriteConfigRewriteLine() comment.antirez2013-11-181-1/+1
|/
* Cluster: time switched from seconds to milliseconds.antirez2013-10-091-1/+1
| | | | | | | | | | | 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.
* Cluster: cluster stuff moved from redis.h to cluster.h.antirez2013-10-091-0/+1
|
* Add REWRITE to CONFIG subcommands help message.antirez2013-10-041-1/+1
|
* Introduction of a new string encoding: EMBSTRantirez2013-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Ability to bind multiple addresses.antirez2013-07-041-4/+37
|
* Only allow basenames for dbfilename and appendfilename.antirez2013-07-021-0/+12
| | | | This fixes issue #1094.
* CONFIG SET maxclients.antirez2013-06-281-3/+28
|
* Merge pull request #1111 from yamt/netbsd3Salvatore Sanfilippo2013-06-261-2/+2
|\ | | | | netbsd support
| * don't assume time_t == longYAMAMOTO Takashi2013-05-171-2/+2
| | | | | | | | time_t is always 64bit on recent versions of NetBSD.
* | Initialize char* to NULL to remove compiler warningJan-Erik Rediger2013-06-201-2/+2
| |
* | CONFIG SET: accept slave-priority zero, it is valid.antirez2013-05-311-1/+1
| |
* | Refresh good slaves count after CONFIG SET min-slaves-...antirez2013-05-301-0/+2
| | | | | | | | | | This way just after the CONFIG SET enabling the min-slaves feature it is possible to write to the database without delays.
* | min-slaves-to-write: don't accept writes with less than N replicas.antirez2013-05-301-0/+20
| | | | | | | | | | | | 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.
* | Don't stop reading redis.conf if line has no args.antirez2013-05-181-1/+1
|/ | | | | | Should be "continue" and was "return". This fixes issue #1110
* Use memtoll() when parsing the backlog-size option.config-rewriteantirez2013-05-151-1/+1
|
* CONFIG REWRITE: backlog size is a bytes option.antirez2013-05-151-1/+1
|
* CONFIG REWRITE: bindaddr -> bind.antirez2013-05-151-1/+1
|
* CONFIG REWRITE: when rewriting amount of bytes use GB, MB, KB if possible.antirez2013-05-151-7/+31
|
* CONFIG REWRITE: correctly escape the notify-keyspace-events option.antirez2013-05-151-1/+3
|
* CONFIG REWRITE: "active-rehashing" -> "activerehashing".antirez2013-05-151-1/+1
|
* CONFIG REWRITE: fixed typo in AOF fsync policy.antirez2013-05-151-1/+1
|
* CONFIG REWRITE: repl-disable-tcp-nodelay is a boolean option.antirez2013-05-151-1/+1
|
* Added a define for most configuration defaults.antirez2013-05-151-24/+22
| | | | | | | | 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.
* CONFIG REWRITE: Use sane perms when creating redis.conf from scratch.antirez2013-05-141-1/+1
|
* CONFIG REWRITE: actually rewrite the config file, atomically.antirez2013-05-141-3/+63
|
* CONFIG REWRITE: remove orphaned lines.antirez2013-05-141-1/+43
|
* CONFIG REWRITE: strip multiple empty lines.antirez2013-05-141-1/+10
|
* CONFIG REWRITE: support for client-output-buffer-limit.antirez2013-05-131-2/+44
|
* CONFIG REWRITE: support for dir and slaveof.antirez2013-05-131-0/+12
|