- 26 Feb, 2015 1 commit
-
-
antirez authored
Related to issue #2409.
-
- 25 Feb, 2015 1 commit
-
-
antirez authored
This is safe since bufpos is small, inside the range of the local client buffer.
-
- 19 Jan, 2015 1 commit
-
-
Matt Stancliff authored
read() and write() return ssize_t (signed long), not int. For other offsets, we can use the unsigned size_t type instead of a signed offset (since our replication offsets and buffer positions are never negative).
-
- 23 Dec, 2014 1 commit
-
-
Matt Stancliff authored
Refactor a common pattern into one function so we don't end up with copy/paste programming.
-
- 11 Dec, 2014 2 commits
-
-
antirez authored
Specialized single-use function. Not the best match for sds.c btw. Also genClientPeerId() is no longer static: we need symbols.
-
Matt Stancliff authored
Instead of manually checking for strchr(n,':') everywhere, we can use our new centralized IP formatting functions.
-
- 03 Dec, 2014 1 commit
-
-
antirez authored
Track bandwidth used by clients and replication (but diskless replication is not tracked since the actual transfer happens in the child process). This includes a refactoring that makes tracking new instantaneous metrics simpler.
-
- 25 Nov, 2014 1 commit
-
-
antirez authored
zmalloc(0) cauesd to actually trigger a non-zero allocation since with standard libc malloc we have our own zmalloc header for memory tracking, but at the same time the returned pointer is at the end of the block and not in the middle. This triggers a false positive when testing with valgrind. When the inline protocol args count is 0, we now avoid reallocating c->argv, preventing the issue to happen.
-
- 11 Nov, 2014 1 commit
-
-
antirez authored
RDB EOF detection was relying on the final part of the RDB transfer to be a magic 40 bytes EOF marker. However as the slave is put online immediately, and because of sockets timeouts, the replication stream is actually contiguous with the RDB file. This means that to detect the EOF correctly we should either: 1) Scan all the stream searching for the mark. Sucks CPU-wise. 2) Start to send the replication stream only after an acknowledge. 3) Implement a proper chunked encoding. For now solution "2" was picked, so the master does not start to send ASAP the stream of commands in the case of diskless replication. We wait for the first REPLCONF ACK command from the slave, that certifies us that the slave correctly loaded the RDB file and is ready to get more data.
-
- 27 Oct, 2014 1 commit
-
-
antirez authored
-
- 29 Sep, 2014 1 commit
-
-
Gregory Petrosyan authored
Closes #2002
-
- 13 Aug, 2014 1 commit
-
-
antirez authored
-
- 16 Jul, 2014 1 commit
-
-
antirez authored
The code tested many times if a client had active Pub/Sub subscriptions by checking the length of a list and dictionary where the patterns and channels are stored. This was substituted with a client flag called REDIS_PUBSUB that is simpler to test for. Moreover in order to manage this flag some code was refactored. This commit is believed to have no effects in the behavior of the server.
-
- 26 Jun, 2014 2 commits
-
-
antirez authored
-
antirez authored
Technically the problem is due to the client type API that does not return a special value for the master, however fixing it locally in the CLIENT KILL command is better currently because otherwise we would introduce a new output buffer limit class as a side effect.
-
- 24 Jun, 2014 1 commit
-
-
antirez authored
-
- 16 Jun, 2014 5 commits
-
-
antirez authored
Added a new SKIPME option that is true by default, that prevents the client sending the command to be killed, unless SKIPME NO is sent.
-
antirez authored
-
antirez authored
-
antirez authored
This will be used by CLIENT KILL and is also a good way to ensure a given client is still the same across CLIENT LIST calls. The output of CLIENT LIST was modified to include the new ID, but this change is considered to be backward compatible as the API does not imply you can do positional parsing, since each filed as a different name.
-
antirez authored
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.
-
- 28 Apr, 2014 2 commits
- 24 Apr, 2014 3 commits
-
-
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).
-
antirez authored
When the listening sockets readable event is fired, we have the chance to accept multiple clients instead of accepting a single one. This makes Redis more responsive when there is a mass-connect event (for example after the server startup), and in workloads where a connect-disconnect pattern is used often, so that multiple clients are waiting to be accepted continuously. As a side effect, this commit makes the LOADING, BUSY, and similar errors much faster to deliver to the client, making Redis more responsive when there is to return errors to inform the clients that the server is blocked in an not interruptible operation.
-
antirez authored
No actual changes since the value is the same.
-
- 23 Apr, 2014 1 commit
-
-
antirez authored
When we set a protocol error we should return with REDIS_ERR to let the caller know it should stop processing the client. Bug found in a code auditing related to issue #1699.
-
- 06 Mar, 2014 1 commit
-
-
Matt Stancliff authored
anetTcpAccept returns ANET_ERR, not AE_ERR. This isn't a physical error since both ANET_ERR and AE_ERR are -1, but better to be consistent.
-
- 04 Feb, 2014 1 commit
-
-
antirez authored
The API is one of the bulding blocks of CLUSTER FAILOVER command that executes a manual failover in Redis Cluster. However exposed as a command that the user can call directly, it makes much simpler to upgrade a standalone Redis instance using a slave in a safer way. The commands works like that: CLIENT PAUSE <milliesconds> All the clients that are not slaves and not in MONITOR state are paused for the specified number of milliesconds. This means that slaves are normally served in the meantime. At the end of the specified amount of time all the clients are unblocked and will continue operations normally. This command has no effects on the population of the slow log, since clients are not blocked in the middle of operations but only when there is to process new data. Note that while the clients are unblocked, still new commands are accepted and queued in the client buffer, so clients will likely not block while writing to the server while the pause is active.
-
- 25 Jan, 2014 1 commit
-
-
antirez authored
-
- 14 Jan, 2014 1 commit
-
-
antirez authored
A client can enter a special cluster read-only mode using the READONLY command: if the client read from a slave instance after this command, for slots that are actually served by the instance's master, the queries will be processed without redirection, allowing clients to read from slaves (but without any kind fo read-after-write guarantee). The READWRITE command can be used in order to exit the readonly state.
-
- 25 Dec, 2013 1 commit
-
-
antirez authored
-
- 22 Dec, 2013 1 commit
-
-
antirez authored
-
- 20 Dec, 2013 1 commit
-
-
antirez authored
-
- 09 Dec, 2013 2 commits
-
-
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).
-
antirez authored
-
- 08 Dec, 2013 1 commit
-
-
Yossi Gottlieb authored
-
- 05 Dec, 2013 1 commit
-
-
antirez authored
-
- 04 Dec, 2013 1 commit
-
-
antirez authored
-
- 03 Dec, 2013 1 commit
-
-
antirez authored
-