768 Commits

Author SHA1 Message Date
John Sully
a1d9c2e827 use serverAssert() instead of assert() to get callstacks in fastlock
Former-commit-id: 45535e8a6377963dce5b158a9a6e448c5c22a0a8
2020-04-28 22:41:07 -04:00
John Sully
ad06da5655 shared pointer comparisons with other pointers
Former-commit-id: d5ede50b040c82e02eb2b82982091bdd0fb7da12
2020-04-24 22:20:26 -04:00
John Sully
c498381b1a Merge branch 'unstable' into redis_6_merge
Former-commit-id: cc9924ffa606200f331b3bf5e1e1a4aa3f2702fa
2020-04-15 23:00:13 -04:00
John Sully
34131bf287 During AOF reload we can erroneously read incorrect aof_state values, so this variable must be read with the global lock acquired
Former-commit-id: 6ff9d23fd4541a011d754209d9fda3ef3af4a7f9
2020-04-15 22:30:19 -04:00
John Sully
bbb08af294 Convert variables accessed outside lock to atomics
Former-commit-id: b0796ff5fd7e069a2fadbfd968f7bbb2020edd2d
2020-04-15 22:25:17 -04:00
John Sully
d3ebe3b6bd Merge tag '6.0-rc3' into redis_6_merge
Redis 6.0 RC3.


Former-commit-id: b2cb10de5f39b4d8e1ee19877c2bdaf19eefd9db
2020-04-14 22:56:19 -04:00
John Sully
68fd7c5c3d Merge commit 'c3b268a0bcded2d730790a772176483efb7c31fb' into redis_6_merge
Former-commit-id: 50768cd242c0360c6e943c57f866789280d30dc0
2020-04-14 22:25:44 -04:00
John Sully
02147b4be0 Merge commit '0f7dfc378ce5ab0524ac28b6142545bc41435386' into redis_6_merge
Former-commit-id: cc3ebbe5194e9744fb84ce490e90ac5fbe7f8716
2020-04-14 22:19:29 -04:00
John Sully
b20093e2f3 Merge commit 'e74e68c84f5eba8013769087c9a46cab811b8417' into redis_6_merge
Former-commit-id: 2825e515504cffcf6000be2e547ab1cbd86441bc
2020-04-14 20:55:29 -04:00
John Sully
f27524674a Merge commit '973297336fc05a601e17be70aba88e5dca6480ae' into redis_6_merge
Former-commit-id: ef1236b6009ebd7b00f6dd2f43df57ad95e51253
2020-04-14 20:19:48 -04:00
John Sully
d57fa7c8f9 Merge commit '349aa24511253b3e323064b95cefb4414f31726c' into redis_6_merge
Former-commit-id: 28cbed1d13961c5568f2bdc50c6a23107d3434d0
2020-04-14 20:09:53 -04:00
John Sully
12999c17dd Merge commit 'df83892760d19b1b7e92d76e72daf4834ad2df6c' into redis_6_merge
Former-commit-id: cde199a7973ad63317b68f581df607321e12bf46
2020-04-14 19:43:04 -04:00
John Sully
947bf289a5 Merge commit 'f42ce57d0f7eee6705fb0a81714cabe97a4f2c0a' into redis_6_merge
Former-commit-id: 5589a0a69ca6f5798b750a6a79f7e9b44d20e136
2020-04-14 19:22:44 -04:00
John Sully
5dbcd55669 Merge commit '51c1a9f8fbc12a9276489178242e498bb6ccbdba' into redis_6_merge
Former-commit-id: 09e8fb17cd0889ad17461e48446221b3955f5a8f
2020-04-14 18:44:42 -04:00
antirez
0fac746f0e PSYNC2: meaningful offset implemented.
A very commonly signaled operational problem with Redis master-replicas
sets is that, once the master becomes unavailable for some reason,
especially because of network problems, many times it wont be able to
perform a partial resynchronization with the new master, once it rejoins
the partition, for the following reason:

1. The master becomes isolated, however it keeps sending PINGs to the
replicas. Such PINGs will never be received since the link connection is
actually already severed.
2. On the other side, one of the replicas will turn into the new master,
setting its secondary replication ID offset to the one of the last
command received from the old master: this offset will not include the
PINGs sent by the master once the link was already disconnected.
3. When the master rejoins the partion and is turned into a replica, its
offset will be too advanced because of the PINGs, so a PSYNC will fail,
and a full synchronization will be required.

Related to issue #7002 and other discussion we had in the past around
this problem.


Former-commit-id: 5d6e8fe3e3e43162f0c57f580b6e8432274fca30
2020-04-14 17:56:09 -04:00
antirez
34f7c653d5 Remove RDB files used for replication in persistence-less instances.
Former-commit-id: b323645227a3e2cc5928e649586221aba508b10d
2020-04-14 17:27:05 -04:00
Guy Benoish
234e6e7b09 Diskless-load emptyDb-related fixes
1. Call emptyDb even in case of diskless-load: We want modules
   to get the same FLUSHDB event as disk-based replication.
2. Do not fire any module events when flushing the backups array.
3. Delete redundant call to signalFlushedDb (Called from emptyDb).


Former-commit-id: aa8a3077a2d20e66e34f72f2860d0cc3daad496e
2020-04-14 17:21:10 -04:00
John Sully
6f15ce125c Add the ability to set a starting core # when setting thread affinity
Former-commit-id: 9e2e2067c6df5919f1c6b8b9e6e3457c7edc0755
2020-04-04 22:58:17 -04:00
John Sully
eeca58777d Fix subkey expires not replicating correctly, and AOF issues
Former-commit-id: bd183cdee13081a02efef5df75edf2292b872a16
2020-04-04 21:52:27 -04:00
Guy Benoish
a509400d58 Modules: Test MULTI/EXEC replication of RM_Replicate
Makse sure call() doesn't wrap replicated commands with
a redundant MULTI/EXEC

Other, unrelated changes:
1. Formatting compiler warning in INFO CLIENTS
2. Use CLIENT_ID_AOF instead of UINT64_MAX
2020-03-31 17:12:19 +02:00
antirez
c3b268a0bc timeout.c created: move client timeouts code there. 2020-03-31 16:57:20 +02:00
antirez
616b1cb7ac Fix module commands propagation double MULTI bug.
37a10cef introduced automatic wrapping of MULTI/EXEC for the
alsoPropagate API. However this collides with the built-in mechanism
already present in module.c. To avoid complex changes near Redis 6 GA
this commit introduces the ability to exclude call() MUTLI/EXEC wrapping
for also propagate in order to continue to use the old code paths in
module.c.
2020-03-31 16:57:20 +02:00
antirez
67643ead69 Precise timeouts: cleaup the table on unblock.
Now that this mechanism is the sole one used for blocked clients
timeouts, it is more wise to cleanup the table when the client unblocks
for any reason. We use a flag: CLIENT_IN_TO_TABLE, in order to avoid a
radix tree lookup when the client was already removed from the table
because we processed it by scanning the radix tree.
2020-03-31 16:56:46 +02:00
antirez
ad94066ec8 Precise timeouts: fix comments after functional change. 2020-03-31 16:56:46 +02:00
antirez
a443ec2e9a Precise timeouts: use only radix tree for timeouts. 2020-03-31 16:56:46 +02:00
antirez
7add0f2490 Precise timeouts: working initial implementation. 2020-03-31 16:56:46 +02:00
antirez
9d6d177994 Precise timeouts: refactor unblocking on timeout. 2020-03-31 16:56:46 +02:00
伯成
11db53f875 Boost up performance for redis PUB-SUB patterns matching
If lots of clients PSUBSCRIBE to same patterns, multiple pattens matching will take place. This commit change it into just one single pattern matching by using a `dict *` to store the unique pattern and which clients subscribe to it.
2020-03-31 12:47:14 +02:00
John Sully
aaa751acb8 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 908cf5042ebcd7870166bd1a0bb450f37e5f3b4d
2020-03-25 22:12:22 -04:00
John Sully
356ed25c62 Fix issue #143
Former-commit-id: 6ec1641294b23e22a2a5dc5cc6098a02ce234df3
2020-03-25 21:55:31 -04:00
antirez
5f72f69688 PSYNC2: meaningful offset implemented.
A very commonly signaled operational problem with Redis master-replicas
sets is that, once the master becomes unavailable for some reason,
especially because of network problems, many times it wont be able to
perform a partial resynchronization with the new master, once it rejoins
the partition, for the following reason:

1. The master becomes isolated, however it keeps sending PINGs to the
replicas. Such PINGs will never be received since the link connection is
actually already severed.
2. On the other side, one of the replicas will turn into the new master,
setting its secondary replication ID offset to the one of the last
command received from the old master: this offset will not include the
PINGs sent by the master once the link was already disconnected.
3. When the master rejoins the partion and is turned into a replica, its
offset will be too advanced because of the PINGs, so a PSYNC will fail,
and a full synchronization will be required.

Related to issue #7002 and other discussion we had in the past around
this problem.
2020-03-25 15:55:24 +01:00
bodong.ybd
b3e4abf06e Added BITFIELD_RO variants for read-only operations. 2020-03-25 15:55:24 +01:00
WuYunlong
0578157d56 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
antirez
9c2e42ddfc 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
127e09bca1 Make sync RDB deletion configurable. Default to no. 2020-03-05 12:51:15 +01:00
antirez
be4bc1a5be Remove RDB files used for replication in persistence-less instances. 2020-03-05 12:51:14 +01:00
John Sully
0114827642 Fix CLANG build break
Former-commit-id: 5e63c0955d2861ab0ebe2055d4f2d2e8989ea4f3
2020-03-04 17:24:17 -05:00
John Sully
b3e33daf7d Fix CLANG build break
Former-commit-id: c2a98a60f964f28455a5d04e18b88a9a45c9e586
2020-03-04 17:23:40 -05:00
John Sully
a669a40ac6 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 52fd4445a472fa3112e96c6a7ef66ecdfe6ce9f5
2020-03-04 17:13:01 -05:00
John Sully
de2b08c3f8 Add extra logging when reporting errors from masters - especially in rreplay
Former-commit-id: 5397f0b03312b8cace07a85333d8f035bdfb8d57
2020-03-04 17:09:12 -05:00
antirez
b439542604 Tracking: optin/out implemented. 2020-02-27 18:02:30 +01:00
antirez
f15fb727a0 Tracking: fix max-keys configuration directive. 2020-02-27 18:00:46 +01:00
antirez
3c16d6b32d Tracking: first conversion from hashing to key names. 2020-02-27 17:59:57 +01:00
antirez
d4fe79a174 Tracking: BCAST: broadcasting of keys in prefixes implemented. 2020-02-27 17:59:57 +01:00
antirez
abb81c6351 Tracking: BCAST: registration in the prefix table. 2020-02-27 17:59:57 +01:00
antirez
77da960815 Tracking: BCAST: parsing of the options + skeleton. 2020-02-27 17:59:57 +01:00
antirez
a788c373e6 Tracking: minor change of names and new INFO field. 2020-02-27 17:59:57 +01:00
John Sully
79e945f5e5 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 6a71de7835f427cebb23e4c2f0d19ed63a02f09e
2020-02-16 19:14:51 -05:00
John Sully
47f98259f9 Support C++14 and remove dependency on future standard 2a
Former-commit-id: 18496b62853738bf7bd48f65fe34aafcba8bbe0b
2020-02-16 19:04:56 -05:00
John Sully
4d01660331 Graceful shutdown of server threads when quit is requested
Former-commit-id: b9db899f6ccea62222170c6eec264d403a7a911d
2020-02-16 18:53:46 -05:00