609 Commits

Author SHA1 Message Date
Raghav Muddur
1bd75aafdb Update clusterMsgDataPublish to clusterMsgModule (#7682)
Correcting the variable to clusterMsgModule.

(cherry picked from commit 34c3be365a3a8bc74f7a99b3e35cb211afaa58ca)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb
1c05b87e30 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 784ceeb90d84bbc49fc2f2e2e6c7b9fae2524bd5)
2020-09-01 09:27:58 +03:00
Jiayuan Chen
096285ab64 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 f31260b0445f5649449da41555e1272a40ae4af7)
2020-09-01 09:27:58 +03:00
Qu Chen
9bc6af2449 Replica always reports master's config epoch in CLUSTER NODES output. (#7235)
(cherry picked from commit 938c35302fb618ec15e62443ef3bb3d00d10f5b9)
2020-07-20 21:08:26 +03:00
Oran Agra
c4b428a388 RESTORE ABSTTL skip expired keys - leak (#7511)
(cherry picked from commit 6a814501448c5673d05eb2cfe4fe650883da8f0e)
2020-07-20 21:08:26 +03:00
Oran Agra
95ba01b538 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 5977a94842a25140520297fe4bfda15e0e4de711)
2020-07-20 21:08:26 +03:00
antirez
14a59d4ce7 Update comment to clarify change in #7398.
(cherry picked from commit ad0a9df77a2ccf3fdf309dcdd1b54cf350fcbe3c)
2020-07-20 21:08:26 +03:00
antirez
8312aa27d4 Clarify maxclients and cluster in conf. Remove myself too.
(cherry picked from commit 59fd178014c7cca1b0c668b30ab0d991dd3030f3)
2020-07-20 21:08:26 +03:00
antirez
0ebbc36059 Use cluster connections too, to limit maxclients.
See #7401.

(cherry picked from commit 4b8d8826afa0f240b26977e9d128144ebf8d5d7a)
2020-07-20 21:08:26 +03:00
root
8095daea4a cluster.c remove if of clusterSendFail in markNodeAsFailingIfNeeded
(cherry picked from commit c92464db694172dac8b0f9eeedd366c494d6db8a)
2020-07-20 21:08:26 +03:00
Liu Zhen
84a7a90586 fix clusters mixing accidentally by gossip
`clusterStartHandshake` will start hand handshake
and eventually send CLUSTER MEET message, which is strictly prohibited
in the REDIS CLUSTER SPEC.
Only system administrator can initiate CLUSTER MEET message.
Futher, according to the SPEC, rather than IP/PORT pairs, only nodeid
can be trusted.
2020-06-06 11:43:29 +02:00
antirez
1276058ea8 Cluster: clarify we always resolve the sender. 2020-05-09 11:14:58 +02:00
antirez
002fcde3da Cluster: refactor ping/data delay handling. 2020-05-09 11:14:58 +02:00
antirez
960186a71f Cluster: introduce data_received field.
We want to send pings and pongs at specific intervals, since our packets
also contain information about the configuration of the cluster and are
used for gossip. However since our cluster bus is used in a mixed way
for data (such as Pub/Sub or modules cluster messages) and metadata,
sometimes a very busy channel may delay the reception of pong packets.
So after discussing it in #7216, this commit introduces a new field that
is not exposed in the cluster, is only an internal information about
the last time we received any data from a given node: we use this field
in order to avoid detecting failures, claiming data reception of new
data from the node is a proof of liveness.
2020-05-09 11:14:58 +02:00
antirez
7be21139aa MIGRATE AUTH2 for ACL support. 2020-04-30 13:02:59 +02:00
hwware
5bfc18950a Fix not used marco in cluster.c 2020-04-30 13:02:58 +02:00
yanhui13
374ffdf1c1 optimize the output of cluster slots 2020-04-24 10:15:04 +02:00
antirez
6791ff0525 Tracking: NOLOOP internals implementation. 2020-04-24 10:14:48 +02:00
antirez
61b153073f RDB: load files faster avoiding useless free+realloc.
Reloading of the RDB generated by

    DEBUG POPULATE 5000000
    SAVE

is now 25% faster.

This commit also prepares the ability to have more flexibility when
loading stuff from the RDB, since we no longer use dbAdd() but can
control exactly how things are added in the database.
2020-04-15 16:03:16 +02:00
hwware
cd2b5df971 fix spelling in cluster.c 2020-04-07 16:52:04 +02:00
Yossi Gottlieb
50dcd9f96d Cluster: fix misleading accept errors. 2020-03-25 15:55:24 +01:00
hwware
2dd1ca6af0 add missing commands in cluster help 2020-03-25 15:55:24 +01:00
Itamar Haber
dc8885a1ca Adds keyspace notifications to migrate and restore 2020-03-25 15:54:34 +01:00
antirez
cbabf779c2 Simplify #6379 changes. 2020-01-17 10:47:38 +01:00
WuYunlong
47988c9666 Fix potential memory leak of clusterLoadConfig(). 2020-01-17 10:47:38 +01:00
antirez
4348d25fc4 Add some comment to PR #6144 changes. 2019-12-17 09:19:47 +01:00
Madelyn Olson
576a08908b Split error message so dependandent callers give a useful result 2019-12-16 23:34:37 -08:00
Madelyn Olson
c95a582a74 Add configuration option for allowing reads on cluster down 2019-12-16 23:33:16 -08:00
Oran Agra
28c20b4ef9 rename RN_SetLRUOrLFU -> RM_SetLRU and RN_SetLFU
- the API name was odd, separated to two apis one for LRU and one for LFU
- the LRU idle time was in 1 second resolution, which might be ok for RDB
  and RESTORE, but i think modules may need higher resolution
- adding tests for LFU and for handling maxmemory policy mismatch
2019-11-10 09:27:01 +02:00
Yossi Gottlieb
0db3b0a0ff Merge remote-tracking branch 'upstream/unstable' into tls 2019-10-16 17:08:07 +03:00
Oran Agra
6b6294807c TLS: Implement support for write barrier. 2019-10-07 21:06:30 +03:00
Yossi Gottlieb
b087dd1db6 TLS: Connections refactoring and TLS support.
* Introduce a connection abstraction layer for all socket operations and
integrate it across the code base.
* Provide an optional TLS connections implementation based on OpenSSL.
* Pull a newer version of hiredis with TLS support.
* Tests, redis-cli updates for TLS support.
2019-10-07 21:06:13 +03:00
Oran Agra
d1a005ab39 fix issues found by a static analyzer
cluster.c - stack buffer memory alignment
    The pointer 'buf' is cast to a more strictly aligned pointer type
evict.c - lazyfree_lazy_eviction, lazyfree_lazy_eviction always called
defrag.c - bug in dead code
server.c - casting was missing parenthesis
rax.c - indentation / newline suggested an 'else if' was intended
2019-10-07 09:09:32 +03:00
antirez
dd2f695d7e RESP3: Use verbatim in CLUSTER subcommands. 2019-09-18 18:51:15 +02:00
antirez
b12ccc840e Cluster: abort loading nodes data if vars arguments are unbalanced.
See for reference PR #6337. Thanks to @git-hulk for spotting this.
2019-09-02 11:41:20 +02:00
Madelyn Olson
8fe173452a Removed unecessary creation of Redis objects 2019-07-22 22:52:16 -07:00
Yossi Gottlieb
a88264d934 Add RedisModule_GetKeyNameFromIO(). 2019-03-15 10:23:27 +02:00
chendianqiang
a16da79228 optimize cluster failover 2019-03-01 15:28:21 +08:00
antirez
317f8b9d38 RESP3: most null replies converted. 2019-01-09 17:00:29 +01:00
antirez
dcbd40cea4 RESP3: Use new aggregate reply API in cluster.c. 2019-01-09 17:00:29 +01:00
antirez
54e8dd11ff Use guide comments to make changes in #5462 more obvious. 2018-10-22 17:43:48 +02:00
youjiali1995
a6499ecac2 migrate: fix mismatch of RESTORE reply when some keys have expired. 2018-10-18 18:57:51 +08:00
antirez
3213e8de92 Module cluster flags: add RM_SetClusterFlags() API. 2018-09-19 12:02:37 +02:00
antirez
777cc5b987 Module cluster flags: add hooks for NO_FAILOVER flag. 2018-09-19 11:43:37 +02:00
antirez
c202ba2b35 Module cluster flags: add hooks for NO_REDIRECTION flag. 2018-09-19 11:31:22 +02:00
antirez
744fe7f348 Module cluster flags: initial vars / defines added. 2018-09-19 11:20:52 +02:00
antirez
a9419e2386 Slave removal: Convert cluster.c log messages and command names. 2018-09-11 15:32:28 +02:00
antirez
e245ed9a44 Cluster cron announce IP minor refactoring. 2018-07-31 17:13:03 +02:00
shenlongxing
35ca670060 Fix cluster-announce-ip memory leak 2018-07-31 16:01:44 +08:00
antirez
0bdeb861f4 Example the magic +1 in migrateCommand().
Related to #5154.
2018-07-24 17:31:43 +02:00