9206 Commits

Author SHA1 Message Date
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
Oran Agra
1f9793c996 redis-cli --hotkeys fixed to handle non-printable key names
(cherry picked from commit a11940b112577b5290a3bf4ef7bea7e3028c7d76)
2020-07-20 21:08:26 +03:00
Oran Agra
86e45052c3 redis-cli --bigkeys fixed to handle non-printable key names
(cherry picked from commit 3d760eaea2a32282d0a7edb2ebe88ebf2c07d47a)
2020-07-20 21:08:26 +03:00
Oran Agra
da96665c04 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.

(cherry picked from commit 1c35f8741baa0def2f87eeab17898c79f0147d11)
2020-07-20 21:08:26 +03:00
huangzhw
5728ec50d3 defrag.c activeDefragSdsListAndDict when defrag sdsele, We can't use (#7492)
it to calculate hash, we should use newsds.

(cherry picked from commit 84bef6691bbd5c517bafdd09a3ce57fc17d1d66c)
2020-07-20 21:08:26 +03:00
Oran Agra
cf116e08cc 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.....'

(cherry picked from commit 6b53c630d92c8fbeb9bea0c406c9454fb68b8467)
2020-07-20 21:08:26 +03:00
Oran Agra
c994e73c8e 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.

(cherry picked from commit efc4189b6227a17f26ed9bd6bbac62bf4bf7ab66)
2020-07-20 21:08:26 +03:00
Oran Agra
298e93c360 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

(cherry picked from commit 8d4f055e43ab554adfce617c971f10c4b6423484)
2020-07-20 21:08:26 +03:00
Oran Agra
b71330af50 change references to the github repo location (#7479)
(cherry picked from commit 8df988207500e0c76e2276a733be54ad443d78bb)
2020-07-20 21:08:26 +03:00
zhaozhao.zz
a17f059d21 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.

(cherry picked from commit 2cf11ce5ca6804df9ff65bc90dbd1dfc5e2e497c)
2020-07-20 21:08:26 +03:00
antirez
ae2bcd49db Update comment to clarify change in #7398.
(cherry picked from commit 7bb0342201aa317415da7b512fb69737581bf822)
2020-07-20 21:08:26 +03:00
antirez
ecb2743e8a LPOS: option FIRST renamed RANK.
(cherry picked from commit 5b16c2f1744abf2640549e36fa2744417d427b7c)
2020-07-20 21:08:26 +03:00
Dave Nielsen
a88be2c6eb updated copyright year
Changed "2015" to "2020"

(cherry picked from commit e54ea02c4366632fe546c509453edc91748dbe95)
2020-07-20 21:08:26 +03:00
Oran Agra
8510588213 EXEC always fails with EXECABORT and multi-state is cleared
In order to support the use of multi-exec in pipeline, it is important that
MULTI and EXEC are never rejected and it is easy for the client to know if the
connection is still in multi state.

It was easy to make sure MULTI and DISCARD never fail (done by previous
commits) since these only change the client state and don't do any actual
change in the server, but EXEC is a different story.

Since in the past, it was possible for clients to handle some EXEC errors and
retry the EXEC, we now can't affort to return any error on EXEC other than
EXECABORT, which now carries with it the real reason for the abort too.

Other fixes in this commit:
- Some checks that where performed at the time of queuing need to be re-
  validated when EXEC runs, for instance if the transaction contains writes
  commands, it needs to be aborted. there was one check that was already done
  in execCommand (-READONLY), but other checks where missing: -OOM, -MISCONF,
  -NOREPLICAS, -MASTERDOWN
- When a command is rejected by processCommand it was rejected with addReply,
  which was not recognized as an error in case the bad command came from the
  master. this will enable to count or MONITOR these errors in the future.
- make it easier for tests to create additional (non deferred) clients.
- add tests for the fixes of this commit.

(cherry picked from commit fe8d6fe74920798c146a587810ee91ff049a9093)
2020-07-20 21:08:26 +03:00
antirez
63073e6a44 Include cluster.h for getClusterConnectionsCount().
(cherry picked from commit 79e15d1686462c750073ed12c1bfab7fa8b090c8)
2020-07-20 21:08:26 +03:00
antirez
5f889001cf Fix BITFIELD i64 type handling, see #7417.
(cherry picked from commit 448a8bb0ed9e970a1c6db594a5dc88ded1036695)
2020-07-20 21:08:26 +03:00
antirez
93fa64f65a Clarify maxclients and cluster in conf. Remove myself too.
(cherry picked from commit c10a7a040f10e32f4a27288499c0c1e104754a1b)
2020-07-20 21:08:26 +03:00
hwware
e4e223ad79 fix memory leak in sentinel connection sharing
(cherry picked from commit bdac36b70e222e9457bad0c682f2f5bc2ba25238)
2020-07-20 21:08:26 +03:00
chenhui0212
ee992ea113 Fix comments in function raxLowWalk of listpack.c
(cherry picked from commit 44235ac718e34576fa9d202bd86132f5b2976b77)
2020-07-20 21:08:26 +03:00
Tomasz Poradowski
f13381da22 ensure SHUTDOWN_NOSAVE in Sentinel mode
- enforcing of SHUTDOWN_NOSAVE flag in one place to make it consitent
  when running in Sentinel mode

(cherry picked from commit 6782243054d7f8b5b861b5ae367db22b0f47a3b9)
2020-07-20 21:08:26 +03:00
chenhui0212
1c733df3d8 fix comments in listpack.c
(cherry picked from commit 6b82471098a03babcd9cd9a2ff63ba0d138a4279)
2020-07-20 21:08:26 +03:00
antirez
7412dbbef5 Use cluster connections too, to limit maxclients.
See #7401.

(cherry picked from commit fc08cafdb0e7f86ddd4ededfed87026b02f8447d)
2020-07-20 21:08:26 +03:00
antirez
d5515331e2 Tracking: fix enableBcastTrackingForPrefix() invalid sdslen() call.
Related to #7387.

(cherry picked from commit ae770c30349cb4c72393f3b70318371081f3cc65)
2020-07-20 21:08:26 +03:00
root
09e960ff62 cluster.c remove if of clusterSendFail in markNodeAsFailingIfNeeded
(cherry picked from commit 009a2d443a92f30e0f45ade08ce6fea275a5d71f)
2020-07-20 21:08:26 +03:00
meir@redislabs.com
cb06a48ef3 Fix RM_ScanKey module api not to return int encoded strings
The scan key module API provides the scan callback with the current
field name and value (if it exists). Those arguments are RedisModuleString*
which means it supposes to point to robj which is encoded as a string.
Using createStringObjectFromLongLong function might return robj that
points to an integer and so break a module that tries for example to
use RedisModule_StringPtrLen on the given field/value.

The PR introduces a fix that uses the createObject function and sdsfromlonglong function.
Using those function promise that the field and value pass to the to the
scan callback will be Strings.

The PR also changes the Scan test module to use RedisModule_StringPtrLen
to catch the issue. without this, the issue is hidden because
RedisModule_ReplyWithString knows to handle integer encoding of the
given robj (RedisModuleString).

The PR also introduces a new test to verify the issue is solved.

(cherry picked from commit e37c16e42551a3a5c61e1f8a90cfc672d3e010e4)
2020-07-20 21:08:26 +03:00
antirez
9d3e874179 Fix LCS object type checking. Related to #7379.
(cherry picked from commit 00e1f87a08f7e0f2e1706a8f937671b83dc63f12)
2020-07-20 21:08:26 +03:00
hwware
3dbde34323 fix memory leak
(cherry picked from commit 8ab655bd7b92f4cc310cdfbf974c6c8627446628)
2020-07-20 21:08:26 +03:00
hwware
4a03e1e1f8 fix server crash in STRALGO command
(cherry picked from commit 44195a2047efbe4db1b37365bd4ed66ba0f9d306)
2020-07-20 21:08:26 +03:00
Benjamin Sergeant
2f9da08ead Update redis-cli.c
(cherry picked from commit 52a477c661beabb3308767a442178824579be912)
2020-07-20 21:08:26 +03:00
Jamie Scott
333f763693 minor fix
(cherry picked from commit 3ba9724d1637aad9699d652b150ad7860b7016d0)
2020-07-20 21:08:26 +03:00
antirez
d05cc51e4e help.h updated. 2020-06-12 12:16:24 +02:00
antirez
3dc6657ea8 LPOS: tests + crash fix. 2020-06-12 12:08:06 +02:00
antirez
010dd2b320 LPOS: update to latest proposal.
See https://gist.github.com/antirez/3591c5096bc79cad8b5a992e08304f48
2020-06-12 12:08:06 +02:00
antirez
00e400ed66 LPOS: implement the final design. 2020-06-12 12:08:06 +02:00
Paul Spooren
795c807fed LRANK: Add command (the command will be renamed LPOS).
The `LRANK` command returns the index (position) of a given element
within a list. Using the `direction` argument it is possible to specify
going from head to tail (acending, 1) or from tail to head (decending,
-1). Only the first found index is returend. The complexity is O(N).

When using lists as a queue it can be of interest at what position a
given element is, for instance to monitor a job processing through a
work queue. This came up within the Python `rq` project which is based
on Redis[0].

[0]: https://github.com/rq/rq/issues/1197

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-06-12 12:08:06 +02:00
antirez
ce8f107a5e Redis 6.0.5. 2020-06-09 12:19:30 +02:00
antirez
93e76ba456 Adapt EVAL+busy script test to new behavior. 2020-06-09 12:19:30 +02:00
antirez
e819e3ee26 Temporary fix for #7353 issue about EVAL during -BUSY. 2020-06-09 11:53:01 +02:00
xhe
5fae6590a1 return the correct proto version
HELLO should return the current proto version, while the code hardcoded
3
2020-06-09 11:53:01 +02:00