10327 Commits

Author SHA1 Message Date
ShooterIT
e60f63a718 Replace addDeferredMultiBulkLength with addReplyDeferredLen in comment 2020-05-22 12:37:49 +02:00
Yossi Gottlieb
26143c2936 TLS: Improve tls-protocols clarity in redis.conf. 2020-05-22 12:37:49 +02:00
ShooterIT
9d1265240f Fix reply bytes calculation error
Fix #7275.
2020-05-22 12:37:49 +02:00
zhaozhao.zz
830c674845 Tracking: flag CLIENT_TRACKING_BROKEN_REDIR when redir broken 2020-05-22 12:37:49 +02:00
Oran Agra
56d63f4d7d 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
4f8e19f877 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
hujie
6bb5b6d942 fix clear USER_FLAG_ALLCOMMANDS flag in acl
in ACLSetUserCommandBit, when the command bit overflows, no operation
is performed, so no need clear the USER_FLAG_ALLCOMMANDS flag.

in ACLSetUser, when adding subcommand, we don't need to call
ACLGetCommandID ahead since subcommand may be empty.
2020-05-22 12:37:49 +02:00
ShooterIT
2478a83ce7 Redis Benchmark: generate random test data
The function of generating random data is designed by antirez. See #7196.
2020-05-22 12:37:49 +02:00
hwware
3ffb3ac7ea Redis-Benchmark: avoid potentical memmory leaking 2020-05-22 12:37:49 +02:00
WuYunlong
65de5a1a7d Handle keys with hash tag when computing hash slot using tcl cluster client. 2020-05-22 12:37:49 +02:00
WuYunlong
71036d4cdb Add a test to prove current tcl cluster client can not handle keys with hash tag. 2020-05-22 12:37:49 +02:00
ShooterIT
e113af7448 Use dictSize to get the size of dict in dict.c 2020-05-22 12:37:49 +02:00
Madelyn Olson
1d84b89fb6 Converge hash validation for adding and removing 2020-05-22 12:37:49 +02:00
Benjamin Sergeant
5d88c23555 do not handle --cluster-yes for cluster fix mode 2020-05-22 12:37:49 +02:00
Benjamin Sergeant
dc2f7e0ad7 fix typo ... 2020-05-22 12:37:49 +02:00
Benjamin Sergeant
902e82efd2 Redis-cli 6.0.1 --cluster-yes doesn't work (fix #7246)
This make it so that all prompts for all redis-cli --cluster commands are automatically answered with a yes.
2020-05-22 12:37:49 +02:00
Oran Agra
7d8259d151 fix valgrind test failure in replication test
in 00323f342 i added more keys to that test to make it run longer
but in valgrind this now means the test times out, give valgrind more
time.
2020-05-22 12:37:49 +02:00
Oran Agra
5e75739bfd add regression test for the race in #7205
with the original version of 6.0.0, this test detects an excessive full
sync.
with the fix in 146201c69, this test detects memory corruption,
especially when using libc allocator with or without valgrind.
2020-05-22 12:37:49 +02:00
antirez
3d478f2e3f Improve the PSYNC2 test reliability. 2020-05-22 12:37:49 +02:00
John Sully
2fa3fb9573 Merge tag '6.0.1' into unstable
Redis 6.0.1.


Former-commit-id: c505df8830123904da026be2aacbd92a95a5e37c
2020-05-21 23:41:36 -04:00
John Sully
6402c28d5c Missing noexcept
Former-commit-id: f214ada545f810f8a9095753984b75c438cd6464
2020-05-21 23:25:50 -04:00
John Sully
62261642cc build failure on macos
Former-commit-id: c10aa3b8b0811da9931745695c5de06fdfa99fe3
2020-05-21 23:24:34 -04:00
John Sully
193d7c76cb Fix bad merge in CI.yml
Former-commit-id: 6311d709c39b3bacaeab77b18033010f1b548f81
2020-05-21 22:09:06 -04:00
John Sully
e245fdbb89 Merge commit '97e58ee026675e70fbd8843f7a86e98f53a3c791' into unstable
Former-commit-id: 8ab77465dbb3c0b1f859f24cdbb461937516eb6a
2020-05-21 19:37:42 -04:00
John Sully
cc8d7c1afd Merge commit '3b373fbb0b05ee862dfef32199cfb63459019cd9' into unstable
Former-commit-id: 201bf73ef772914c56ac680bb9c7fb6a98b218b2
2020-05-21 18:57:28 -04:00
John Sully
ccedb2fa73 Merge commit 'd7b07d3ded06b4cd843baffd3a6d33dd96efd401' into unstable
Former-commit-id: 49784c8122e827bd9de86bbae4d88c313400e86e
2020-05-21 18:48:49 -04:00
John Sully
8377df8330 Merge commit '87924d673138531cbaf606015ea7b6a9e3ae2465' into unstable
Former-commit-id: 3e03f308b564cd94f4a6407c80792d080e0f83c5
2020-05-21 17:55:09 -04:00
John Sully
327d543f2c Merge commit 'c5d805f87771581d3f6b29861ed2062c0ae2a688' into unstable
Former-commit-id: 95cecb0229af0278cf614ffd746ba829ae7c897c
2020-05-21 17:45:15 -04:00
John Sully
4246199553 Merge commit '7cb94fd6cc9e1ad106964171023457ae3ff0a40b' into unstable
Former-commit-id: 7676f5b15f24a044257250b8891d23b14642da48
2020-05-21 17:36:53 -04:00
John Sully
b47d7715a4 Merge commit '71134e357ffd6ced7c40c145205dbbac173ee181' into unstable
Former-commit-id: d5b057534a3dbf50f94465332107da2490811946
2020-05-21 17:32:53 -04:00
John Sully
5935707790 Merge commit '2535a172c1247d5d32d6f2fefe51b95c27ba8ae1' into unstable
Former-commit-id: 7a15f6dfc7331d6759201137971e7c2965672be8
2020-05-21 17:30:56 -04:00
John Sully
903aeda836 Override missing new, fix new/delete mismatch
Former-commit-id: 712d825c233c3ebbc49b22b8c1865916ca9dc3bc
2020-05-20 15:57:08 -04:00
antirez
8ca98ae414 Redis 6.0.3. 2020-05-16 18:11:58 +02:00
antirez
ae73a26f14 Remove the client from CLOSE_ASAP list before caching the master.
This was broken in 146201c: we identified a crash in the CI, what
was happening before the fix should be like that:

1. The client gets in the async free list.
2. However freeClient() gets called again against the same client
   which is a master.
3. The client arrived in freeClient() with the CLOSE_ASAP flag set.
4. The master gets cached, but NOT removed from the CLOSE_ASAP linked
   list.
5. The master client that was cached was immediately removed since it
   was still in the list.
6. Redis accessed a freed cached master.

This is how the crash looked like:

=== REDIS BUG REPORT START: Cut & paste starting from here ===
1092:S 16 May 2020 11:44:09.731 # Redis 999.999.999 crashed by signal: 11
1092:S 16 May 2020 11:44:09.731 # Crashed running the instruction at: 0x447e18
1092:S 16 May 2020 11:44:09.731 # Accessing address: 0xffffffffffffffff
1092:S 16 May 2020 11:44:09.731 # Failed assertion:  (:0)

------ STACK TRACE ------
EIP:
src/redis-server 127.0.0.1:21300(readQueryFromClient+0x48)[0x447e18]

And the 0xffff address access likely comes from accessing an SDS that is
set to NULL (we go -1 offset to read the header).
2020-05-16 18:04:17 +02:00
antirez
38cc6cbbb4 Redis 6.0.2. 2020-05-15 22:29:52 +02:00
Yossi Gottlieb
114d06ea1f TLS: Fix test failures on recent Debian/Ubuntu.
Seems like on some systems choosing specific TLS v1/v1.1 versions no
longer works as expected. Test is reduced for v1.2 now which is still
good enough to test the mechansim, and matters most anyway.
2020-05-15 22:23:24 +02:00
Yossi Gottlieb
c8b490b216 TLS: Add crypto locks for older OpenSSL support.
This is really required only for older OpenSSL versions.

Also, at the moment Redis does not use OpenSSL from multiple threads so
this will only be useful if modules end up doing that.
2020-05-15 22:23:24 +02:00
David Carlier
b1e21f4672 NetBSD build update.
This platform supports CPU affinity (but not OpenBSD).
2020-05-15 22:23:24 +02:00
Madelyn Olson
a7ba7a2e9e Added a refcount on timer events to prevent deletion of recursive timer calls 2020-05-15 22:23:24 +02:00
antirez
22a6d152f3 Cache master without checking of deferred close flags.
The context is issue #7205: since the introduction of threaded I/O we close
clients asynchronously by default from readQueryFromClient(). So we
should no longer prevent the caching of the master client, to later
PSYNC incrementally, if such flags are set. However we also don't want
the master client to be cached with such flags (would be closed
immediately after being restored). And yet we want a way to understand
if a master was closed because of a protocol error, and in that case
prevent the caching.
2020-05-15 22:23:24 +02:00
John Sully
fe8acd0b30 Remove debugging logs
Former-commit-id: 407375887429ebd3efd6e21ae58766397d1324d3
2020-05-14 22:18:29 -04:00
antirez
9d7e2fef3d Track events processed while blocked globally.
Related to #7234.
2020-05-14 11:29:43 +02:00
antirez
e1b134e972 Some rework of #7234. 2020-05-14 11:29:43 +02:00
Oran Agra
a3dd04410d fix redis 6.0 not freeing closed connections during loading.
This bug was introduced by a recent change in which readQueryFromClient
is using freeClientAsync, and despite the fact that now
freeClientsInAsyncFreeQueue is in beforeSleep, that's not enough since
it's not called during loading in processEventsWhileBlocked.
furthermore, afterSleep was called in that case but beforeSleep wasn't.

This bug also caused slowness sine the level-triggered mode of epoll
kept signaling these connections as readable causing us to keep doing
connRead again and again for ll of these, which keep accumulating.

now both before and after sleep are called, but not all of their actions
are performed during loading, some are only reserved for the main loop.

fixes issue #7215
2020-05-14 11:29:43 +02:00
antirez
60a6f16ced Regression test for #7249. 2020-05-14 11:29:43 +02:00
antirez
9ad227dca8 rax.c updated from upstream antirez/rax. 2020-05-14 11:29:43 +02:00
antirez
0b21426a45 Tracking: send eviction messages when evicting entries.
A fix for #7249.
2020-05-14 11:29:43 +02:00
Oran Agra
5258341880 fix unstable replication test
this test which has coverage for varoius flows of diskless master was
failing randomly from time to time.

the failure was:
[err]: diskless all replicas drop during rdb pipe in tests/integration/replication.tcl
log message of '*Diskless rdb transfer, last replica dropped, killing fork child*' not found

what seemed to have happened is that the master didn't detect that all
replicas dropped by the time the replication ended, it thought that one
replica is still connected.

now the test takes a few seconds longer but it seems stable.
2020-05-14 11:29:43 +02:00
John Sully
14e32ff682 Update ci.yml
Former-commit-id: d4b1d3f755f7c1f6ca4642b5258b4a5157eacb5a
2020-05-12 01:06:08 -04:00
John Sully
27e605293e Update ci.yml
Former-commit-id: d06c6c67ea36a21e515390405a0f947a23ec4b42
2020-05-11 22:09:27 -04:00