9527 Commits

Author SHA1 Message Date
Remi Collet
7853d8410b Fix deprecated tail syntax in tests (#7543) 2020-07-21 09:07:54 +03:00
Wen Hui
0b8d47a985 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.
2020-07-21 08:13:05 +03:00
Wen Hui
e035e5218f add missing caching command in client help (#7399) 2020-07-20 18:53:03 -07:00
zhaozhao.zz
57fbe4cbaf replication: need handle -NOPERM error after send ping (#7538) 2020-07-20 22:21:55 +08:00
WuYunlong
a06d7eda9a Fix cluster redirect for module command with no firstkey. (#7539)
Before this commit, processCommand() did not notice that cmd could be a module command
which declared `getkeys-api` and handled it for the purpose of cluster redirect it
as if it doesn't use any keys.

This commit fixed it by reusing the codes in addReplyCommand().
2020-07-20 15:33:06 +03:00
Oran Agra
363347830b Run daily CI on PRs to release a branch (#7535) 2020-07-20 13:57:54 +03:00
WuYunlong
6efda6a476 Refactor streamAppendItem() by deleting redundancy condition. (#7487)
It will never happen that "lp != NULL && lp_bytes >= server.stream_node_max_bytes".
Assume that "lp != NULL && lp_bytes >= server.stream_node_max_bytes",
we got the following conditions:
a. lp != NULL
b. lp_bytes >= server.stream_node_max_bytes

If server.stream_node_max_bytes is 0, given condition a, condition b is always satisfied
If server.stream_node_max_bytes is not 0, given condition a and condition b, the codes just a
	few lines above set lp to NULL, a controdiction with condition a

So that condition b is recundant. We could delete it safely.
2020-07-20 13:14:27 +03:00
Scott Brenner
c7644eda71 GitHub Actions workflows - use latest version of actions/checkout (#7534) 2020-07-20 09:22:24 +03:00
Itamar Haber
f827ed388d Merge pull request #7529 from itamarhaber/stable-sha256sum
Adds SHA256SUM to redis-stable tarball upload
2020-07-17 15:20:54 +03:00
Itamar Haber
efb04ab4a2 Adds SHA256SUM to redis-stable tarball upload 2020-07-16 21:31:36 +03:00
Itamar Haber
9cbf4056a3 Adds GitHub issue templates (#7468)
Co-authored-by: Oran Agra <oran@redislabs.com>
Co-authored-by: yoav-steinberg <yoav@monfort.co.il>
2020-07-16 21:01:27 +03:00
yoav-steinberg
8a2b0472a7 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.
2020-07-16 20:59:38 +03:00
杨博东
2028ad5a12 Stream avoid duplicate parse id (#7450) 2020-07-16 08:57:27 +03:00
Luke Palmer
df4c74ef07 Send null for invalidate on flush (#7469) 2020-07-15 10:53:41 -07:00
dmurnane
c292d43fec Notify systemd on sentinel startup (#7168)
Co-authored-by: Daniel Murnane <dmurnane@eitccorp.com>
2020-07-15 13:29:26 +03:00
Developer-Ecosystem-Engineering
004479c184 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
2020-07-15 12:44:03 +03:00
Wen Hui
6c5f98b24b correct error msg for num connections reaching maxclients in cluster mode (#7444) 2020-07-15 12:38:47 +03:00
WuYunlong
e5166eccee Fix command help for unexpected options (#7476) 2020-07-15 12:38:22 +03:00
WuYunlong
7da8c062d5 Refactor RM_KeyType() by using macro. (#7486) 2020-07-15 12:37:44 +03:00
Oran Agra
a3df709234 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.
2020-07-14 20:21:59 +03:00
Oran Agra
8a14ce8634 redis-cli tests, fix valgrind timing issue (#7519)
this test when run with valgrind on github actions takes 160 seconds
2020-07-14 18:04:08 +03:00
WuYunlong
24b6f62741 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
2020-07-14 11:35:04 +03:00
Qu Chen
a517043c7a Replica always reports master's config epoch in CLUSTER NODES output. (#7235) 2020-07-13 07:16:06 -07:00
Oran Agra
c10eabeeca RESTORE ABSTTL skip expired keys - leak (#7511) 2020-07-13 16:40:19 +03:00
Oran Agra
663e637da8 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.
2020-07-13 16:40:03 +03:00
Oran Agra
3351549c22 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.
2020-07-13 16:09:08 +03:00
Oran Agra
2ee300481f 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
2020-07-12 13:55:26 +03:00
jimgreen2013
c05d8a0a31 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
2020-07-11 14:51:44 -05:00
杨博东
a4b4df5fe6 STORE variants: SINTER,SUNION,SDIFF,ZUNION use setKey instead of dbDelete+dbAdd (#7489)
one of the differences (other than consistent code with SORT, GEORADIUS), is that the LFU of the old key is retained.
2020-07-11 15:52:41 +03:00
马永泽
40e930dab5 fix benchmark in cluster mode fails to authenticate (#7488)
Co-authored-by: Oran Agra <oran@redislabs.com> (styling)
2020-07-10 16:37:11 +03:00
Abhishek Soni
6d8fa206bb fix: typo in CI job name (#7466) 2020-07-10 16:05:29 +03:00
Jiayuan Chen
f8c6c32178 Fix typo in deps README (#7500) 2020-07-10 16:02:18 +03:00
WuYunlong
136e5efeab Add missing latency-monitor tcl test to test_helper.tcl. (#6782) 2020-07-10 11:41:48 +03:00
Yossi Gottlieb
c611a836f6 TLS: Session caching configuration support. (#7420)
* TLS: Session caching configuration support.
* TLS: Remove redundant config initialization.
2020-07-10 11:33:47 +03:00
Yossi Gottlieb
6dfbccc212 TLS: Ignore client cert when tls-auth-clients off. (#7457) 2020-07-10 10:32:21 +03:00
James Hilliard
5f16b65a5f Use pkg-config to properly detect libssl and libcrypto libraries (#7452) 2020-07-10 10:30:09 +03:00
Yossi Gottlieb
99b920534f 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().
2020-07-10 10:25:55 +03:00
Oran Agra
a11940b112 redis-cli --hotkeys fixed to handle non-printable key names 2020-07-10 10:07:47 +03:00
Oran Agra
3d760eaea2 redis-cli --bigkeys fixed to handle non-printable key names 2020-07-10 10:07:47 +03:00
Oran Agra
1c35f8741b RESTORE ABSTTL won't store expired keys into the db (#7472)
Similarly to EXPIREAT with TTL in the past, which implicitly deletes the
key and return success, RESTORE should not store key that are already
expired into the db.
When used together with REPLACE it should emit a DEL to keyspace
notification and replication stream.
2020-07-10 10:02:37 +03:00
huangzhw
84bef6691b defrag.c activeDefragSdsListAndDict when defrag sdsele, We can't use (#7492)
it to calculate hash, we should use newsds.
2020-07-10 08:29:44 +03:00
Oran Agra
6b53c630d9 skip a test that uses +inf on valgrind (#7440)
On some platforms strtold("+inf") with valgrind returns a non-inf result

[err]: INCRBYFLOAT does not allow NaN or Infinity in tests/unit/type/incr.tcl
Expected 'ERR*would produce*' to equal or match '1189731495357231765085759.....'
2020-07-10 08:29:02 +03:00
Oran Agra
efc4189b62 stabilize tests that look for log lines (#7367)
tests were sensitive to additional log lines appearing in the log
causing the search to come empty handed.

instead of just looking for the n last log lines, capture the log lines
before performing the action, and then search from that offset.
2020-07-10 08:28:22 +03:00
Oran Agra
8d4f055e43 tests/valgrind: don't use debug restart (#7404)
* tests/valgrind: don't use debug restart

DEBUG REATART causes two issues:
1. it uses execve which replaces the original process and valgrind doesn't
   have a chance to check for errors, so leaks go unreported.
2. valgrind report invalid calls to close() which we're unable to resolve.

So now the tests use restart_server mechanism in the tests, that terminates
the old server and starts a new one, new PID, but same stdout, stderr.

since the stderr can contain two or more valgrind report, it is not enough
to just check for the absence of leaks, we also need to check for some known
errors, we do both, and fail if we either find an error, or can't find a
report saying there are no leaks.

other changes:
- when killing a server that was already terminated we check for leaks too.
- adding DEBUG LEAK which was used to test it.
- adding --trace-children to valgrind, although no longer needed.
- since the stdout contains two or more runs, we need slightly different way
  of checking if the new process is up (explicitly looking for the new PID)
- move the code that handles --wait-server to happen earlier (before
  watching the startup message in the log), and serve the restarted server too.

* squashme - CR fixes
2020-07-10 08:26:52 +03:00
Oran Agra
8df9882075 change references to the github repo location (#7479) 2020-07-10 08:25:26 +03:00
zhaozhao.zz
2cf11ce5ca BITOP: propagate only when it really SET or DEL targetkey (#5783)
For example:
    BITOP not targetkey sourcekey

If targetkey and sourcekey doesn't exist, BITOP has no effect,
we do not propagate it, thus can save aof and replica flow.
2020-07-10 08:20:27 +03:00
antirez
7bb0342201 Update comment to clarify change in #7398. 2020-06-25 12:58:21 +02:00
Salvatore Sanfilippo
339fb2de8d Merge pull request #7398 from caiyuxinggg/work
cluster.c remove "if (nodeIsMaster(myself))" judgement before clusterSendFail in markNodeAsFailingIfNeeded, avoiding slave failover requires twice vote requests
2020-06-25 12:56:26 +02:00
Salvatore Sanfilippo
03ab78d115 Merge pull request #7426 from dnielsen/patch-1
updated copyright year to 2020
2020-06-25 12:36:37 +02:00
antirez
e2f5953c73 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-06-24 09:09:59 +02:00