253 Commits

Author SHA1 Message Date
Oran Agra
58ca0b0be2 Assertion and panic, print crash log without generating SIGSEGV
This makes it possible to add tests that generate assertions, and run
them with valgrind, making sure that there are no memory violations
prior to the assertion.

New config options:
- crash-log-enabled - can be disabled for cleaner core dumps
- crash-memcheck-enabled - useful for faster termination after a crash
- use-exit-on-panic - to be used by the test suite so that valgrind can
  detect leaks and memory corruptions

Other changes:
- Crash log is printed even on system that dont HAVE_BACKTRACE, i.e. in
  both SIGSEGV and assert / panic
- Assertion and panic won't print registers and code around EIP (which
  was useless), but will do fast memory test (which may still indicate
  that the assertion was due to memory corrpution)

I had to reshuffle code in order to re-use it, so i extracted come code
into function without actually doing any changes to the code:
- logServerInfo
- logModulesInfo
- doFastMemoryTest (with the exception of it being conditional)
- dumpCodeAroundEIP

changes to the crash report on segfault:
- logRegisters is called right after the stack trace (before info) done
  just in order to have more re-usable code
- stack trace skips the first two items on the stack (the crash log and
  signal handler functions)
2020-08-06 16:47:27 +03:00
Jiayuan Chen
198770751f Add optional tls verification (#7502)
Adds an `optional` value to the previously boolean `tls-auth-clients` configuration keyword.

Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
2020-07-28 10:45:21 +03:00
Yossi Gottlieb
c611a836f6 TLS: Session caching configuration support. (#7420)
* TLS: Session caching configuration support.
* TLS: Remove redundant config initialization.
2020-07-10 11:33:47 +03:00
antirez
c10a7a040f Clarify maxclients and cluster in conf. Remove myself too. 2020-06-22 11:21:21 +02:00
Yossi Gottlieb
5c82140f66 TLS: Improve tls-protocols clarity in redis.conf. 2020-05-20 15:14:23 +03:00
hwware
edfd415ca2 add jemalloc-bg-thread config in redis conf 2020-05-06 01:07:17 -04:00
antirez
6bd5e0fb6c Rework a bit the documentation for CPU pinning. 2020-05-04 11:05:48 +02:00
zhenwei pi
2c853869bf Support setcpuaffinity on linux/bsd
Currently, there are several types of threads/child processes of a
redis server. Sometimes we need deeply optimise the performance of
redis, so we would like to isolate threads/processes.

There were some discussion about cpu affinity cases in the issue:
https://github.com/antirez/redis/issues/2863

So implement cpu affinity setting by redis.conf in this patch, then
we can config server_cpulist/bio_cpulist/aof_rewrite_cpulist/
bgsave_cpulist by cpu list.

Examples of cpulist in redis.conf:
server_cpulist 0-7:2      means cpu affinity 0,2,4,6
bio_cpulist 1,3           means cpu affinity 1,3
aof_rewrite_cpulist 8-11  means cpu affinity 8,9,10,11
bgsave_cpulist 1,10-11    means cpu affinity 1,10,11

Test on linux/freebsd, both work fine.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-05-02 21:19:47 +08:00
antirez
077dfaad72 Fix tracking table max keys option in redis.conf. 2020-04-29 18:49:42 +02:00
Jamie Scott
3ba9724d16 minor fix 2020-04-12 17:56:58 -07:00
Jamie Scott
61d84fed33 Adding acllog-max-len to Redis.conf
While playing with ACLs I noticed that acllog-max-len wasn't in the redis.conf, but was a supported config. 

This PR documents and adds the directive to the redis.conf file.
2020-04-12 00:10:19 -07:00
antirez
1bbe60eab8 Clarify redis.conf comment about lazyfree-lazy-user-del. 2020-04-06 17:32:04 +02:00
Salvatore Sanfilippo
a58de4cff0 Merge pull request #6243 from soloestoy/expand-lazy-free-server-del
lazyfree: add a new configuration lazyfree-lazy-user-del
2020-04-06 17:27:39 +02:00
박승현
70705e758d Update redis.conf 2020-03-18 14:40:50 +09:00
antirez
ccae1031e7 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-03-12 13:25:01 +01:00
Jamie Scott
1bf0b5b147 Remove default guidance in Redis.conf
Removing the default guidance in Redis.conf since this is not an available value.
2020-03-09 12:53:44 -07:00
antirez
40b1414e6f RDB deletion: document it in example redis.conf. 2020-03-04 17:58:05 +01:00
Jamie Scott
31fe892339 Update Redis.conf to improve TLS usability
When using TLS with a Redis.conf file the line for TLS reading tls-cert-file redis.crt tls-key-file redis.key is interpreted as one complete directive. I am separating this on two separate lines to improve usability so users do not get the below error.

ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ ./src/redis-server redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 145
>>> 'tls-cert-file redis.crt tls-key-file redis.key'
wrong number of arguments
ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ vi redis.conf 
ubuntu@ip-172-31-29-250:~/redis-6.0-rc1$ ./src/redis-server redis.conf 
23085:C 04 Mar 2020 01:58:12.631 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23085:C 04 Mar 2020 01:58:12.631 # Redis version=5.9.101, bits=64, commit=00000000, modified=0, pid=23085, just started
23085:C 04 Mar 2020 01:58:12.631 # Configuration loaded
23085:M 04 Mar 2020 01:58:12.632 * Increased maximum number of open files to 10032 (it was originally set to 1024).
2020-03-03 18:03:16 -08:00
Salvatore Sanfilippo
7d10c95786 Merge pull request #6821 from guybe7/key_miss_notify
Exclude "keymiss" notification from NOTIFY_ALL
2020-02-06 10:43:05 +01:00
Yossi Gottlieb
f4c7f1ac27 TLS: Some redis.conf clarifications. 2020-02-05 18:30:12 +02:00
Guy Benoish
2492bdc90b Exclude "keymiss" notification from NOTIFY_ALL
Because "keymiss" is "special" compared to the rest of
the notifications (Trying not to break existing apps
using the 'A' format for notifications)

Also updated redis.conf and module.c docs
2020-02-03 15:43:44 +05:30
antirez
4b1de05757 Document I/O threads in redis.conf. 2020-01-13 19:10:42 +01:00
Salvatore Sanfilippo
de6951c243 Merge pull request #6457 from IAmATeaPot418/patch-1
Update to directive in redis.conf (missing s)
2020-01-10 12:16:13 +01:00
zhaozhao.zz
498f483890 lazyfree: add a new configuration lazyfree-lazy-user-del
Delete keys in async way when executing DEL command, if
lazyfree-lazy-user-del is yes.
2019-12-18 16:54:49 +08:00
Madelyn Olson
d9c79ff75c Add configuration option for allowing reads on cluster down 2019-12-16 23:33:16 -08:00
Michael Chaten
71ec9478a6 Change description to be agnostic to the number of policies. 2019-12-09 11:27:53 -08:00
Michael Chaten
b028b48b2b Fix outdated information on max memory policies 2019-12-06 11:56:52 -08:00
Salvatore Sanfilippo
15664acd87 Merge pull request #6559 from oranagra/active_defrag_tunables
Adjustments for active defrag defaults
2019-11-20 10:08:08 +01:00
antirez
25415849e9 Expire cycle: document expire effort in redis.conf. 2019-11-18 18:11:38 +01:00
Oran Agra
eac0e6094e Adjustments for active defrag defaults and tuning
Reduce default minimum effort, so that when fragmentation is just detected,
the impact on the latency will be minor.

Reduce the default maximum effort, mainly to prevent a case were a sudden
massive deletions, won't trigger an aggressive defrag that will cause latency.

When activedefrag is disabled mid-run, reset the 'running' info field, and
clear the scan cursor, so that when it'll be re-enabled, a new fresh scan will
start.

Clearing the 'running' variable is important since lowering the defragger
tunables mid-scan won't help, the defragger only considers new threshold when
a new scan starts, and during a scan it can only become more aggressive,
(when more severe fragmentation is detected), it'll never go less aggressive.
So by temporarily disabling activedefrag, one can lower th the tunables.

Removing the experimantal warning.
2019-11-12 15:05:29 +02:00
Carsten Strotmann
f12c08d921 Typo fix: kill -> still 2019-10-25 19:38:45 +02:00
Jamie Scott
aeba242cb5 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
2019-10-16 13:31:19 -07:00
Yossi Gottlieb
514e5aa8ef TLS: Improve CA certifiate configuration options.
This adds support for explicit configuration of a CA certs directory (in
addition to the previously supported bundle file).  For redis-cli, if no
explicit CA configuration is supplied the system-wide default
configuration will be adopted.
2019-10-08 17:58:50 +03:00
Yossi Gottlieb
df08b624bd TLS: Configuration options.
Add configuration options for TLS protocol versions, ciphers/cipher
suites selection, etc.
2019-10-07 21:07:27 +03:00
Yossi Gottlieb
10ffeb03e4 TLS: Connections refactoring and TLS support.
* Introduce a connection abstraction layer for all socket operations and
integrate it across the code base.
* Provide an optional TLS connections implementation based on OpenSSL.
* Pull a newer version of hiredis with TLS support.
* Tests, redis-cli updates for TLS support.
2019-10-07 21:06:13 +03:00
antirez
4e547a0ac5 Mark diskless loads as experimental in redis.conf. 2019-07-25 19:17:58 +02:00
antirez
63e1d1cb27 Client side caching: document tracking-table-max-fill in redis.conf. 2019-07-24 11:45:10 +02:00
antirez
27095db3f3 Example redis.conf: stay under 80 cols. 2019-07-24 11:38:11 +02:00
antirez
1ead7a1158 Remove experimental warning from diskless replication. 2019-07-24 11:33:53 +02:00
Oran Agra
29754ebe22 diskless replication on slave side (don't store rdb to file), plus some other related fixes
The implementation of the diskless replication was currently diskless only on the master side.
The slave side was still storing the received rdb file to the disk before loading it back in and parsing it.

This commit adds two modes to load rdb directly from socket:
1) when-empty
2) using "swapdb"
the third mode of using diskless slave by flushdb is risky and currently not included.

other changes:
--------------
distinguish between aof configuration and state so that we can re-enable aof only when sync eventually
succeeds (and not when exiting from readSyncBulkPayload after a failed attempt)
also a CONFIG GET and INFO during rdb loading would have lied

When loading rdb from the network, don't kill the server on short read (that can be a network error)

Fix rdb check when performed on preamble AOF

tests:
run replication tests for diskless slave too
make replication test a bit more aggressive
Add test for diskless load swapdb
2019-07-08 15:37:48 +03:00
abhay
b19e3e0e4c removed obsolete warning as per - https://github.com/antirez/redis/issues/5291 2019-04-26 17:03:16 +02:00
antirez
dbdbf19f92 Gopher: document the feature in redis.conf. 2019-02-25 17:20:43 +01:00
antirez
2c38dc6831 ACL: Document masteruser option in redis.conf. 2019-02-12 18:23:00 +01:00
antirez
4a7062f9bd ACL: some documentation inside redis.conf. 2019-02-08 09:52:07 +01:00
antirez
e9d231d4c6 ACL: redis.conf: mark old ACL-alike stuff as deprecated. 2019-02-05 17:59:05 +01:00
antirez
b9f923896e redis.conf typo fixed: ingore -> ignore. 2018-10-15 11:01:37 +02:00
Pavel Skuratovich
22f9dd03b0 Fix typo in comment 2018-09-24 16:14:36 +03:00
Jakub Vrana
33c3cc5f47 Slave removal: capitalize Replica 2018-09-11 15:32:28 +02:00
antirez
22e38e63ff Slave removal: Make obvious in redis.conf what a replica is. 2018-09-11 15:32:28 +02:00
antirez
922d1d2387 Slave removal: fix typo of replicaof. 2018-09-11 15:32:28 +02:00