- 05 Jan, 2021 1 commit
-
-
Oran Agra authored
When a Lua script returns a map to redis (a feature which was added in redis 6 together with RESP3), it would have returned the value first and the key second. If the client was using RESP2, it was getting them out of order, and if the client was in RESP3, it was getting a map of value => key. This was happening regardless of the Lua script using redis.setresp(3) or not. This also affects a case where the script was returning a map which it got from from redis by doing something like: redis.setresp(3); return redis.call() This fix is a breaking change for redis 6.0 users who happened to rely on the wrong order (either ones that used redis.setresp(3), or ones that returned a map explicitly). This commit also includes other two changes in the tests: 1. The test suite now handles RESP3 maps as dicts rather than nested lists 2. Remove some redundant (duplicate) tests from tracking.tcl
-
- 04 Jan, 2021 5 commits
-
-
Oran Agra authored
-
Itamar Haber authored
* man-like consistent long formatting * Uppercases commands, subcommands and options * Adds 'HELP' to HELP for all * Lexicographical order * Uses value notation and other .md likeness * Moves const char *help to top * Keeps it under 80 chars * Misc help typos, consistent conjuctioning (i.e return and not returns) * Uses addReplySubcommandSyntaxError(c) all over Signed-off-by:
Itamar Haber <itamar@redislabs.com>
-
Yang Bodong authored
This PR not only fixes the problem that swapdb does not make the transaction fail, but also optimizes the FLUSHALL and FLUSHDB command to set the CLIENT_DIRTY_CAS flag to avoid unnecessary traversal of clients. FLUSHDB was changed to first iterate on all watched keys, and then on the clients watching each key. Instead of iterating though all clients, and for each iterate on watched keys. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
Meir Shpilraien (Spielrein) authored
If AOF file contains a long Lua script that timed out, then the `evalCommand` calls `blockingOperationEnds` which sets `server.blocked_last_cron` to 0. later on, the AOF `whileBlockedCron` function asserts that this value is not 0. The fix allows nesting call to `blockingOperationStarts` and `blockingOperationEnds`. The issue was first introduce in this commit: 9ef8d2f6 (Redis 6.2 RC1)
-
huangzhw authored
This is a recent problem, introduced by 74717438 (redis 6.0) The implications are: The sole difference between LookupKeyRead and LookupKeyWrite is for command executed on a replica, which are not received from its master client. (for the master, and for the master client on the replica, these two functions behave the same)! Since SORT is a write command, this bug only implicates a writable-replica. And these are its implications: - SORT STORE will behave as it did before the above mentioned commit (like before redis 6.0). on a writable-replica an already logically expired the key would have appeared missing. (store dest key would be deleted, instead of being populated with the data from the already logically expired key) - SORT (the non store variant, which in theory could have been executed on read-only-replica if it weren't for the write flag), will (in redis 6.0) have a new bug and return the data from the already logically expired key instead of empty response.
-
- 03 Jan, 2021 4 commits
-
-
kukey authored
New command flags similar to what SADD already has. Co-authored-by:
huangwei03 <huangwei03@kuaishou.com> Co-authored-by:
Itamar Haber <itamar@redislabs.com> Co-authored-by:
Oran Agra <oran@redislabs.com>
-
Oran Agra authored
-
Oran Agra authored
In #7726 (part of 6.2), we added a mechanism for whileBlockedCron, this mechanism has an assertion to make sure the timestamp in whileBlockedCron was always set correctly before the blocking operation starts. I now found (thanks to our CI) two bugs in that area: 1) CONFIG RESETSTAT (if it was allowed during loading) would have cleared this var 2) the call stopLoading (which calls whileBlockedCron) was made too early, while the rio is still in use, in which case the update_cksum (rdbLoadProgressCallback) may still be called and whileBlockedCron can assert.
-
Oran Agra authored
getRDB is "designed" to work in two modes: one for redis-cli --rdb and one for redis-cli --cluster backup. in the later case it uses the hiredis connection from the cluster nodes and it used to free it without nullifying the context, so a later attempt to free the context would crash. I suppose the reason it seems to want to free the hiredis context ASAP is that it wants to disconnect the replica link, so that replication buffers will not be accumulated.
-
- 02 Jan, 2021 1 commit
-
-
Oran Agra authored
-
- 01 Jan, 2021 1 commit
-
-
Oran Agra authored
The crash log attempts to print the current client info, and when it does that it attempts to check if the first argument happens to be a key but it did so for commands with no arguments too, which caused the crash log to crash half way and not reach its end.
-
- 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 20 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.
-