7860 Commits

Author SHA1 Message Date
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
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
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
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
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
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
John Sully
6ec308c30f Fix memory leak in MVCC scan
Former-commit-id: 3acf80f8dd5ebc311670398745ef3400333a1fcb
2020-07-16 22:42:24 +00:00
John Sully
9112445059 Add new storage-provider-options config
Former-commit-id: 195a28beecc6094f959ddafef7fe33f5b55e4047
2020-07-14 04:24:46 +00:00
John Sully
503ca68e8c Perf fixes on expire lock
Former-commit-id: 7f23ac087720317f54a0bc0e0c4774e7b0ef4337
2020-07-13 18:14:52 +00:00
John Sully
ad5ad52841 Build fixes from cherry-pick
Former-commit-id: 70efd87cf71bb230e8b53d1c4ed3dd91997b4d23
2020-07-13 16:09:03 +00:00
John Sully
af10f809b4 unoredered_map is faster, reduce latency with the switch
Former-commit-id: f241e435ed0fd2988ada887f02e19884fd82be51
2020-07-13 16:04:00 +00:00
John Sully
fc119b3e56 Remove unnecessary work from critical path (Latency Fixes)
Former-commit-id: 096a90deb7afe489875d3186f3f8f43e41fea329
2020-07-13 16:03:52 +00:00
John Sully
7ed6e1a197 Bump version
Former-commit-id: f7d7baccc91d3c39fb6ff7ba04c57208522b6583
2020-07-13 03:59:16 +00:00
John Sully
414b3102ca Merge branch 'flash_cache' into keydbpro
Former-commit-id: 2a721ef645921d62b39f1374c0a3f5c92b00fae5
2020-07-13 03:53:34 +00:00
John Sully
8c2c0fba12 Merge branch 'PRO_RELEASE_6' into keydbpro
Former-commit-id: bffe010ea5279bee869bc61cc6d933979e10bbea
2020-07-13 03:32:14 +00:00
John Sully
f17dab1f67 Merge branch 'unstable' into keydbpro
Former-commit-id: 0dafbc254a0efd5ee302d5c58fb2ca0a85110104
2020-07-13 03:31:47 +00:00
John Sully
7f36b5541e Merge branch 'unstable' into RELEASE_6
Former-commit-id: f7c2006bf69d6c22f6998327ce8e9746b3b9023c
2020-07-13 01:04:49 +00:00
John Sully
84bf240caa Merge tag '6.0.5' into unstable
Redis 6.0.5


Former-commit-id: b736a95b0d23e4b73daa88c676b76d1d18e8bd17
2020-07-13 00:55:23 +00:00
John Sully
70824b3bdb Add the KEYDB.MEXISTS command, see issue #203
Former-commit-id: 5619f515285b08d9c443425de1f3092ae3058d40
2020-07-12 21:42:11 +00:00
John Sully
f853142083 Add multi-master-no-forward command to reduce bus traffic with multi-master
Former-commit-id: d99d06b1250a51ea4bc54f678f451acbb7901e33
2020-07-12 19:25:19 +00:00
John Sully
6158cdfd29 Prevent deadlock in RM_ThreadSafeContextLock() when triggered as part of a module callback in a server thread
Former-commit-id: e01312642be3cc78e7b383dee958a9b5c0ffc103
2020-07-12 18:17:53 +00:00
John Sully
3eca9ea38d Fix CLI crash on arch with hostname
Former-commit-id: 55fd37e8d6c3775d0b1bd13966ca033f63945d7e
2020-07-12 05:38:08 +00:00