8947 Commits

Author SHA1 Message Date
Yossi Gottlieb
1a948d0c5b Conns: Fix connClose() / connAccept() behavior.
We assume accept handlers may choose to reject a connection and close
it, but connAccept() callers can't distinguish between this state and
other error states requiring connClose().

This makes it safe (and mandatory!) to always call connClose() if
connAccept() fails, and safe for accept handlers to close connections
(which will defer).
2020-03-25 15:55:24 +01:00
hwware
4a0249c0c8 remove redundant Semicolon 2020-03-25 15:55:24 +01:00
hwware
9c9ef6fb9b clean CLIENT_TRACKING_CACHING flag when disabled caching 2020-03-25 15:55:24 +01:00
hwware
04d838274f add missing commands in cluster help 2020-03-25 15:55:24 +01:00
artix
5ccdb7a5be Support Redis Cluster Proxy PROXY INFO command 2020-03-25 15:55:24 +01:00
박승현
799a7dd8ac Update redis.conf 2020-03-25 15:54:34 +01:00
WuYunlong
37c6571a6c Fix master replica inconsistency for upgrading scenario.
Before this commit, when upgrading a replica, expired keys will not
be loaded, thus causing replica having less keys in db. To this point,
master and replica's keys is logically consistent. However, before
the keys in master and replica are physically consistent, that is,
they have the same dbsize, if master got a problem and the replica
got promoted and becomes new master of that partition, and master
updates a key which does not exist on master, but physically exists
on the old master(new replica), the old master would refuse to update
the key, thus causing master and replica data inconsistent.

How could this happen?
That's all because of the wrong judgement of roles while starting up
the server. We can not use server.masterhost to judge if the server
is master or replica, since it fails in cluster mode.

When we start the server, we load rdb and do want to load expired keys,
and do not want to have the ability to active expire keys, if it is
a replica.
2020-03-25 15:54:34 +01:00
WuYunlong
23ccd476b7 Add 14-consistency-check.tcl to prove there is a data consistency issue. 2020-03-25 15:54:34 +01:00
antirez
91af3f73e1 Regression test for #7011. 2020-03-25 15:54:34 +01:00
antirez
21c22bcd9a ACL: default user off should not allow automatic authentication.
This fixes issue #7011.
2020-03-25 15:54:34 +01:00
antirez
63e4a47010 Sentinel: document auth-user directive. 2020-03-25 15:54:34 +01:00
antirez
d9f9a29afa ACL: Make Redis 6 more backward compatible with requirepass.
Note that this as a side effect fixes Sentinel "requirepass" mode.
2020-03-25 15:54:34 +01:00
antirez
31707f25c7 Sentinel: implement auth-user directive for ACLs. 2020-03-25 15:54:34 +01:00
zhaozhao.zz
714ae38ee1 Threaded IO: bugfix client kill may crash redis 2020-03-25 15:54:34 +01:00
zhaozhao.zz
db4f03bc51 Threaded IO: handle pending reads clients ASAP after event loop 2020-03-25 15:54:34 +01:00
antirez
077165b6eb Example sentinel conf: document requirepass. 2020-03-25 15:54:34 +01:00
antirez
352ea2365f Aesthetic changes in PR #6989. 2020-03-25 15:54:34 +01:00
zhaozhao.zz
d3491c5182 Threaded IO: bugfix #6988 process events while blocked 2020-03-25 15:54:34 +01:00
antirez
07c75f60f3 Restore newline at the end of redis-cli.c 2020-03-25 15:54:34 +01:00
chendianqiang
1994eda07e use correct list for moduleUnregisterUsedAPI 2020-03-25 15:54:34 +01:00
guodongxiaren
0fd48a7c53 string literal should be const char* 2020-03-25 15:54:34 +01:00
Itamar Haber
2eec521f8c Adds keyspace notifications to migrate and restore 2020-03-25 15:54:34 +01:00
bodong.ybd
a8f56fbfcd Remove duplicate obj files in Makefile 2020-03-25 15:54:34 +01:00
bodong.ybd
c609bf3f2c Fix bug of tcl test using external server 2020-03-25 15:54:34 +01:00
fengpf
e8c11fe29d fix comments in latency.c 2020-03-25 15:54:34 +01:00
antirez
317496405a Update linenoise. 2020-03-12 15:53:47 +01:00
lifubang
8e3c92fff8 add askpass mode
Signed-off-by: lifubang <lifubang@acmcoder.com>
2020-03-12 15:53:47 +01:00
lifubang
109296b438 update linenoise to fc9667a81d
Signed-off-by: lifubang <lifubang@acmcoder.com>
2020-03-12 15:53:47 +01:00
Jamie Scott
6e3f53a46f Remove default guidance in Redis.conf
Removing the default guidance in Redis.conf since this is not an available value.
2020-03-12 15:53:47 +01:00
Jamie Scott
2880ed0b90 Update Redis.conf to improve TLS usability
When using TLS with a Redis.conf file the line for TLS reading tls-cert-file redis.crt tls-key-file redis.key is interpreted as one complete directive. I am separating this on two separate lines to improve usability so users do not get the below error.

ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ ./src/redis-server redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 145
>>> 'tls-cert-file redis.crt tls-key-file redis.key'
wrong number of arguments
ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ vi redis.conf 
ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ ./src/redis-server redis.conf 
23085:C 04 Mar 2020 01:58:12.631 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23085:C 04 Mar 2020 01:58:12.631 # Redis version=5.9.101, bits=64, commit=00000000, modified=0, pid=23085, just started
23085:C 04 Mar 2020 01:58:12.631 # Configuration loaded
23085:M 04 Mar 2020 01:58:12.632 * Increased maximum number of open files to 10032 (it was originally set to 1024).
2020-03-12 15:53:47 +01:00
Johannes Truschnigg
9f1b635067 Signal systemd readiness atfer Partial Resync
"Partial Resynchronization" is a special variant of replication success
that we have to tell systemd about if it is managing redis-server via a
Type=Notify service unit.
2020-03-12 15:53:47 +01:00
Oran Agra
cde46df309 fix for flaky psync2 test
*** [err]: PSYNC2: total sum of full synchronizations is exactly 4 in tests/integration/psync2.tcl
Expected 5 == 4 (context: type eval line 6 cmd {assert {$sum == 4}} proc ::test)

issue was that sometime the test got an unexpected full sync since it
tried to switch to the replica before it was in sync with it's master.
2020-03-12 15:53:47 +01:00
antirez
75d5ed8938 ae.c: fix crash when resizing the event loop.
See #6964. The root cause is that the event loop may be resized from an
event callback itself, causing the event pointer to be invalid.
2020-03-12 15:53:47 +01:00
antirez
ac4e639df5 Fix release notes spelling mistake. 2020-03-06 11:09:52 +01:00
antirez
c208956fbe Redis 6 RC2. 2020-03-05 16:00:17 +01:00
qetu3790
6bd9b67488 Fix not used constant in lru_test_mode.
LRU_CYCLE_PERIOD is defined,but not used.
2020-03-05 12:51:15 +01:00
hwware
92ebd0aff7 add missing file marco 2020-03-05 12:51:15 +01:00
ShooterIT
02d1a6091b Avoid compiler warnings 2020-03-05 12:51:15 +01:00
antirez
5b721f6abb RDB deletion: document it in example redis.conf. 2020-03-05 12:51:15 +01:00
antirez
749a4e962a Make sync RDB deletion configurable. Default to no. 2020-03-05 12:51:15 +01:00
antirez
a0fec660f6 Check that the file exists in removeRDBUsedToSyncReplicas(). 2020-03-05 12:51:15 +01:00
antirez
93328171ca Log RDB deletion in persistence-less instances. 2020-03-05 12:51:14 +01:00
antirez
00e53fb140 Introduce bg_unlink(). 2020-03-05 12:51:14 +01:00
antirez
e91ca9fee9 Remove RDB files used for replication in persistence-less instances. 2020-03-05 12:51:14 +01:00
antirez
dcafd2d77e Use a smaller getkeys global buffer.
The idea is that very few commands have a lot of keys, and when this
happens the allocation time becomes neglegible.
2020-03-05 12:51:14 +01:00
Oran Agra
328b6e473c Optimize temporary memory allocations for getKeysFromCommand mechanism
now that we may use it more often (ACL), these excessive calls to malloc
and free can become an overhead.
2020-03-05 12:51:14 +01:00
antirez
8a7e1fe3b0 Modules: reformat RM_Scan() top comment a bit. 2020-03-05 12:51:14 +01:00
antirez
76cfe21ff7 Modules: more details in RM_Scan API top comment. 2020-03-05 12:51:14 +01:00
Oran Agra
0693ac1961 RM_Scan disable dict rehashing
The callback approach we took is very efficient, the module can do any
filtering of keys without building any list and cloning strings, it can
also read data from the key's value. but if the user tries to re-open
the key, or any other key, this can cause dict re-hashing (dictFind does
that), and that's very bad to do from inside dictScan.

this commit protects the dict from doing any rehashing during scan, but
also warns the user not to attempt any writes or command calls from
within the callback, for fear of unexpected side effects and crashes.
2020-03-05 12:51:14 +01:00
Guy Benoish
470de731e9 Add RM_CreateStringFromDouble 2020-03-05 12:51:14 +01:00