Commit Graph

8985 Commits

Author SHA1 Message Date
c957794144 Memory leak when bind config is provided twice 2020-02-12 14:17:40 +01:00
1333a46b7e 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
8e7282eb3e 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
a678390e52 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
919fbf421d reduce repeated calls to use_diskless_load
this function possibly iterates on the module list
2020-02-12 14:15:56 +01:00
22e45d46fe freeClientAsync don't lock mutex if there's just one thread 2020-02-12 14:15:56 +01:00
ba28924418 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
f42ce57d0f 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
df096bc96b add SAVE subcommand to ACL HELP and top comment 2020-02-12 14:15:56 +01:00
a55e584706 DEBUG HELP - add PROTOCOL 2020-02-12 14:15:56 +01:00
5a6cfbf4ca Some refactroing using getClientType instead of CLIENT_SLAVE 2020-02-12 14:15:56 +01:00
fae306b374 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
736309660f TLS: Some redis.conf clarifications. 2020-02-12 14:15:56 +01:00
488e194787 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
c82ccf0670 memoryGetKeys helper function so that ACL can limit access to keys for MEMORY command 2020-02-12 14:15:56 +01:00
51c1a9f8fb ACL LOG: make max log entries configurable. 2020-02-12 14:15:35 +01:00
ea1e1b12c9 ACL LOG: test for AUTH reason. 2020-02-12 14:15:35 +01:00
7379c78a9b ACL LOG: log failed auth attempts. 2020-02-12 14:15:35 +01:00
9f6e84f6be ACL LOG: implement a few basic tests. 2020-02-12 14:15:35 +01:00
82790e510f ACL LOG: also log ACL errors in the scripting/MULTI ctx. 2020-02-12 14:15:35 +01:00
943008ebac ACL LOG: implement LOG RESET. 2020-02-12 14:15:35 +01:00
e271a61103 ACL LOG: group similar entries in a given time delta. 2020-02-12 14:15:35 +01:00
f1974d5d67 ACL LOG: actually emit entries. 2020-02-12 14:15:35 +01:00
d9b153c9f6 ACL LOG: implement ACL LOG subcommadn skeleton. 2020-02-12 14:15:35 +01:00
577fc4388b ACL LOG: data structures and initial functions. 2020-02-12 14:15:35 +01:00
f7a94526dd Set ZSKIPLIST_MAXLEVEL to optimal value given 2^64 elements and p=0.25 2020-02-04 10:23:48 +01:00
eecfa9793e Fix lua related memory leak. 2020-02-04 10:23:48 +01:00
d2509811b7 Add tcl regression test in scripting.tcl to reproduce memory leak. 2020-02-04 10:23:48 +01:00
29d4a1502a TLS: Fix missing initialization in redis-cli. 2020-02-04 10:23:48 +01:00
ec0c61da05 fix uninitialized info_cb var in module.c 2020-02-04 10:23:48 +01:00
6fe55c2f29 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
bbce3ba974 Add more info in the unblockClientFromModule() function. 2020-02-04 10:23:48 +01:00
40295fb3fe 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
8e9d19bc65 Change error message for #6775. 2020-01-17 10:47:38 +01:00
ba146d4c09 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
721a39ddff Document I/O threads in redis.conf. 2020-01-17 10:47:38 +01:00
5be3a15a82 Setting N I/O threads should mean N-1 additional + 1 main thread. 2020-01-17 10:47:38 +01:00
cbabf779c2 Simplify #6379 changes. 2020-01-17 10:47:38 +01:00
658749cc54 Free allocated sds in pfdebugCommand() to avoid memory leak. 2020-01-17 10:47:38 +01:00
47988c9666 Fix potential memory leak of clusterLoadConfig(). 2020-01-17 10:47:38 +01:00
cc90f79baf Fix potential memory leak of rioWriteBulkStreamID(). 2020-01-17 10:47:38 +01:00
ecd17e819c Jump to right label on AOF parsing error.
Related to #6054.
2020-01-17 10:47:38 +01:00
1927932b43 Port PR #6110 to new connection object code. 2020-01-17 10:47:38 +01:00
f2df5773b1 A few comments about main thread serving I/O as well.
Related to #6110.
2020-01-17 10:47:38 +01:00
b3ff8a4b6d Threaded IO: use main thread to handle read work 2020-01-17 10:47:38 +01:00
b1f2c51037 Threaded IO: use main thread to handle write work 2020-01-17 10:47:38 +01:00
7bbafc5639 Rename rdb asynchronously 2020-01-10 13:16:25 +01:00
c7f752667e Fix bug on KEYS command where pattern starts with * followed by \x00 (null char). 2020-01-10 13:16:25 +01:00
ed7ea13a2a 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
3be7762388 Free fakeclient argv on AOF error.
We exit later, so no bug fixed, but it is more correct.

See #6054, thanks to @ShooterIT for finding the issue.
2020-01-10 13:16:25 +01:00