- 14 Sep, 2021 1 commit
-
-
filipe oliveira authored
- Add `-u <uri>` command line option to support `redis://` URI scheme. - included server connection information object (`struct cliConnInfo`), used to describe an ip:port pair, db num user input, and user:pass to avoid a large number of function arguments. - Using sds on connection info strings for redis-benchmark/redis-cli Co-authored-by:
yoav-steinberg <yoav@monfort.co.il>
-
- 22 Aug, 2021 1 commit
-
-
Viktor Söderqvist authored
Also make sure function can't return NULL by another assert.
-
- 10 Aug, 2021 1 commit
-
-
Huang Zhw authored
Abort cli blocking modes with SIGINT without exiting the cli. Co-authored-by:
charsyam <charsyam@gmail.com>
-
- 05 Aug, 2021 1 commit
-
-
yoav-steinberg authored
Reduce dict struct memory overhead on 64bit dict size goes down from jemalloc's 96 byte bin to its 56 byte bin. summary of changes: - Remove `privdata` from callbacks and dict creation. (this affects many files, see "Interface change" below). - Meld `dictht` struct into the `dict` struct to eliminate struct padding. (this affects just dict.c and defrag.c) - Eliminate the `sizemask` field, can be calculated from size when needed. - Convert the `size` field into `size_exp` (exponent), utilizes one byte instead of 8. Interface change: pass dict pointer to dict type call back functions. This is instead of passing the removed privdata field. In the future if we'd like to have private data in the callbacks we can extract it from the dict type. We can extend dictType to include a custom dict struct allocator and use it to allocate more data at the end of the dict struct. This data can then be used to store private data later acccessed by the callbacks.
-
- 03 Aug, 2021 1 commit
-
-
filipe oliveira authored
Add the -x option (Read last argument from STDIN) on redis-benchmark. Other changes: To be able to use the code from redis-cli some helper methods were moved to cli_common.(h|c) Co-authored-by:
Oran Agra <oran@redislabs.com>
-
- 02 Aug, 2021 1 commit
-
-
Huang Zhw authored
When redis-cli received ASK, it used string matching wrong and didn't handle it. When we access a slot which is in migrating state, it maybe return ASK. After redirect to the new node, we need send ASKING command before retry the command. In this PR after redis-cli receives ASK, we send a ASKING command before send the origin command after reconnecting. Other changes: * Make redis-cli -u and -c (unix socket and cluster mode) incompatible with one another. * When send command fails, we avoid the 2nd reconnect retry and just print the error info. Users will decide how to do next. See #9277. * Add a test faking two redis nodes in TCL to just send ASK and OK in redis protocol to test ASK behavior. Co-authored-by:
Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by:
Oran Agra <oran@redislabs.com>
-
- 15 Jul, 2021 1 commit
-
-
ZEEKLING authored
-
- 07 Jul, 2021 1 commit
-
-
Mikhail Fesenko authored
Direct redis-cli repl prints to stderr, because --rdb can print to stdout. fflush stdout after responses (#9136) 1. redis-cli can output --rdb data to stdout but redis-cli also write some messages to stdout which will mess up the rdb. 2. Make redis-cli flush stdout when printing a reply This was needed in order to fix a hung in redis-cli test that uses --replica. Note that printf does flush when there's a newline, but fwrite does not. 3. fix the redis-cli --replica test which used to pass previously because it didn't really care what it read, and because redis-cli used printf to print these other things to stdout. 4. improve redis-cli --replica test to run with both diskless and disk-based. Co-authored-by:
Oran Agra <oran@redislabs.com> Co-authored-by:
Viktor Söderqvist <viktor@zuiderkwast.se>
-
- 05 Jul, 2021 1 commit
-
-
uriyage authored
-
- 30 Jun, 2021 2 commits
-
-
Mikhail Fesenko authored
A change in redis 6.2 caused redis-cli --rdb that's directed to stdout to fail because fsync fails. This commit avoids doing ftruncate (fails with a warning) and fsync (fails with an error) when the output file is `-`, and adds the missing documentation that `-` means stdout. Co-authored-by:
Oran Agra <oran@redislabs.com> Co-authored-by:
Wang Yuan <wangyuancode@163.com>
-
Huang Zhw authored
If user executes redis-cli --help, the content should be output to stdout and exits with 0.
-
- 21 Jun, 2021 1 commit
-
-
Maxim Galushka authored
Fixes #6792. Added support of REDIS_REPLY_SET in raw and csv output of `./redis-cli` Test: run commands to test: ./redis-cli -3 --csv COMMAND ./redis-cli -3 --raw COMMAND Now they are returning resuts, were failing with: "Unknown reply type: 10" before the change.
-
- 10 Jun, 2021 1 commit
-
-
Binbin authored
This PR adds a spell checker CI action that will fail future PRs if they introduce typos and spelling mistakes. This spell checker is based on blacklist of common spelling mistakes, so it will not catch everything, but at least it is also unlikely to cause false positives. Besides that, the PR also fixes many spelling mistakes and types, not all are a result of the spell checker we use. Here's a summary of other changes: 1. Scanned the entire source code and fixes all sorts of typos and spelling mistakes (including missing or extra spaces). 2. Outdated function / variable / argument names in comments 3. Fix outdated keyspace masks error log when we check `config.notify-keyspace-events` in loadServerConfigFromString. 4. Trim the white space at the end of line in `module.c`. Check: https://github.com/redis/redis/pull/7751 5. Some outdated https link URLs. 6. Fix some outdated comment. Such as: - In README: about the rdb, we used to said create a `thread`, change to `process` - dbRandomKey function coment (about the dictGetRandomKey, change to dictGetFairRandomKey) - notifyKeyspaceEvent fucntion comment (add type arg) - Some others minor fix in comment (Most of them are incorrectly quoted by variable names) 7. Modified the error log so that users can easily distinguish between TCP and TLS in `changeBindAddr`
-
- 08 Jun, 2021 2 commits
-
-
ikeberlein authored
redis-cli is grep friendly for all commands but SUBSCRIBE/PSUBSCRIBE. it is unable to process output from these commands line by line piped to another program because of output buffering. to overcome this situation I propose to flush stdout each time when it is written with reply from these commands the same way it is already done for all other commands.
-
Huang Zhw authored
* clusterManagerAddSlots check argv_idx error. * clusterManagerLoadInfoFromNode remove unused param opts. * redis-cli node->ip may be an sds or a c string. Using %s to format is always right, %S may be wrong. * In clusterManagerFixOpenSlot clusterManagerBumpEpoch call is redundant, because it is already called in clusterManagerSetSlotOwner. * redis-cli cluster help add more commands in help messages.
-
- 02 Jun, 2021 1 commit
-
-
Huang Zhw authored
In clusterManagerCommandImport strcat was used to concat COPY and REPLACE, the space maybe not enough. If we use --cluster-replace but not --cluster-copy, the MIGRATE command contained COPY instead of REPLACE.
-
- 19 May, 2021 1 commit
-
-
Huang Zhw authored
which make interleaved_len bigger and may access array out of range.
-
- 18 May, 2021 2 commits
-
-
Huang Zhw authored
Currently in redis-cli only AUTH and ACL SETUSER bypass history file. We add CONFIG SET masterauth/masteruser/requirepass, HELLO with AUTH, MIGRATE with AUTH or AUTH2 to bypass history file too. The drawback is HELLO and MIGRATE's code is a mess. Someday if we change these commands, we have to change here too.
-
Binbin authored
There's an infinite loop when redis-cli fails to connect in cluster mode. This commit adds a 1 second sleep to prevent flooding the console with errors. It also adds a specific error print in a few places that could have error without printing anything. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
- 17 May, 2021 1 commit
-
-
Huang Zhw authored
There are two bugs in redis-cli hints: * The hints of commands with subcommands lack first params. * When search matching command of currently input, we should find the command with longest matching prefix. If not COMMAND INFO will always match COMMAND and display no hints.
-
- 06 May, 2021 1 commit
-
-
Huang Zhw authored
when SELECT fails, we should reset dbnum to 0, so the prompt will not display incorrectly. Additionally when SELECT and HELLO fail, we output message to inform it. Add config.input_dbnum which means the dbnum about to select. And config.dbnum means currently selected dbnum. When users succeed to select db, config.dbnum and config.input_dbnum will be the same. When users select db failed, config.input_dbnum will be kept. Next time if users auth success, config.input_dbnum will be automatically selected. When reconnect, we should select the origin dbnum. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
- 04 May, 2021 1 commit
-
-
Binbin authored
-
- 03 May, 2021 1 commit
-
-
Oran Agra authored
-
- 29 Apr, 2021 1 commit
-
-
Huang Zhw authored
prefix args not all args. So when we help commands with subcommands, all subcommands will be output.
-
- 28 Apr, 2021 1 commit
-
-
Binbin authored
When redis-cli was used with both -c (cluster) and -s (unix socket), it would have kept trying to use that unix socket, even if it got redirected by the cluster (resulting in an infinite loop).
-
- 26 Apr, 2021 1 commit
-
-
Andy Pan authored
Most of the ae.c backends didn't explicitly handle errors, and instead ignored all errors and did an implicit retry. This is desired for EAGAIN and EINTER, but in case of other systematic errors, we prefer to fail and log the error we got rather than get into a busy loop.
-
- 21 Apr, 2021 1 commit
-
-
Seunghyun Lee authored
-
- 05 Apr, 2021 1 commit
-
-
Huang Zhw authored
When DBSIZE failed (e.g. on AUTH error), the printed error didn't reflect the reason.
-
- 01 Apr, 2021 1 commit
-
-
Wang Yuan authored
In `aof.c`, we call fsync when stop aof, and now print a log to let user know that if fail. In `cluster.c`, we now return error, the calling function already handles these write errors. In `redis-cli.c`, users hope to save rdb, we now print a message if fsync failed. In `rio.c`, we now treat fsync errors like we do for write errors. In `server.c`, we try to fsync aof file when shutdown redis, we only can print one log if fail. In `bio.c`, if failing to fsync aof file, we will set `aof_bio_fsync_status` to error , and reject writing just like last writing aof error, moreover also set INFO command field `aof_last_write_status` to error.
-
- 28 Mar, 2021 1 commit
-
-
Steve authored
-
- 08 Mar, 2021 1 commit
-
-
Pavlo Yatsukhnenko authored
The result of `sdscatprintf` is doubled when using argument twice.
-
- 04 Mar, 2021 1 commit
-
-
Yossi Gottlieb authored
* The `redis-cli --scan` output should honor output mode (set explicitly or implicitly), and quote key names when not in raw mode. * Technically this is a breaking change, but it should be very minor since raw mode is by default on for non-tty output. * It should only affect TTY output (human users) or non-tty output if `--no-raw` is specified. * Added `--quoted-input` option to treat all arguments as potentially quoted strings. * Added `--quoted-pattern` option to accept a potentially quoted pattern. Unquoting is applied to potentially quoted input only if single or double quotes are used. Fixes #8561, #8563
-
- 28 Feb, 2021 1 commit
-
-
Pavlo Yatsukhnenko authored
This could happen on an invalid use, when trying to create a cluster with a single node and provide it's address 3 time to satisfy redis-cli requirements.
-
- 25 Feb, 2021 1 commit
-
-
Wen Hui authored
After reconnect, the prompt was showing the db ID and multi state of the previous connection.
-
- 09 Feb, 2021 1 commit
-
-
WuYunlong authored
1. Rename 18-cluster-nodes-slots.tcl to 19-cluster-nodes-slots.tcl. it was conflicting with another test prefixed by 18 2. Release memory on exit in redis-cli.c. 3. Fix freeConvertedSds indentation.
-
- 07 Feb, 2021 1 commit
-
-
Yossi Gottlieb authored
Disable certificate validation, making it possible to connect to servers without configuring full trust chain. The use of this option is insecure and makes the connection vulnerable to man in the middle attacks.
-
- 27 Jan, 2021 1 commit
-
-
Wang Yuan authored
In some scenarios, such as remote backup, we only want to get remote redis server db snapshot. Currently, redis-cli acts as a replica and sends SYNC to redis, but redis still accumulates replication buffer in the replica client output buffer, that may result in using vast memory, or failing to transfer RDB because of client-output-buffer-limit. In this commit, we add 'replconf rdb-only 0|1', redis doesn't send incremental replication buffer to them if they send 'replconf rdb-only 1', so we can reduce used memory and improve success of getting RDB.
-
- 13 Jan, 2021 1 commit
-
-
houzj.fnst authored
Remove several checks that always evaluate to true.
-
- 03 Jan, 2021 1 commit
-
-
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.
-
- 23 Dec, 2020 1 commit
-
-
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>
-