614 Commits

Author SHA1 Message Date
fayadexinqing
0054ba666f fix migration's broadcast PONG message, after the slot modification (#7590) 2020-08-07 13:01:14 -07:00
fayadexinqing
323d92b689 broadcast a PONG message when slot's migration is over, which may reduce the moved request of clients (#7571) 2020-07-29 18:05:27 -07:00
Yossi Gottlieb
bc450c5f63 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>
2020-07-28 11:32:47 +03:00
Jiayuan Chen
198770751f 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>
2020-07-28 10:45:21 +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
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
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
antirez
c10a7a040f Clarify maxclients and cluster in conf. Remove myself too. 2020-06-22 11:21:21 +02:00
antirez
fc08cafdb0 Use cluster connections too, to limit maxclients.
See #7401.
2020-06-16 11:45:11 +02:00
root
009a2d443a cluster.c remove if of clusterSendFail in markNodeAsFailingIfNeeded 2020-06-15 10:18:14 +08:00
Liu Zhen
7045d1cad9 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-05-27 12:01:40 +08:00
antirez
3311d52e80 Cluster: clarify we always resolve the sender. 2020-05-09 11:12:51 +02:00
antirez
dc35bcdeb7 Cluster: refactor ping/data delay handling. 2020-05-09 11:10:38 +02:00
antirez
f3194fce40 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:10:35 +02:00
antirez
80c5dc1247 MIGRATE AUTH2 for ACL support. 2020-04-30 10:14:15 +02:00
Salvatore Sanfilippo
8d821e61d8 Merge pull request #7101 from hwware/fixunusedmarco
Fix not used marco in cluster.c
2020-04-28 11:22:09 +02:00
Salvatore Sanfilippo
0dd08d746e Merge pull request #7123 from fayadexinqing/optimizeClusterSlots
Optimize the command of cluster slots
2020-04-23 16:18:22 +02:00
yanhui13
9029a7ffe9 optimize the output of cluster slots 2020-04-21 16:55:05 +08:00
antirez
d3d5108c7d Tracking: NOLOOP internals implementation. 2020-04-21 10:51:46 +02:00
hwware
b353245450 Fix not used marco in cluster.c 2020-04-15 22:00:36 -04:00
antirez
f9c0953fdd 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-09 10:24:46 +02:00
Salvatore Sanfilippo
590954ae02 Merge pull request #7006 from hwware/fixspelling
fix spelling in cluster.c clusterDelNode
2020-04-02 11:23:53 +02:00
Yossi Gottlieb
9895f32dfb Cluster: fix misleading accept errors. 2020-03-22 14:46:16 +02:00
hwware
8d8644b330 add missing commands in cluster help 2020-03-20 09:01:12 -04:00
hwware
d59e54c32c fix spelling in cluster.c 2020-03-18 09:48:03 -04:00
Itamar Haber
f9ad2cfd75 Adds keyspace notifications to migrate and restore 2020-03-11 18:43:03 +02:00
antirez
5c5f25a9f9 Simplify #6379 changes. 2020-01-13 13:25:37 +01:00
WuYunlong
e2b8c9280b Fix potential memory leak of clusterLoadConfig(). 2020-01-07 10:28:36 +08:00
antirez
4eae0cdba7 Add some comment to PR #6144 changes. 2019-12-17 09:19:47 +01:00
Madelyn Olson
1ce271b9b4 Split error message so dependandent callers give a useful result 2019-12-16 23:34:37 -08:00
Madelyn Olson
d9c79ff75c Add configuration option for allowing reads on cluster down 2019-12-16 23:33:16 -08:00
Oran Agra
86e1f73bd6 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
85d7f38136 Merge remote-tracking branch 'upstream/unstable' into tls 2019-10-16 17:08:07 +03:00
Oran Agra
8704be6947 TLS: Implement support for write barrier. 2019-10-07 21:06:30 +03:00
Yossi Gottlieb
10ffeb03e4 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
dd99293067 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
2c96a98ed8 RESP3: Use verbatim in CLUSTER subcommands. 2019-09-18 18:51:15 +02:00
antirez
4ff08c8657 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
dedbc9d4d2 Removed unecessary creation of Redis objects 2019-07-22 22:52:16 -07:00
Yossi Gottlieb
dd405d4026 Add RedisModule_GetKeyNameFromIO(). 2019-03-15 10:23:27 +02:00
chendianqiang
934dbc25df optimize cluster failover 2019-03-01 15:28:21 +08:00
antirez
c8304b099d RESP3: most null replies converted. 2019-01-09 17:00:29 +01:00
antirez
43ee60204f RESP3: Use new aggregate reply API in cluster.c. 2019-01-09 17:00:29 +01:00
antirez
63787d5cbc Use guide comments to make changes in #5462 more obvious. 2018-10-22 17:43:48 +02:00
youjiali1995
e29c6573b9 migrate: fix mismatch of RESTORE reply when some keys have expired. 2018-10-18 18:57:51 +08:00
antirez
587db27252 Module cluster flags: add RM_SetClusterFlags() API. 2018-09-19 12:02:37 +02:00
antirez
6b30cb52da Module cluster flags: add hooks for NO_FAILOVER flag. 2018-09-19 11:43:37 +02:00
antirez
ebf0968a38 Module cluster flags: add hooks for NO_REDIRECTION flag. 2018-09-19 11:31:22 +02:00