- 31 Dec, 2020 1 commit
-
-
filipe oliveira authored
This Commit pushes forward the observability on overall error statistics and command statistics within redis-server: It extends INFO COMMANDSTATS to have - failed_calls in - so we can keep track of errors that happen from the command itself, broken by command. - rejected_calls - so we can keep track of errors that were triggered outside the commmand processing per se Adds a new section to INFO, named ERRORSTATS that enables keeping track of the different errors that occur within redis ( within processCommand and call ) based on the reply Error Prefix ( The first word after the "-", up to the first space ). This commit also fixes RM_ReplyWithError so that it can be correctly identified as an error reply.
-
- 30 Dec, 2020 1 commit
-
-
sundb authored
Merge pushGenericCommand and pushxGenericCommand to remove redundancy and simplify code.
-
- 27 Dec, 2020 3 commits
-
-
Oran Agra authored
Recently efaf09ee started using addReplyErrorSds in place of addReplySds the later takes ownership of the string but the former did not. This introduced memory leaks when a script returns an error to redis, and also in clusterRedirectClient (two new usages of addReplyErrorSds which was mostly unused till now. This commit chagnes two thanks. 1. change addReplyErrorSds to take ownership of the error string. 2. scripting.c doesn't actually need to use addReplyErrorSds, it's a perfect match for addReplyErrorFormat (replaces newlines with spaces)
-
Oran Agra authored
-
zhaozhao.zz authored
Add CLIENT TRACKINGINFO subcommand Co-authored-by:
Oran Agra <oran@redislabs.com>
-
- 25 Dec, 2020 3 commits
-
-
Itamar Haber authored
Adds: `L/RPOP <key> [count]` Implements no. 2 of the following strategies: 1. Loop on listTypePop - this would result in multiple calls for memory freeing and allocating (see https://github.com/redis/redis/pull/8179/commits/769167a079b0e110d28e4a8099dce1ecd45682b5) 2. Iterate the range to build the reply, then call quickListDelRange - this requires two iterations and **is the current choice** 3. Refactor quicklist to have a pop variant of quickListDelRange - probably optimal but more complex Also: * There's a historical check for NULL after calling listTypePop that was converted to an assert. * This refactors common logic shared between LRANGE and the new form of LPOP/RPOP into addListRangeReply (adds test for b/w compat) * Consequently, it may have made sense to have `LRANGE l -1 -2` and `LRANGE l 9 0` be legit and return a reverse reply. Due to historical reasons that would be, however, a breaking change. * Added minimal comments to existing commands to adhere to the style, make core dev life easier and get commit karma, naturally.
-
Itamar Haber authored
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
- 24 Dec, 2020 22 commits
-
-
xhe authored
Co-authored-by:
Itamar Haber <itamar@redislabs.com>
-
Oran Agra authored
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Co-authored-by:
Oran Agra <oran@redislabs.com>
-
huangzhw authored
This is just a cleanup, no bugs in the real world. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
Oran Agra authored
The commit deals with the syncWithMaster and the ugly state machine in it. It attempts to clean it a bit, but more importantly it uses pipeline for part of the work (rather than 7 round trips, we now have 4). i.e. the connect and PING are separate, then AUTH + 3 REPLCONF in one pipeline, and finally the PSYNC (must be separate since the master has to have an empty output buffer).
-
Oran Agra authored
This is just a refactoring commit. This function was never actually used as a synchronous (do both send or receive), it was always used only ine one of the two modes, which meant it has to take extra arguments that are not relevant for the other. Besides that, a tool that sends a synchronous command, it not something we want in our toolbox (synchronous IO in single threaded app is evil). sendSynchronousCommand was now refactored into separate sending and receiving APIs, and the sending part has two variants, one taking vaargs, and the other taking argc+argv (and an optional length array which means you can use binary sds strings).
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Co-authored-by:
Oran Agra <oran@redislabs.com>
-
xhe authored
Co-authored-by:
Oran Agra <oran@redislabs.com>
-
xhe authored
Co-authored-by:
Oran Agra <oran@redislabs.com>
-
xhe authored
Co-authored-by:
Oran Agra <oran@redislabs.com>
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
Brad Dunbar authored
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
Signed-off-by:
xhe <xw897002528@gmail.com>
-
xhe authored
As discussed in https://github.com/antirez/redis/issues/7364, it is good to have a HELLO command variant, which does not switch the current proto version of a redis server. While `HELLO` will work, it introduced a certain difficulty on parsing options of the command. We will need to offset the index of authentication and setname option by -1. So 0 is marked a special version meaning non-switching. And we do not need to change the code much.
-
Madelyn Olson authored
Cleanup key tracking documentation, always cleanup the tracking table, and free the tracking table in an async manner when applicable.
-
Madelyn Olson authored
Properly throw errors for invalid replication stream and support https://github.com/redis/redis/pull/8217
-
- 23 Dec, 2020 6 commits
-
-
Wang Yuan authored
-
sundb authored
-
Yang Bodong authored
Apparently the "leaks" took reports a different error string about process that's not found in each version of MacOS. This cause the test suite to fail on some OS versions, since some tests terminate the process before looking for leaks. Instead of looking at the error string, we now look at the (documented) exit code.
-
Greg Femec authored
When a database on a 64 bit build grows past 2^31 keys, the underlying hash table expands to 2^32 buckets. After this point, the algorithms for selecting random elements only return elements from half of the available buckets because they use random() which has a range of 0 to 2^31 - 1. This causes problems for eviction policies which use dictGetSomeKeys or dictGetRandomKey. Over time they cause the hash table to become unbalanced because, while new keys are spread out evenly across all buckets, evictions come from only half of the available buckets. Eventually this half of the table starts to run out of keys and it takes longer and longer to find candidates for eviction. This continues until no more evictions can happen. This solution addresses this by using a 64 bit PRNG instead of libc random(). Co-authored-by:
Greg Femec <gfemec@google.com>
-
Felix Bünemann authored
Homebrew for darwin-arm64 uses /opt/homebrew instead of /usr/local as the prefix, so that it can coexist with darwin-x86_64 using Rosetta 2.
-
- 22 Dec, 2020 4 commits
-
-
Wen Hui authored
-
Meir Shpilraien (Spielrein) authored
Turns out that when the fork child crashes, the crash log was deleting the pidfile from the disk (although the parent is still running. Now we set the pidfile of the fork process to NULL so the fork process will never deletes it.
-
Yossi Gottlieb authored
Normally IO threads should simply read data from the socket into the buffer and attempt to parse it. If a protocol error is detected, a reply is generated which may result with installing a write handler which is not thread safe. This fix delays that until the client is processed back in the main thread. Fixes #8220
-
Oran Agra authored
Remove read-only flag from non-keyspace cmds, different approach for EXEC to propagate MULTI (#8216) In the distant history there was only the read flag for commands, and whatever command that didn't have the read flag was a write one. Then we added the write flag, but some portions of the code still used !read Also some commands that don't work on the keyspace at all, still have the read flag. Changes in this commit: 1. remove the read-only flag from TIME, ECHO, ROLE and LASTSAVE 2. EXEC command used to decides if it should propagate a MULTI by looking at the command flags (!read & !admin). When i was about to change it to look at the write flag instead, i realized that this would cause it not to propagate a MULTI for PUBLISH, EVAL, and SCRIPT, all 3 are not marked as either a read command or a write one (as they should), but all 3 are calling forceCommandPropagation. So instead of introducing a new flag to denote a command that "writes" but not into the keyspace, and still needs propagation, i decided to rely on the forceCommandPropagation, and just fix the code to propagate MULTI when needed rather than depending on the command flags at all. The implication of my change then is that now it won't decide to propagate MULTI when it sees one of these: SELECT, PING, INFO, COMMAND, TIME and other commands which are neither read nor write. 3. Changing getNodeByQuery and clusterRedirectBlockedClientIfNeeded in cluster.c to look at !write rather than read flag. This should have no implications, since these code paths are only reachable for commands which access keys, and these are always marked as either read or write. This commit improve MULTI propagation tests, for modules and a bunch of other special cases, all of which used to pass already before that commit. the only one that test change that uncovered a change of behavior is the one that DELs a non-existing key, it used to propagate an empty multi-exec block, and no longer does.
-