10323 Commits

Author SHA1 Message Date
Yossi Gottlieb
2428b64d5a Clarify RM_BlockClient() error condition. (#6093)
(cherry picked from commit 342d9a642f2d21fe906bf1be24d841fa6f314601)
2020-09-01 09:27:58 +03:00
namtsui
3d98418f4a Avoid an out-of-bounds read in the redis-sentinel (#7443)
The Redis sentinel would crash with a segfault after a few minutes
because it tried to read from a page without read permissions. Check up
front whether the sds is long enough to contain redis:slave or
redis:master before memcmp() as is done everywhere else in
sentinelRefreshInstanceInfo().

Bug report and commit message from Theo Buehler. Fix from Nam Nguyen.

Co-authored-by: Nam Nguyen <namn@berkeley.edu>
(cherry picked from commit 8c03eb90da3951ed92d8d2729fc6d2ce4feb9e45)
2020-09-01 09:27:58 +03:00
Wen Hui
46686af7f5 Add SignalModifiedKey hook in XGROUP CREATE with MKSTREAM option (#7562)
(cherry picked from commit 0a2b019b79831e6c593c2de943af61ceef4327e1)
2020-09-01 09:27:58 +03:00
Wen Hui
9f873c6c2a fix leak in error handling of debug populate command (#7062)
valsize was not modified during the for loop below instead of getting from c->argv[4], therefore there is no need to put inside the for loop.. Moreover, putting the check outside loop will also avoid memory leaking, decrRefCount(key) should be called in the original code if we put the check in for loop

(cherry picked from commit 2afa308306fc641204f10a2bbe2fe35e28b6d259)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb
2e6563cdcf Fix TLS cluster tests. (#7578)
Fix consistency test added in 0c9916d00 without considering TLS
redis-cli configuration.

(cherry picked from commit 675b00c7e0b7d68bafa11fcc7f66a394c3c3cd36)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb
ebdfa71584 TLS: Propagate and handle SSL_new() failures. (#7576)
The connection API may create an accepted connection object in an error
state, and callers are expected to check it before attempting to use it.

Co-authored-by: mrpre <mrpre@163.com>
(cherry picked from commit bc450c5f63d39d0f0b8c97fa91d15bb8d688b86d)
2020-09-01 09:27:58 +03:00
Oran Agra
10a8407a4f Fix failing tests due to issues with wait_for_log_message (#7572)
- the test now waits for specific set of log messages rather than wait for
  timeout looking for just one message.
- we don't wanna sample the current length of the log after an action, due
  to a race, we need to start the search from the line number of the last
  message we where waiting for.
- when attempting to trigger a full sync, use multi-exec to avoid a race
  where the replica manages to re-connect before we completed the set of
  actions that should force a full sync.
- fix verify_log_message which was broken and unused

(cherry picked from commit 06aaeabaea9d9b248e8a790dde352cd14d66628a)
2020-09-01 09:27:58 +03:00
Jiayuan Chen
7b2af98316 Add optional tls verification (#7502)
Adds an `optional` value to the previously boolean `tls-auth-clients` configuration keyword.

Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
(cherry picked from commit 198770751fdc4c46eb4971ead9b5787fd6ce39fd)
2020-09-01 09:27:58 +03:00
Oran Agra
d2ef4c0347 Daily github action: run cluster and sentinel tests with tls (#7575)
(cherry picked from commit 62e84b42d25a716411b108290f2caaff4b837488)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb
ba559dc903 TLS: support cluster/replication without tls-port.
Initialize and configure OpenSSL even when tls-port is not used, because
we may still have tls-cluster or tls-replication.

Also, make sure to reconfigure OpenSSL when these parameters are changed
as TLS could have been enabled for the first time.

(cherry picked from commit b76a93c362091daafd8a8d15a45d527b7437d013)
2020-09-01 09:27:58 +03:00
grishaf
53f36dc5b6 Fix prepareForShutdown function declaration (#7566)
(cherry picked from commit f8751d03ba9635064c89844d5915c2ec2dcdc827)
2020-09-01 09:27:58 +03:00
Oran Agra
558a343b3c Stabilize bgsave test that sometimes fails with valgrind (#7559)
on ci.redis.io the test fails a lot, reporting that bgsave didn't end.
increaseing the timeout we wait for that bgsave to get aborted.
in addition to that, i also verify that it indeed got aborted by
checking that the save counter wasn't reset.

add another test to verify that a successful bgsave indeed resets the
change counter.

(cherry picked from commit 49d4aebce0a0b94cd2b302d276be95d1a1ce8610)
2020-09-01 09:27:58 +03:00
Madelyn Olson
32d225c644 Properly reset errno for rdbLoad (#7542)
(cherry picked from commit 9615c7480de53c920baadf6279b527b60de8f0d4)
2020-09-01 09:27:58 +03:00
Oran Agra
2b45c88a6a testsuite may leave servers alive on error (#7549)
in cases where you have
test name {
  start_server {
    start_server {
      assert
    }
  }
}

the exception will be thrown to the test proc, and the servers are
supposed to be killed on the way out. but it seems there was always a
bug of not cleaning the server stack, and recently (#7404) we started
relying on that stack in order to kill them, so with that bug sometimes
we would have tried to kill the same server twice, and leave one alive.

luckly, in most cases the pattern is:
start_server {
  test name {
  }
}

(cherry picked from commit bb170fa06e5909dd816b6530121952d57c8209a0)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb
6d80011e73 Tests: drop TCL 8.6 dependency. (#7548)
This re-implements the redis-cli --pipe test so it no longer depends on a close feature available only in TCL 8.6.

Basically what this test does is run redis-cli --pipe, generates a bunch of commands and pipes them through redis-cli, and inspects the result in both Redis and the redis-cli output.

To do that, we need to close stdin for redis-cli to indicate we're done so it can flush its buffers and exit. TCL has bi-directional channels can only offers a way to "one-way close" a channel with TCL 8.6. To work around that, we now generate the commands into a file and feed that file to redis-cli directly.

As we're writing to an actual file, the number of commands is now reduced.

(cherry picked from commit dbc0a64843ccd07515ac41ca80497a9e5ffd107a)
2020-09-01 09:27:58 +03:00
Oran Agra
d2fac9bdb9 Fixes to release scripts (#7547)
(cherry picked from commit a472f35efd20eb9dfe0261badb33353bc062cc98)
2020-09-01 09:27:58 +03:00
Remi Collet
443e57b08e Fix deprecated tail syntax in tests (#7543)
(cherry picked from commit 7853d8410b12c3ffac699c8a2e06f2a8e6df26b0)
2020-09-01 09:27:58 +03:00
Wen Hui
fb9b6e0919 Add missing calls to raxStop (#7532)
Since the dynamic allocations in raxIterator are only used for deep walks, memory
leak due to missing call to raxStop can only happen for rax with key names longer
than 32 bytes.

Out of all the missing calls, the only ones that may lead to a leak are the rax
for consumer groups and consumers, and these were only in AOFRW and rdbSave, which
normally only happen in fork or at shutdown.

(cherry picked from commit 0b8d47a9857142203c03846fc4284746695d3dc3)
2020-09-01 09:27:58 +03:00
Wen Hui
25ab97cbe3 add missing caching command in client help (#7399)
(cherry picked from commit e035e5218f4245f5fa5eb0cafc56c572d9f4fa15)
2020-09-01 09:27:58 +03:00
zhaozhao.zz
8739408147 replication: need handle -NOPERM error after send ping (#7538)
(cherry picked from commit 57fbe4cbafb07aa9f036d7e2f5cf88830c27a921)
2020-09-01 09:27:58 +03:00
Scott Brenner
925f1ce51e GitHub Actions workflows - use latest version of actions/checkout (#7534)
(cherry picked from commit c7644eda713044545a135061e4863c2238ebd244)
2020-09-01 09:27:58 +03:00
John Sully
9090e26aca Add build flag to disable MVCC tstamps
Former-commit-id: f17d178d03f44abcdaddd851a313dd3f7ec87ed5
2020-08-10 06:10:24 +00:00
John Sully
9928562dad Fix lock after free in module API
Former-commit-id: d88fd1588d292bffc0aa53c299cb52e7a4e91015
2020-08-10 06:10:24 +00:00
Oran Agra
1c356d2084 Redis 6.0.6. 2020-07-20 21:08:26 +03:00
Oran Agra
3da969eeaa Run daily CI on PRs to release a branch 2020-07-20 21:08:26 +03:00
Itamar Haber
c662a4e01b Adds SHA256SUM to redis-stable tarball upload
(cherry picked from commit efb04ab4a2981762aa4bd2f4fd26f032e9e5e7da)
2020-07-20 21:08:26 +03:00
yoav-steinberg
575ffeb879 Support passing stack allocated module strings to moduleCreateArgvFromUserFormat (#7528)
Specifically, the key passed to the module aof_rewrite callback is a stack allocated robj. When passing it to RedisModule_EmitAOF (with appropriate "s" fmt string) redis used to panic when trying to inc the ref count of the stack allocated robj. Now support such robjs by coying them to a new heap robj. This doesn't affect performance because using the alternative "c" or "b" format strings also copies the input to a new heap robj.

(cherry picked from commit 8a2b0472a78c09398e4416c06b7c5f343348f96b)
2020-07-20 21:08:26 +03:00
Luke Palmer
2871eb287a Send null for invalidate on flush (#7469)
(cherry picked from commit df4c74ef07139d51b06e3d250107c6f71264c33c)
2020-07-20 21:08:26 +03:00
dmurnane
81d36bc6c8 Notify systemd on sentinel startup (#7168)
Co-authored-by: Daniel Murnane <dmurnane@eitccorp.com>
(cherry picked from commit c292d43fec492f555e6889b6f53b7f380f54bccc)
2020-07-20 21:08:26 +03:00
Developer-Ecosystem-Engineering
1e144396e0 Add registers dump support for Apple silicon (#7453)
Export following environment variables before building on macOS on Apple silicon

export ARCH_FLAGS="-arch arm64"
export SDK_NAME=macosx
export SDK_PATH=$(xcrun --show-sdk-path --sdk $SDK_NAME)
export CFLAGS="$ARCH_FLAGS -isysroot $SDK_PATH -I$SDK_PATH/usr/include"
export CXXFLAGS=$CFLAGS
export LDFLAGS="$ARCH_FLAGS"
export CC="$(xcrun -sdk $SDK_PATH --find clang) $CFLAGS"
export CXX="$(xcrun -sdk $SDK_PATH --find clang++) $CXXFLAGS"
export LD="$(xcrun -sdk $SDK_PATH --find ld) $LDFLAGS"

make
make test
..
All tests passed without errors!

Backtrack logging assumes x86 and required updating

(cherry picked from commit 004479c184f62324cb495b75e222b84e5544311e)
2020-07-20 21:08:26 +03:00
Wen Hui
b06b71a442 correct error msg for num connections reaching maxclients in cluster mode (#7444)
(cherry picked from commit 6c5f98b24ba3cefa20fdfe17c530bcce20f8c151)
2020-07-20 21:08:26 +03:00
WuYunlong
8b20802a09 Fix command help for unexpected options (#7476)
(cherry picked from commit e5166eccee3396a24dfd3a79d3211943e5a3d25e)
2020-07-20 21:08:26 +03:00
WuYunlong
bcf9ca362c Refactor RM_KeyType() by using macro. (#7486)
(cherry picked from commit 7da8c062d5ee8eef8663fe3740267561bf65086d)
2020-07-20 21:08:26 +03:00
Oran Agra
b0f08a04e0 diskless master disconnect replicas when rdb child failed (#7518)
in case the rdb child failed, crashed or terminated unexpectedly redis
would have marked the replica clients with repl_put_online_on_ack and
then kill them only after a minute when no ack was received.

it would not stream anything to these connections, so the only effect of
this bug is a delay of 1 minute in the replicas attempt to re-connect.

(cherry picked from commit a3df70923431bee4aaac0efc46004484a63cb167)
2020-07-20 21:08:26 +03:00
Oran Agra
6bdc5a4a08 redis-cli tests, fix valgrind timing issue (#7519)
this test when run with valgrind on github actions takes 160 seconds

(cherry picked from commit 8a14ce8634c49d992aa929cf0f98e96f03bccba4)
2020-07-20 21:08:26 +03:00
WuYunlong
b80f2ec8ac Fix out of update help info in tcl tests. (#7516)
Before this commit, the output of "./runtest-cluster --help" is incorrect.
After this commit, the format of the following 3 output is consistent:
./runtest --help
./runtest-cluster --help
./runtest-sentinel --help

(cherry picked from commit 24b6f62741483f3f695838c0ad091f1931c36df5)
2020-07-20 21:08:26 +03:00
Qu Chen
2c8ecc9713 Replica always reports master's config epoch in CLUSTER NODES output. (#7235)
(cherry picked from commit a517043c7acadbbc0e760092c1abce465636773e)
2020-07-20 21:08:26 +03:00
Oran Agra
90b6ed7a2c RESTORE ABSTTL skip expired keys - leak (#7511)
(cherry picked from commit c10eabeeca9b79a6583ac2db75e7b1aed6c4dceb)
2020-07-20 21:08:26 +03:00
Oran Agra
dde79afbf7 fix recently added time sensitive tests failing with valgrind (#7512)
interestingly the latency monitor test fails because valgrind is slow
enough so that the time inside PEXPIREAT command from the moment of
the first mstime() call to get the basetime until checkAlreadyExpired
calls mstime() again is more than 1ms, and that test was too sensitive.

using this opportunity to speed up the test (unrelated to the failure)
the fix is just the longer time passed to PEXPIRE.

(cherry picked from commit 663e637da87ee9385527fe3a37edb241a1f97cc6)
2020-07-20 21:08:26 +03:00
Oran Agra
905ffb72e9 runtest --stop pause stops before terminating the redis server (#7513)
in the majority of the cases (on this rarely used feature) we want to
stop and be able to connect to the shard with redis-cli.
since these are two different processes interracting with the tty we
need to stop both, and we'll have to hit enter twice, but it's not that
bad considering it is rarely used.

(cherry picked from commit 3351549c22434337dfa8a262dce678679a35d7da)
2020-07-20 21:08:26 +03:00
Oran Agra
7fff1d3500 update release scripts for new hosts, and CI to run more tests (#7480)
* update daily CI to include cluster and sentinel tests
* update daily CI to run when creating a new release
* update release scripts to work on the new redis.io hosts

(cherry picked from commit 2ee300481f3250760ba0ef4253438f6282cf9596)
2020-07-20 21:08:26 +03:00
jimgreen2013
8610a17696 fix description about ziplist, the code is ok (#6318)
* fix description about ZIP_BIG_PREVLEN(the code is ok), it's similar to
antirez#4705

* fix description about ziplist entry encoding field (the code is ok),
the max length should be 2^32 - 1 when encoding is 5 bytes

(cherry picked from commit c05d8a0a31286688249de14e42c5a69b553563db)
2020-07-20 21:08:26 +03:00
马永泽
796cbb68c9 fix benchmark in cluster mode fails to authenticate (#7488)
Co-authored-by: Oran Agra <oran@redislabs.com> (styling)
(cherry picked from commit 40e930dab5d9943f760c65021a2b195d402af3ca)
2020-07-20 21:08:26 +03:00
Abhishek Soni
650f4c538d fix: typo in CI job name (#7466)
(cherry picked from commit 6d8fa206bb6b6bc50cf485b597aaac1870aa8992)
2020-07-20 21:08:26 +03:00
Jiayuan Chen
b42a2bef01 Fix typo in deps README (#7500)
(cherry picked from commit f8c6c32178bafa55e13154cbcf4ef41e9ce7bad9)
2020-07-20 21:08:26 +03:00
WuYunlong
b6fd631d04 Add missing latency-monitor tcl test to test_helper.tcl. (#6782)
(cherry picked from commit 136e5efeaba3296c79e67a6fe5dc796c0830b61e)
2020-07-20 21:08:26 +03:00
Yossi Gottlieb
27d44fbf73 TLS: Session caching configuration support. (#7420)
* TLS: Session caching configuration support.
* TLS: Remove redundant config initialization.

(cherry picked from commit c611a836f630ecf358b5cfb0d3c5e21c9f0bc105)
2020-07-20 21:08:26 +03:00
Yossi Gottlieb
8bacdf8b48 TLS: Ignore client cert when tls-auth-clients off. (#7457)
(cherry picked from commit 6dfbccc212b0977482fa1aba1dfe7a474ac34f2d)
2020-07-20 21:08:26 +03:00
James Hilliard
e76db7509d Use pkg-config to properly detect libssl and libcrypto libraries (#7452)
(cherry picked from commit 5f16b65a5fae28d2343dd002fcfa2dc802dd18f7)
2020-07-20 21:08:26 +03:00
Yossi Gottlieb
6af3d57beb TLS: Add missing redis-cli options. (#7456)
* Tests: fix and reintroduce redis-cli tests.

These tests have been broken and disabled for 10 years now!

* TLS: add remaining redis-cli support.

This adds support for the redis-cli --pipe, --rdb and --replica options
previously unsupported in --tls mode.

* Fix writeConn().

(cherry picked from commit 99b920534f7710d544c38b870fd10c6053283d99)
2020-07-20 21:08:26 +03:00