7175 Commits

Author SHA1 Message Date
Salvatore Sanfilippo
83521eb832 Merge pull request #7196 from ShooterIT/benchmark
Redis Benchmark: make test data better
2020-05-19 16:16:38 +02:00
hwware
2b4f14387e Redis-Benchmark: avoid potentical memmory leaking 2020-05-18 22:10:57 -04:00
hujie
66214e3713 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-19 00:58:58 +08:00
ShooterIT
16c95dce51 Redis Benchmark: generate random test data
The function of generating random data is designed by antirez. See #7196.
2020-05-18 18:18:27 +08:00
Salvatore Sanfilippo
2b5759908a Merge pull request #7252 from ShooterIT/dictsize
Use dictSize to get the size of dict in dict.c
2020-05-18 10:33:08 +02:00
Salvatore Sanfilippo
4771af6a76 Merge pull request #7255 from madolson/dev-unstable-converge-hash-validation
Converge hash validation for adding and removing
2020-05-18 10:31:47 +02:00
Salvatore Sanfilippo
5c6631d941 Merge pull request #7247 from bsergean/patch-3
Redis-cli 6.0.1 `--cluster-yes` doesn't work (fix #7246)
2020-05-18 10:23:54 +02:00
antirez
492bbefdb0 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 17:15:35 +02:00
antirez
bf6bf4e8de Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-15 10:21:51 +02:00
antirez
146201c694 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 10:19:13 +02:00
Benjamin Sergeant
4bbf07dbbb do not handle --cluster-yes for cluster fix mode 2020-05-14 15:29:06 -07:00
Madelyn Olson
4e8d141cba Converge hash validation for adding and removing 2020-05-14 11:07:51 -07:00
Salvatore Sanfilippo
3a52c1c0ec Merge pull request #7230 from yossigo/tls-crypto-locks
TLS: Add crypto locks for older OpenSSL support.
2020-05-14 18:14:49 +02:00
Salvatore Sanfilippo
cff2fcb7c6 Merge pull request #7244 from devnexen/netbsd_build_fix
NetBSD build update.
2020-05-14 18:14:06 +02:00
Madelyn Olson
1bc06c7e85 Added a refcount on timer events to prevent deletion of recursive timer calls 2020-05-14 08:49:11 -07:00
antirez
17546e831e Merge branch 'free_clients_during_loading' into unstable 2020-05-14 11:28:08 +02:00
antirez
949521deb2 rax.c updated from upstream antirez/rax. 2020-05-14 11:17:47 +02:00
antirez
afcea23e1a Tracking: send eviction messages when evicting entries.
A fix for #7249.
2020-05-14 11:17:04 +02:00
antirez
e3166461ed Track events processed while blocked globally.
Related to #7234.
2020-05-14 10:06:27 +02:00
Benjamin Sergeant
ca5aaa961a fix typo ... 2020-05-13 09:32:27 -07:00
Benjamin Sergeant
c00b8e959a 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-13 09:24:51 -07:00
David Carlier
f75ab4fcb5 NetBSD build update.
This platform supports CPU affinity (but not OpenBSD).
2020-05-12 21:21:22 +01:00
antirez
7a3005da90 Some rework of #7234. 2020-05-12 13:07:44 +02:00
Oran Agra
b1913ae504 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-11 11:33:46 +03:00
Yossi Gottlieb
e15f563368 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-10 17:40:31 +03:00
antirez
87da1483a0 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-09 11:13:32 +02: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
Salvatore Sanfilippo
d9f52aa871 Merge pull request #7204 from ShooterIT/benchmark-fix
Redis Benchmark: Fix coredump because of double free
2020-05-08 10:53:20 +02:00
ShooterIT
5da4bad713 Use dictSize to get the size of dict in dict.c 2020-05-07 11:04:08 +08:00
antirez
7cbfa3c45d stringmatchlen() should not expect null terminated strings. 2020-05-06 16:18:21 +02:00
Salvatore Sanfilippo
10d4bc8808 Merge pull request #7201 from braddunbar/stringmatchlen
Remove unreachable branch.
2020-05-06 16:17:10 +02:00
hwware
04ee24e43f add include guard for lolwut.h 2020-05-05 23:35:08 -04:00
Salvatore Sanfilippo
7e27d7b6b2 Merge pull request #7175 from bsergean/bsergean-patch-1
redis-cli cluster reshard does not work with ACL (AUTH2 MIGRATE args un-implemented)
2020-05-05 18:22:24 +02:00
ShooterIT
133df5a311 Redis Benchmark: Fix coredump because of double free 2020-05-05 23:09:45 +08:00
Brad Dunbar
b53fbf167f Remove unreachable branch. 2020-05-05 09:57:01 -04:00
antirez
7dc3d5c1b8 Don't propagate spurious MULTI on DEBUG LOADAOF. 2020-05-05 15:50:00 +02:00
antirez
634ba2237a Dump recent backlog on master query generating errors. 2020-05-05 13:40:33 +02:00
Titouan Christophe
405f435b37 make struct user anonymous (only typedefed)
This works because this struct is never referenced by its name,
but always by its type.

This prevents a conflict with struct user from <sys/user.h>
when compiling against uclibc.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
2020-05-05 11:35:03 +02:00
Salvatore Sanfilippo
a987299b76 Merge pull request #7197 from bsergean/patch-1
Add --user argument to redis-benchmark.c (ACL)
2020-05-05 10:28:35 +02:00
antirez
5f7634b465 Drop not needed part from #7194. 2020-05-05 10:27:27 +02:00
Salvatore Sanfilippo
4a77e32031 Merge pull request #7194 from tryfinally/dev-reverse-bits
Fixed compiler warnings on rev(ulong) function
2020-05-05 10:26:02 +02:00
antirez
dd4efadb21 Move CRC64 initialization in main(). 2020-05-05 10:20:48 +02:00
antirez
825e1df189 Fix CRC64 initialization outside the Redis server itself. 2020-05-05 10:09:28 +02:00
Benjamin Sergeant
8a3741342e Add --user argument to redis-benchmark.c (ACL) 2020-05-04 08:09:21 -07:00
Muhammad Zahalqa
16956ce2a6 Fix compiler warnings on function rev(unsigned long) 2020-05-04 12:36:01 +03:00
antirez
bb496e1429 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-04 11:09:32 +02:00
antirez
c729f17cd2 Fix NetBSD build by fixing redis_set_thread_title() support.
See #7188.
2020-05-04 11:09:02 +02:00
Salvatore Sanfilippo
a39bfa8c41 Merge pull request #7192 from hwware/trackingprefix
Client Side Caching: Add Number of Tracking Prefix Stats in Server Info
2020-05-04 11:06:44 +02:00