12236 Commits

Author SHA1 Message Date
John Sully
9ba82f9083 Complete TLS merge
Former-commit-id: 856d23023259d59ce766e9cd00526de0e7d06c2f
2020-05-26 01:38:29 -04:00
John Sully
d50c0c5ba3 Merge branch 'unstable' into keydbpro
Former-commit-id: b0636273806ce323627ce31c1ad7f86ceb39696d
2020-05-26 01:34:19 -04:00
John Sully
2bb0be3a96 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 1449c8b9fe647288da7de0ff10cc68ada4be8f92
2020-05-26 01:29:08 -04:00
John Sully
d7fa406a0e Fix client tracking, also ensure tracking tests are enabled
Former-commit-id: 1938af27f50f9686dc98b4839fb439cc03b4a250
2020-05-26 01:28:52 -04:00
antirez
2e591fc4a4 Clarify what is happening in PR #7320. 2020-05-25 12:08:01 +02:00
zhaozhao.zz
cbb51fb8f9 PSYNC2: second_replid_offset should be real meaningful offset
After adjustMeaningfulReplOffset(), all the other related variable
should be updated, including server.second_replid_offset.

Or the old version redis like 5.0 may receive wrong data from
replication stream, cause redis 5.0 can sync with redis 6.0,
but doesn't know meaningful offset.
2020-05-25 12:08:01 +02:00
Oran Agra
e0fc88b4d9 add CI for 32bit build 2020-05-25 12:08:01 +02:00
antirez
e3f864b5fd Make disconnectSlaves() synchronous in the base case.
Otherwise we run into that:

Backtrace:
src/redis-server 127.0.0.1:21322(logStackTrace+0x45)[0x479035]
src/redis-server 127.0.0.1:21322(sigsegvHandler+0xb9)[0x4797f9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fd373c5e390]
src/redis-server 127.0.0.1:21322(_serverAssert+0x6a)[0x47660a]
src/redis-server 127.0.0.1:21322(freeReplicationBacklog+0x42)[0x451282]
src/redis-server 127.0.0.1:21322[0x4552d4]
src/redis-server 127.0.0.1:21322[0x4c5593]
src/redis-server 127.0.0.1:21322(aeProcessEvents+0x2e6)[0x42e786]
src/redis-server 127.0.0.1:21322(aeMain+0x1d)[0x42eb0d]
src/redis-server 127.0.0.1:21322(main+0x4c5)[0x42b145]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd3738a3830]
src/redis-server 127.0.0.1:21322(_start+0x29)[0x42b409]

Since we disconnect all the replicas and free the replication backlog in
certain replication paths, and the code that will free the replication
backlog expects that no replica is connected.

However we still need to free the replicas asynchronously in certain
cases, as documented in the top comment of disconnectSlaves().
2020-05-25 12:08:01 +02:00
ShooterIT
8af1e513f6 Implements sendfile for redis. 2020-05-25 12:08:01 +02:00
antirez
3c21418cd8 Fix #7306 less aggressively.
Citing from the issue:

btw I suggest we change this fix to something else:
* We revert the fix.
* We add a call that disconnects chained replicas in the place where we trim the replica (that is a master i this case) offset.
This way we can avoid disconnections when there is no trimming of the backlog.

Note that we now want to disconnect replicas asynchronously in
disconnectSlaves(), because it's in general safer now that we can call
it from freeClient(). Otherwise for instance the command:

    CLIENT KILL TYPE master

May crash: clientCommand() starts running the linked of of clients,
looking for clients to kill. However it finds the master, kills it
calling freeClient(), but this in turn calls replicationCacheMaster()
that may also call disconnectSlaves() now. So the linked list iterator
of the clientCommand() will no longer be valid.
2020-05-25 12:08:01 +02:00
Maxime de Roucy
b9b4b4cfde acl: @replication command group
containing mandatory commands for replication (used by masteruser user)


Former-commit-id: 123bc125cfe7b30fdeef833759a33ccc854b5c51
2020-05-25 02:35:22 -04:00
John Sully
c15802af8b Fix issue #170. Intermittent crash destroying fastlock due to implicit type conversion in assert
Former-commit-id: ecbe168b5421687899a621c995e44f43faec2b71
2020-05-25 02:13:57 -04:00
John Sully
fa671d5193 Fix infinite logs of Error in rreplay
Former-commit-id: 00cef78858cd05fc067fa5002f2995653452c63f
2020-05-24 20:05:22 -04:00
John Sully
fcfff165da Enable TLS connections
Former-commit-id: d05da0fabdfeb7eadce6546c7c1d85739b2794d7
2020-05-24 19:57:16 -04:00
John Sully
15bf66b922 Fix test failures
Former-commit-id: c0b2263478d79f33d04ed409a68caa312884fa4c
2020-05-24 18:33:15 -04:00
John Sully
69b550d91a Fix crash on shutdown with snapshots pending
Former-commit-id: 124e79a81d6995ea7d5ba39d1830b591b705acbf
2020-05-24 17:11:56 -04:00
John Sully
7d3ed909eb Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 9e473a9957f274f641ddad16d67d848f9a3c93c1
2020-05-24 14:47:55 -04:00
John Sully
cece963cf3 Merge branch 'unstable' into keydbpro
Former-commit-id: a830cf85df236885558c5571c0bf23cfb23e3655
2020-05-24 14:41:53 -04:00
John Sully
0a1d2c99ac don't keep feeding data to clients pending close
Former-commit-id: 4db3f2a443a6f71d1486781005ee37546e89d6e1
2020-05-24 12:46:11 -04:00
John Sully
975ca828d4 Quiet TSAN during exit
Former-commit-id: fd710d590a6297b74e06ce6832dd75bfca0a266f
2020-05-24 12:45:10 -04:00
John Sully
70f3eab882 Install deps for daily workflow
Former-commit-id: 9b98c9edd3e8c9316514b7f9e0efc7a9f8d17851
2020-05-24 11:19:53 -04:00
John Sully
23e1601276 Hold the AE lock until we process the repl backlog after a command
Former-commit-id: 4893eedacbf5f9210d02361ed07b9beee0c9f655
2020-05-24 11:19:23 -04:00
John Sully
b892d3deff Add standardized way to post client dependent functions
Former-commit-id: fb50163b47cf660911dc7f67809c15ba1394613a
2020-05-24 02:46:39 -04:00
John Sully
f517eaf182 remove unnecessary cplusplus guard
Former-commit-id: 3b8463f9d20162369cffd9ed347865c5c8049f40
2020-05-24 02:45:55 -04:00
John Sully
78b647bd6f race in connection state when setting a handler on a different thread
Former-commit-id: 42c7677690c434168135992429f7521239475ef8
2020-05-24 02:45:11 -04:00
John Sully
dc27b95a47 Fix ASAN races
Former-commit-id: 8665f250314c4e3de32f3b31a2c0158908ef982b
2020-05-24 01:58:33 -04:00
John Sully
cc080de221 Incorrect locking in replication error paths
Former-commit-id: 1c6b57314747787958ad215826296627f9050f59
2020-05-24 01:57:49 -04:00
John Sully
51976e2be8 Incorrect memory order on weak ordered architectures
Former-commit-id: 90162da1a6c025d148a0d1761ae4d5fbc9bfc0ef
2020-05-24 01:57:18 -04:00
John Sully
926da1f899 If we request shutdown from a client on a different thread than a blocking lua script we fail to actually shutdown until the script completes
Former-commit-id: 1ca6c1dd56131bc28fe9f831e2b9cab7adb846a3
2020-05-24 01:56:23 -04:00
John Sully
de376acb15 race calculating client overhead
Former-commit-id: 2d27c8ecdb5242284301f135b1d542f9ead5b8f2
2020-05-24 01:53:43 -04:00
John Sully
18b8a83ecb During RDB load we can only handle clients on the main thread as our workers are not yet created. This change also unifies the accept logic across the socket types
Former-commit-id: 59cda9cfb96eca55c4b445309970bd95277ebc5c
2020-05-23 16:03:24 -04:00
John Sully
5d9afccfdd Diskless replication handler needs to run on the main thread
Former-commit-id: 091af6400348b7716f7fe0bc845bf7f16d922815
2020-05-23 15:15:42 -04:00
ShooterIT
23b4dc503a Fix reply bytes calculation error
Fix #7275.


Former-commit-id: a12210c87561fed5522c9a6e8db6d8606cabe3bf
2020-05-23 13:02:55 -04:00
John Sully
db7f0572a3 Merge tag '6.0.3' into unstable
Redis 6.0.3


Former-commit-id: 43649fc5b4425fb05e2c1aa48da7c07bc83ce24d
2020-05-22 16:53:10 -04:00
John Sully
7e53a312ce Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 01cc25653ab7d797f6a466f18d540517d5003f5f
2020-05-22 16:45:27 -04:00
John Sully
2d783a3cbf Merge tag '6.0.2' into unstable
Redis 6.0.2


Former-commit-id: a010e4a4b2cc2bcad1cb14604b7ebc596c35b05e
2020-05-22 16:45:18 -04:00
John Sully
67b7d512cb Merge commit 'cb683a84f7a9d530bec629f2b656e7d0842a0f75' into unstable
Former-commit-id: 817a11ff110772893eda0675912bbb0cfc1fca74
2020-05-22 15:56:35 -04:00
John Sully
df7ac419d0 Merge commit '3a441c7d95c8757d2ab12ff730cc7ca8899538c9' into unstable
Former-commit-id: c52e1fc78c369843e49a22765bed2c53e99d9709
2020-05-22 15:42:50 -04:00
John Sully
1eeb5de69f Merge commit 'c57d9146f41f4b661d9d2cb48b83b3abc757ba0e' into unstable
Former-commit-id: d74871da40dea11bd1a226fbecb0974ff5f8ec8c
2020-05-22 15:36:44 -04:00
John Sully
bc1f7d6d45 Update README.md
Former-commit-id: a25cf15ecd6e7a013f4b653b3b103c9e9227af3a
2020-05-22 14:03:29 -04:00
Madelyn Olson
e201f83cee EAGAIN for tls during diskless load 2020-05-22 12:37:59 +02:00
Qu Chen
58fc456cbd Disconnect chained replicas when the replica performs PSYNC with the master always to avoid replication offset mismatch between master and chained replicas. 2020-05-22 12:37:59 +02:00
hwware
3febc5c29e using moreargs variable 2020-05-22 12:37:59 +02:00
hwware
8d67385593 fix server crash for STRALGO command 2020-05-22 12:37:49 +02:00
ShooterIT
7a35eec540 Replace addDeferredMultiBulkLength with addReplyDeferredLen in comment 2020-05-22 12:37:49 +02:00
Yossi Gottlieb
f93e1417b9 TLS: Improve tls-protocols clarity in redis.conf. 2020-05-22 12:37:49 +02:00
ShooterIT
d0c9e44545 Fix reply bytes calculation error
Fix #7275.
2020-05-22 12:37:49 +02:00
zhaozhao.zz
1cde6a0603 Tracking: flag CLIENT_TRACKING_BROKEN_REDIR when redir broken 2020-05-22 12:37:49 +02:00
Oran Agra
436be34986 fix a rare active defrag edge case bug leading to stagnation
There's a rare case which leads to stagnation in the defragger, causing
it to keep scanning the keyspace and do nothing (not moving any
allocation), this happens when all the allocator slabs of a certain bin
have the same % utilization, but the slab from which new allocations are
made have a lower utilization.

this commit fixes it by removing the current slab from the overall
average utilization of the bin, and also eliminate any precision loss in
the utilization calculation and move the decision about the defrag to
reside inside jemalloc.

and also add a test that consistently reproduce this issue.
2020-05-22 12:37:49 +02:00
Oran Agra
f9d2ffdc5d improve DEBUG MALLCTL to be able to write to write only fields.
also support:
  debug mallctl-str thread.tcache.flush VOID
2020-05-22 12:37:49 +02:00