8786 Commits

Author SHA1 Message Date
Oran Agra
ca22e14d8a A few non-data commands that should be allowed while loading or stale
SELECT, and HELLO are commands that may be executed by the client
as soon as it connects, there's no reason to block them, preventing the
client from doing the rest of his sequence (which might just be INFO or
CONFIG, etc).

MONITOR, DEBUG, SLOWLOG, TIME, LASTSAVE are all non-data accessing
commands, which there's no reason to block.
2020-02-12 14:17:40 +01:00
Oran Agra
da8ec22fc6 Memory leak when bind config is provided twice 2020-02-12 14:17:40 +01:00
Oran Agra
600d02e1a7 fix maxmemory config warning
the warning condition was if usage > limit (saying it'll cause eviction
or oom), but in fact the eviction and oom depends on used minus slave
buffers.

other than fixing the condition, i add info about the current usage and
limit, which may be useful when looking at the log.
2020-02-12 14:17:40 +01:00
Oran Agra
a98e5a1fc3 Fix client flags to be int64 in module.c
currently there's no bug since the flags these functions handle are
always lower than 32bit, but still better fix the type to prevent future
bugs.
2020-02-12 14:17:40 +01:00
Oran Agra
e92983ed3f moduleRDBLoadError, add key name, and use panic rather than exit
using panic rather than exit means you get s stack trace of the code
path that experianced the error, and possibly other info.
2020-02-12 14:17:40 +01:00
Oran Agra
2af4039b3e reduce repeated calls to use_diskless_load
this function possibly iterates on the module list
2020-02-12 14:15:56 +01:00
Oran Agra
5e3b4c978b freeClientAsync don't lock mutex if there's just one thread 2020-02-12 14:15:56 +01:00
Oran Agra
ad1c21283e move restartAOFAfterSYNC from replicaofCommand to replicationUnsetMaster
replicationUnsetMaster can be called from other places, not just
replicaofCOmmand, and all of these need to restart AOF
2020-02-12 14:15:56 +01:00
Oran Agra
a8e2bbe8f6 stopAppendOnly resets aof_rewrite_scheduled
althouh in theory, users can do BGREWRITEAOF even if aof is disabled, i
suppose it is more common that the scheduled flag is set by either
startAppendOnly, of a failed initial AOFRW fork (AOF_WAIT_REWRITE)
2020-02-12 14:15:56 +01:00
Oran Agra
23cbfea39b add SAVE subcommand to ACL HELP and top comment 2020-02-12 14:15:56 +01:00
Oran Agra
3988bfff50 DEBUG HELP - add PROTOCOL 2020-02-12 14:15:56 +01:00
Guy Benoish
084dc68128 Some refactroing using getClientType instead of CLIENT_SLAVE 2020-02-12 14:15:56 +01:00
Guy Benoish
f4c30fd74b Fix small bugs related to replica and monitor ambiguity
1. server.repl_no_slaves_since can be set when a MONITOR client disconnects
2. c->repl_ack_time can be set by a newline from a MONITOR client
3. Improved comments
2020-02-12 14:15:56 +01:00
Yossi Gottlieb
351529cc39 TLS: Some redis.conf clarifications. 2020-02-12 14:15:56 +01:00
Oran Agra
601d423498 config.c verbose error replies for CONFIG SET, like config file parsing
We noticed that the error replies for the generic mechanism for enums
are very verbose for config file parsing, but not for config set
command.

instead of replicating this code, i did a small refactoring to share
code between CONFIG SET and config file parsing.

and also renamed the enum group functions to be consistent with the
naming of other types.
2020-02-12 14:15:56 +01:00
Oran Agra
138252dc56 memoryGetKeys helper function so that ACL can limit access to keys for MEMORY command 2020-02-12 14:15:56 +01:00
antirez
491949ee5b ACL LOG: make max log entries configurable. 2020-02-12 14:15:35 +01:00
antirez
c30fe3a93f ACL LOG: test for AUTH reason. 2020-02-12 14:15:35 +01:00
antirez
c0de265bfa ACL LOG: log failed auth attempts. 2020-02-12 14:15:35 +01:00
antirez
c60351e489 ACL LOG: implement a few basic tests. 2020-02-12 14:15:35 +01:00
antirez
74c4d2f158 ACL LOG: also log ACL errors in the scripting/MULTI ctx. 2020-02-12 14:15:35 +01:00
antirez
3853c71288 ACL LOG: implement LOG RESET. 2020-02-12 14:15:35 +01:00
antirez
7b53636462 ACL LOG: group similar entries in a given time delta. 2020-02-12 14:15:35 +01:00
antirez
9f5b64c4a6 ACL LOG: actually emit entries. 2020-02-12 14:15:35 +01:00
antirez
e6eafd3e1f ACL LOG: implement ACL LOG subcommadn skeleton. 2020-02-12 14:15:35 +01:00
antirez
2d06604451 ACL LOG: data structures and initial functions. 2020-02-12 14:15:35 +01:00
Leo Murillo
5b2c6c5efa Set ZSKIPLIST_MAXLEVEL to optimal value given 2^64 elements and p=0.25 2020-02-04 10:23:48 +01:00
WuYunlong
294b194ad4 Fix lua related memory leak. 2020-02-04 10:23:48 +01:00
WuYunlong
7d63a7d128 Add tcl regression test in scripting.tcl to reproduce memory leak. 2020-02-04 10:23:48 +01:00
Yossi Gottlieb
a27a4b82f4 TLS: Fix missing initialization in redis-cli. 2020-02-04 10:23:48 +01:00
Oran Agra
2ffb9a3682 fix uninitialized info_cb var in module.c 2020-02-04 10:23:48 +01:00
Guy Benoish
2ad427f862 ld2string should fail if string contains \0 in the middle
This bug affected RM_StringToLongDouble and HINCRBYFLOAT.
I added tests for both cases.

Main changes:
1. Fixed string2ld to fail if string contains \0 in the middle
2. Use string2ld in getLongDoubleFromObject - No point of
   having duplicated code here

The two changes above broke RM_SaveLongDouble/RM_LoadLongDouble
because the long double string was saved with length+1 (An innocent
mistake, but it's actually a bug - The length passed to
RM_SaveLongDouble should not include the last \0).
2020-02-04 10:23:48 +01:00
antirez
229229eb55 Add more info in the unblockClientFromModule() function. 2020-02-04 10:23:48 +01:00
Guy Benoish
d9f508d527 Modules: Fix blocked-client-related memory leak
If a blocked module client times-out (or disconnects, unblocked
by CLIENT command, etc.) we need to call moduleUnblockClient
in order to free memory allocated by the module sub-system
and blocked-client private data

Other changes:
Made blockedonkeys.tcl tests a bit more aggressive in order
to smoke-out potential memory leaks
2020-02-04 10:23:48 +01:00
antirez
4048cf6125 Change error message for #6775. 2020-01-17 10:47:38 +01:00
Vasyl Melnychuk
037755edd4 Make error when submitting command in incorrect context more explicit
So error message `ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context` will become
`ERR 'get' command submitted, but only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context`
2020-01-17 10:47:38 +01:00
antirez
9a39a227ff Document I/O threads in redis.conf. 2020-01-17 10:47:38 +01:00
antirez
598c324bc1 Setting N I/O threads should mean N-1 additional + 1 main thread. 2020-01-17 10:47:38 +01:00
antirez
dff5370c8b Simplify #6379 changes. 2020-01-17 10:47:38 +01:00
WuYunlong
e67a3a377f Free allocated sds in pfdebugCommand() to avoid memory leak. 2020-01-17 10:47:38 +01:00
WuYunlong
1588f30ae2 Fix potential memory leak of clusterLoadConfig(). 2020-01-17 10:47:38 +01:00
WuYunlong
2a3a035b64 Fix potential memory leak of rioWriteBulkStreamID(). 2020-01-17 10:47:38 +01:00
antirez
87d059a745 Jump to right label on AOF parsing error.
Related to #6054.
2020-01-17 10:47:38 +01:00
antirez
0b02b27705 Port PR #6110 to new connection object code. 2020-01-17 10:47:38 +01:00
antirez
a6eb3f8bfb A few comments about main thread serving I/O as well.
Related to #6110.
2020-01-17 10:47:38 +01:00
zhaozhao.zz
1f76ff2fb9 Threaded IO: use main thread to handle read work 2020-01-17 10:47:38 +01:00
zhaozhao.zz
0a3410db70 Threaded IO: use main thread to handle write work 2020-01-17 10:47:38 +01:00
ShooterIT
4e0c2ff1d8 Rename rdb asynchronously 2020-01-10 13:16:25 +01:00
Leo Murillo
b6caf319e5 Fix bug on KEYS command where pattern starts with * followed by \x00 (null char). 2020-01-10 13:16:25 +01:00
Jamie Scott
0b36c7eb26 Update to directive in redis.conf (missing s)
The directive tls-prefer-server-cipher is actually tls-prefer-server-ciphers in config.c. This results in a failed directive call shown below. This pull request adds the "s" in ciphers so that the directive is able to be properly called in config.c

ubuntu@ip-172-31-16-31:~/redis$ src/redis-server ./redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 200
>>> 'tls-prefer-server-cipher yes'
Bad directive or wrong number of arguments
2020-01-10 13:16:25 +01:00