Commit Graph

10281 Commits

Author SHA1 Message Date
Oran Agra
7b48de68ce
Remove useless - from help.h on commands with no arguments (#8939)
As far as i can tell it shows up in redis-cli in both HELP, e.g.
`help client list`, and also in the command completion tips, but it is
unclear what it was needed for.
It exists since the very first commit that added this mechanism.
2021-05-18 17:13:10 +03:00
Oran Agra
cf41c0b5ff
fix race in config rewrite test (#8960) 2021-05-18 17:10:06 +03:00
Huang Zhw
55fa91ae53
redis-cli: some commands should bypass history file. (#8895)
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.
2021-05-18 10:30:24 +03:00
Binbin
8351a10b95
redis-cli: Sleep for a while in each cliConnect when we got connect error in cluster mode. (#8884)
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>
2021-05-18 10:09:45 +03:00
zhaozhao.zz
0ecc814c81
AOF: remove memmove in aofChildWriteDiffData and record the latency (#5362)
Improve performance by avoiding inefficiencies in the parent process during AOFRW.
* AOF: record the latency of aofChildWriteDiffData
* AOF: avoid memmove in aofChildWriteDiffData
2021-05-17 16:57:17 +03:00
Oran Agra
fbc0e2b834
Reset lazyfreed_objects info field with RESETSTAT, test for stream lazyfree (#8934)
And also add tests to cover lazy free of streams with various types of
metadata (see #8932)
2021-05-17 16:54:37 +03:00
Huang Zhw
8827aae83b
redis-cli: fix bugs in hints of commands with subcommands. (#8914)
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.
2021-05-17 16:52:40 +03:00
patpatbear
46d9f31e94
sinterstore: add missing keyspace del event when any source set not exists. (#8949)
this patch fixes sinterstore by add missing keyspace del event when any source set not exists.

Co-authored-by: srzhao <srzhao@sysnew.com>
2021-05-15 15:43:09 +03:00
Madelyn Olson
df4d916007
Moved security bugs and vulnerability policy to SECURITY.md (#8938)
Moved security bugs and vulnerability policy to SECURITY.MD and extended security policy.

Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
2021-05-13 21:16:27 -07:00
Raghav Muddur
31edc22ecc
EVALSHA_RO and EVAL_RO Commands (#8820)
* EVALSHA_RO and EVAL_RO Commands

Added new readonly versions of EVAL
and EVALSHA.
2021-05-12 21:07:34 -07:00
George Anderson Guimarães
e01c92a5ef
improve error handing in anetFDToString to avoid returning successfully with garbage. (#8678)
Check for errors in inet_ntop and snprintf rather than ignore them
and return success (with garbage output).
The check for ip_len == 0 seems like dead code, removed.
2021-05-11 14:27:08 +03:00
Huang Zhw
8526e04e7b
cluster process publish message only for known nodes. (#8856) 2021-05-10 08:29:11 -07:00
Oran Agra
97108845e2
Fix crash unlinking a stream with groups rax and no groups (#8932)
When estimating the effort for unlink, we try to compute the effort of
the first group and extrapolate.
If there's a groups rax that's empty, there'a an assertion.

reproduce:
xadd s * a b
xgroup create s bla $
xgroup destroy s bla
unlink s
2021-05-10 17:08:43 +03:00
Binbin
fb66c1b58c
Fix typos, and consistent function argument names in quicklist (#8915)
Also fixes a chance for compilation error if REDIS_TEST_VERBOSE would be used.
2021-05-10 14:02:25 +03:00
Huang Zhw
4d4db9797f
Cleanup: sentinel config, latency extra time() (#8810) 2021-05-09 18:45:45 +03:00
Oran Agra
d32fd31588
redis-benchmark bad check for NOAUTH and NOPERM (#8931)
also, print errors to stderr rather than stdout
2021-05-09 18:19:25 +03:00
Binbin
56976ffb49
Use function instead of code in dict.c and delete dead code in dict.h (#8878)
Use function instead of code in dict.c and delete dead code in dict.h
2021-05-09 15:21:18 +03:00
Binbin
57b94eacaa
Typo: Change port_get to port_getn in aeApiPoll panic message. (#8920) 2021-05-07 15:34:35 +03:00
Huang Zhw
6b47598998
redis-cli when SELECT fails, we should reset dbnum to 0 (#8898)
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>
2021-05-06 18:34:45 +03:00
Oran Agra
4d1094e8be
fix redis-benchmark to ignore unsupported configs (#8916)
Redis Enterprise supports the CONFIG GET command, but it replies with am
empty array since the save and appendonly configs are not supported.
before this fix redis-benchmark would segfault for trying to access the
error string on an array type reply.
see #8869
2021-05-06 17:45:49 +03:00
Wang Yuan
81e2d7272b
Fix wrong COW memory in log (#8917)
Always 0 MB of memory used by copy-on-write, introduced in #8645.
2021-05-06 10:52:11 +03:00
Zerong Yao
bcc519fa7c
remove duplicate fd lookup in aeProcessEvents (#3886)
Minor code cleanup.
2021-05-05 15:12:53 +03:00
Binbin
a62801eb53
redis-cli: Fix integer overflow in intrinsic-latency (#8907) 2021-05-04 20:21:14 +03:00
yoav-steinberg
152fce5e2c
Enforce client output buffer soft limit when no traffic. (#8833)
When client breached the output buffer soft limit but then went idle,
we didn't disconnect on soft limit timeout, now we do.
Note this also resolves some sporadic test failures in due to Linux
buffering data which caused tests to fail if during the test we went
back under the soft COB limit.

Co-authored-by: Oran Agra <oran@redislabs.com>
Co-authored-by: sundb <sundbcn@gmail.com>
2021-05-04 13:45:08 +03:00
Oran Agra
fd7d51c353 Resolve nonsense static analysis warnings 2021-05-03 18:59:47 +03:00
Oran Agra
f0c5f920d0 Fix integer overflow in STRALGO LCS (CVE-2021-29477)
An integer overflow bug in Redis version 6.0 or newer could be exploited using
the STRALGO LCS command to corrupt the heap and potentially result with remote
code execution.
2021-05-03 18:59:47 +03:00
Oran Agra
29900d4e6b Fix integer overflow in intset (CVE-2021-29478)
An integer overflow bug in Redis 6.2 could be exploited to corrupt the heap and
potentially result with remote code execution.

The vulnerability involves changing the default set-max-intset-entries
configuration value, creating a large set key that consists of integer values
and using the COPY command to duplicate it.

The integer overflow bug exists in all versions of Redis starting with 2.6,
where it could result with a corrupted RDB or DUMP payload, but not exploited
through COPY (which did not exist before 6.2).
2021-05-03 18:59:47 +03:00
Wen Hui
611e11734c
Add missing NOLOOP tracking flag in help (#8892) 2021-05-03 17:13:47 +03:00
Uri Shachar
f3ee2d98af
Fix typos in comments and improve readability (#8899) 2021-05-03 15:18:52 +03:00
Binbin
ccb76e5688
Free value if dup succeed but listAddNodeTail failed. (#8901)
This fix is in dead code.
see redisOutOfMemoryHandler an allocation can't fail.
but maybe someone will copy this code to a different project
some day, better have this fixed

Co-authored-by: Oran Agra <oran@redislabs.com>
2021-05-03 13:39:07 +03:00
sundb
5100ef9f82
Fix memory leak in moduleDefragGlobals (#8853) 2021-05-02 10:32:57 +03:00
Huang Zhw
0b1b9edb28
Improve redis-cli help. When help command, we only match command (#8879)
prefix args not all args. So when we help commands with subcommands,
all subcommands will be output.
2021-04-29 12:08:52 +03:00
Binbin
9c927e9de9
Delete some unimplemented prototype. (#8882)
Remove forward declarations from header files to functions that do not exist.
2021-04-29 08:25:10 +03:00
Binbin
1eff8564c7
redis-benchmark: Add zfree(data) and fix lrange size / text mismatch (#8872)
missing zfree(data) in redis-benchmark.

And also correct the wrong size in lrange.
the text mentioned 500, but size was 450, changed to 500
2021-04-28 16:03:24 +03:00
Binbin
416f277339
redis-cli: Do not use hostsocket when we got redirected in cluster mode (#8870)
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).
2021-04-28 13:19:55 +03:00
filipe oliveira
ef6f902372
redis-benchmark: Error/Warning handling updates. (#8869)
- Immediately exit on errors that are not related to topology updates.
- Deprecates the `-e` option ( retro compatible ) and warns that we now
  exit immediately on errors that are not related to topology updates.
- Fixed wrongfully failing on config fetch error (warning only). This only affects RE.

Bottom line:
- MOVED and ASK errors will not show any warning (unlike the throttled error with `-e` before).
- CLUSTERDOWN still prints an error unconditionally and sleeps for 1 second.
- other errors are fatal.
2021-04-28 09:51:07 +03:00
Huang Zhw
2b22fffc78
Fix potential CONFIG SET bind test failure. (#8875)
Use an invalid IP address to trigger CONFIG SET bind failure, instead of DNS which is not guaranteed to always fail.
2021-04-27 18:02:23 +03:00
yoav-steinberg
2e88b06396
Bump freebsd-vm version to fix CI failures (#8876)
Specifically we had issues with NTP sync failure which was resolved here: 457af73456
2021-04-27 16:22:22 +03:00
Andy Pan
3d56be3788
Fixes some typos (#8874) 2021-04-27 14:25:02 +03:00
avimredis
93e7750699
GEOSEARCHSTORE: removed unsupported args from comment (#8873) 2021-04-27 10:37:18 +03:00
Oran Agra
46f4ebbe84
Prevent replicas from sending commands that interact with keyspace (#8868)
This solves an issue reported in #8712 in which a replica would bypass
the client write pause check and cause an assertion due to executing a
write command during failover.

The fact is that we don't expect replicas to execute any command other
than maybe REPLCONF and PING, etc. but matching against the ADMIN
command flag is insufficient, so instead i just block keyspace access
for now.
2021-04-27 08:15:10 +03:00
sundb
bcf1b384e3
Remove dead code from lpStringToInt64() (#8863) 2021-04-26 16:40:58 -07:00
avimredis
4bfcf4654a
Fix error reply of GEOSEARCHSTORE unsupported args (#8865)
When [WITHCOORD] [WITHDIST] [WITHHASH] are used, the error mentioned GEORADIUS command
2021-04-26 21:11:38 +03:00
Yossi Gottlieb
ebfbb09109
Remove redundant -latomic on arm64. (#8867) 2021-04-26 18:43:57 +03:00
sundb
074e28a46e
Simplify rax free for RM_FreeServerInfo (#8866) 2021-04-26 16:30:34 +03:00
Andy Pan
a8b6596d23
Fail fast when systemic error occurs in poll (#8749)
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.
2021-04-26 15:52:06 +03:00
Guy Korland
d1ca1e665f
Add codeql static analysis in PR CI (#8854) 2021-04-26 12:55:54 +03:00
Huang Zhw
20735a5354
Distinguish between pong and meet messages in clusterProcessPacket log (#8848)
Fix clusterProcessPacket log don't distinguish between pong and meet.
Additionally log node name instead of pointer and delete a redundant
log.
2021-04-25 19:58:54 -07:00
Huang Zhw
72aa376237
Fix comments and typos in sentinel.c. (#8801) 2021-04-25 15:50:15 +03:00
Yang Bodong
8423b77f14
When the password is wrong, redis-benchmark should exit (#8855) 2021-04-25 14:00:35 +03:00