- 17 Oct, 2014 1 commit
-
-
antirez authored
-
- 15 Oct, 2014 2 commits
- 14 Oct, 2014 2 commits
- 08 Oct, 2014 1 commit
-
-
antirez authored
We need to remember what is the saving strategy of the current RDB child process, since the configuration may be modified at runtime via CONFIG SET and still we'll need to understand, when the child exists, what to do and for what goal the process was initiated: to create an RDB file on disk or to write stuff directly to slave's sockets.
-
- 07 Oct, 2014 1 commit
-
-
antirez authored
-
- 29 Sep, 2014 1 commit
-
-
zionwu authored
error != success; and 0 != number of bytes written Closes #1806
-
- 18 Aug, 2014 1 commit
-
-
yoav authored
Closes #857
-
- 08 Aug, 2014 1 commit
-
-
Matt Stancliff authored
dictAdd returns DICT_OK, not REDIS_OK. They both have the same underlying values, so it works even though the code is technically wrong. Fixes #1512
-
- 07 Aug, 2014 1 commit
-
-
antirez authored
Also quit ASAP when we are still loading a DB, since care is not needed in this special condition, especially for a SIGINT.
-
- 28 Jul, 2014 1 commit
-
-
Yossi Gottlieb authored
-
- 16 Jul, 2014 1 commit
-
-
antirez authored
-
- 08 Jul, 2014 1 commit
-
-
antirez authored
-
- 01 Jul, 2014 1 commit
-
-
antirez authored
-
- 26 Jun, 2014 1 commit
-
-
antirez authored
-
- 12 May, 2014 2 commits
-
-
Akos Vandra authored
(Note: commit message modified by @antirez for clarity).
-
Akos Vandra authored
-
- 24 Apr, 2014 1 commit
-
-
antirez authored
When we are blocked and a few events a processed from time to time, it is smarter to call the event handler a few times in order to handle the accept, read, write, close cycle of a client in a single pass, otherwise there is too much latency added for clients to receive a reply while the server is busy in some way (for example during the DB loading).
-
- 24 Mar, 2014 1 commit
-
-
Matt Stancliff authored
Previously, the (!fp) would only catch lack of free space under OS X. Linux waits to discover it can't write until it actually writes contents to disk. (fwrite() returns success even if the underlying file has no free space to write into. All the errors only show up at flush/sync/close time.) Fixes antirez/redis#1604
-
- 13 Feb, 2014 1 commit
-
-
antirez authored
server.unixtime and server.mstime are cached less precise timestamps that we use every time we don't need an accurate time representation and a syscall would be too slow for the number of calls we require. Such an example is the initialization and update process of the last interaction time with the client, that is used for timeouts. However rdbLoad() can take some time to load the DB, but at the same time it did not updated the time during DB loading. This resulted in the bug described in issue #1535, where in the replication process the slave loads the DB, creates the redisClient representation of its master, but the timestamp is so old that the master, under certain conditions, is sensed as already "timed out". Thanks to @yoav-steinberg and Redis Labs Inc for the bug report and analysis.
-
- 10 Dec, 2013 2 commits
-
-
antirez authored
The previous fix for false positive timeout detected by master was not complete. There is another blocking stage while loading data for the first synchronization with the master, that is, flushing away the current data from the DB memory. This commit uses the newly introduced dict.c callback in order to make some incremental work (to send "\n" heartbeats to the master) while flushing the old data from memory. It is hard to write a regression test for this issue unfortunately. More support for debugging in the Redis core would be needed in terms of functionalities to simulate a slow DB loading / deletion.
-
antirez authored
-
- 09 Dec, 2013 1 commit
-
-
antirez authored
Starting with Redis 2.8 masters are able to detect timed out slaves, while before 2.8 only slaves were able to detect a timed out master. Now that timeout detection is bi-directional the following problem happens as described "in the field" by issue #1449: 1) Master and slave setup with big dataset. 2) Slave performs the first synchronization, or a full sync after a failed partial resync. 3) Master sends the RDB payload to the slave. 4) Slave loads this payload. 5) Master detects the slave as timed out since does not receive back the REPLCONF ACK acknowledges. Here the problem is that the master has no way to know how much the slave will take to load the RDB file in memory. The obvious solution is to use a greater replication timeout setting, but this is a shame since for the 0.1% of operation time we are forced to use a timeout that is not what is suited for 99.9% of operation time. This commit tries to fix this problem with a solution that is a bit of an hack, but that modifies little of the replication internals, in order to be back ported to 2.8 safely. During the RDB loading time, we send the master newlines to avoid being sensed as timed out. This is the same that the master already does while saving the RDB file to still signal its presence to the slave. The single newline is used because: 1) It can't desync the protocol, as it is only transmitted all or nothing. 2) It can be safely sent while we don't have a client structure for the master or in similar situations just with write(2).
-
- 05 Dec, 2013 1 commit
-
-
antirez authored
-
- 07 Nov, 2013 1 commit
-
-
antirez authored
Thanks to @PhoneLi for reporting.
-
- 27 Aug, 2013 1 commit
-
-
antirez authored
-
- 20 Aug, 2013 1 commit
-
-
antirez authored
-
- 22 Jul, 2013 1 commit
-
-
antirez authored
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.
-
- 16 Jul, 2013 1 commit
-
-
yoav authored
-
- 05 Jul, 2013 1 commit
-
-
antirez authored
-
- 02 Apr, 2013 1 commit
-
-
antirez authored
When a BGSAVE fails, Redis used to flood itself trying to BGSAVE at every next cron call, that is either 10 or 100 times per second depending on configuration and server version. This commit does not allow a new automatic BGSAVE attempt to be performed before a few seconds delay (currently 5). This avoids both the auto-flood problem and filling the disk with logs at a serious rate. The five seconds limit, considering a log entry of 200 bytes, will use less than 4 MB of disk space per day that is reasonable, the sysadmin should notice before of catastrofic events especially since by default Redis will stop serving write queries after the first failed BGSAVE. This fixes issue #849
-
- 12 Mar, 2013 2 commits
-
-
antirez authored
-
Damian Janowski authored
This fixes cases where the RDB file does exist but can't be accessed for any reason. For instance, when the Redis process doesn't have enough permissions on the file.
-
- 27 Feb, 2013 1 commit
-
-
antirez authored
-
- 26 Feb, 2013 1 commit
-
-
antirez authored
This commit allows Redis to set a process name that includes the binding address and the port number in order to make operations simpler. Redis children processes doing AOF rewrites or RDB saving change the name into redis-aof-rewrite and redis-rdb-bgsave respectively. This in general makes harder to kill the wrong process because of an error and makes simpler to identify saving children. This feature was suggested by Arnaud GRANAL in the Redis Google Group, Arnaud also pointed me to the setproctitle.c implementation includeed in this commit. This feature should work on all the Linux, OSX, and all the three major BSD systems.
-
- 19 Jan, 2013 2 commits
-
-
antirez authored
This commit fixes issue #875 that was caused by the following events: 1) There is an active child doing BGSAVE. 2) flushall is called (or any other condition that makes Redis killing the saving child process). 3) An error is sensed by Redis as the child exited with an error (killed by a singal), that stops accepting write commands until a BGSAVE happens to be executed with success. Whitelisting SIGUSR1 and making sure Redis always uses this signal in order to kill its own children fixes the issue.
-
guiquanz authored
-
- 19 Nov, 2012 1 commit
-
-
antirez authored
Finally Redis is able to report the amount of memory used by copy-on-write while saving an RDB or writing an AOF file in background. Note that this information is currently only logged (at NOTICE level) and not shown in INFO because this is less trivial (but surely doable with some minor form of interprocess communication). The reason we can't capture this information on the parent before we call wait3() is that the Linux kernel will release the child memory ASAP, and only retain the minimal state for the process that is useful to report the child termination to the parent. The COW size is obtained by summing all the Private_Dirty fields found in the "smap" file inside the proc filesystem for the process. All this is Linux specific and is not available on other systems.
-
- 08 Nov, 2012 1 commit
-
-
antirez authored
-