372 Commits

Author SHA1 Message Date
antirez
7aaedf9192 TerminateModuleForkChild(): move safety checks there.
We don't want that the API could be used directly in an unsafe way,
without checking if there is an active child. Now the safety checks are
moved directly in the function performing the operations.
2019-09-27 12:17:47 +02:00
antirez
1ef0c2f630 Function renamed hasForkChild() -> hasActiveChildProcess(). 2019-09-27 12:03:09 +02:00
antirez
e885d74018 Modules fork: improve SIGUSR1 handling, fix include.
We can't expect SIGUSR1 to have any specific value range, so let's
define an exit code that we can handle in a special way.
This also fixes an #include <wait.h> that is not standard.
2019-09-27 11:39:45 +02:00
Salvatore Sanfilippo
5c5761bcd6 Merge branch 'unstable' into modules_fork 2019-09-27 11:24:06 +02:00
Oran Agra
2add4524c5 Fix lastbgsave_status, when new child signal handler get intended kill
And add a test for that.
2019-09-26 15:16:34 +03:00
Salvatore Sanfilippo
4d5fc6b46d Merge pull request #6024 from itamarhaber/info_modules
Adds a "Modules" section to `INFO`
2019-09-26 11:58:52 +02:00
antirez
73eac24165 Modify #6401 changes to fit 80 cols. 2019-09-25 18:08:11 +02:00
Salvatore Sanfilippo
236f5b473d Merge pull request #6401 from valentinogeron/fix-discard-during-oom
DISCARD should not fail during OOM
2019-09-25 18:07:25 +02:00
Salvatore Sanfilippo
ff949dfe86 Merge pull request #6402 from mieko/unstable
Seed SipHash with 128-bit key
2019-09-25 18:03:39 +02:00
antirez
53e3b994f0 ACL: fix ##6408, default user state affecting all the connections. 2019-09-25 17:45:05 +02:00
Mike A. Owens
c9a39e9bc5 Seed SipHash with 128-bit key
SipHash expects a 128-bit key, and we were indeed generating 128-bits,
but restricting them to hex characters 0-9a-f, effectively giving us
only 4 bits-per-byte of key material, and 64 bits overall.

Now, we skip the hex conversion and supply 128 bits of unfiltered
random data.
2019-09-23 19:24:09 -04:00
valentino
bd32b8b2a8 DISCARD should not fail during OOM
discard command should not fail during OOM, otherwise client MULTI state
will not be cleared.
2019-09-22 09:22:53 +03:00
antirez
bbc1faa9d6 RESP3: Use verbatim in INFO output. 2019-09-18 18:33:13 +02:00
antirez
2e1e170aad RESP3: fix cases of NULL reported instead of empty aggregate. 2019-09-02 12:50:47 +02:00
Oran Agra
8bf7c6d789 Modlue fork is killed when the parent exists 2019-08-25 10:11:48 +03:00
antirez
b8f4ed2448 Fix regression causing EXEC to appear in the slow log.
This was recently introduced with PR #6266.
2019-07-31 19:05:20 +02:00
Salvatore Sanfilippo
3e66c43e84 Merge pull request #6266 from madolson/dev-unstable-hide-auth-and-hello
Hide HELLO and AUTH from slowlog and monitor
2019-07-31 11:12:46 +02:00
antirez
83b8fbf580 Client side caching: config option for table fill rate. 2019-07-24 11:35:01 +02:00
antirez
1d54931685 Client side caching: show tracking slots usage in INFO. 2019-07-23 11:02:14 +02:00
antirez
79a73bb95a Client side caching: implement full slot limit function. 2019-07-23 10:57:22 +02:00
Madelyn Olson
4520e87800 Hide HELLO and AUTH from slowlog and monitor 2019-07-22 22:53:15 -07:00
antirez
f2f3d91e78 Client side caching: split invalidation into key / slot. 2019-07-22 18:59:53 +02:00
Oran Agra
e70fbad802 Module API for Forking
* create module API for forking child processes.
* refactor duplicate code around creating and tracking forks by AOF and RDB.
* child processes listen to SIGUSR1 and dies exitFromChild in order to
  eliminate a valgrind warning of unhandled signal.
* note that BGSAVE error reply has changed.

valgrind error is:
  Process terminating with default action of signal 10 (SIGUSR1)
2019-07-17 16:40:24 +03:00
antirez
00f56990ef Client side caching: add tracking clients in INFO. 2019-07-10 18:08:31 +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
antirez
d6204fe246 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2019-07-04 18:34:53 +02:00
antirez
a4e44726d0 Client side caching: hook inside call() for tracking. 2019-07-03 12:42:16 +02:00
Salvatore Sanfilippo
2af8ebe147 Merge pull request #6149 from madolson/acl-spelling
Fixed some spelling issues in ACL codepath including a user facing error
2019-06-07 22:54:52 +02:00
Madelyn Olson
67a4bcac1b Fixed some spelling issues in ACL codepath including user facing error 2019-06-07 13:25:22 -07:00
Salvatore Sanfilippo
2395eeb6e0 Merge pull request #6074 from trevor211/fixActiveExpire
Do not active expire keys in the background when the switch is off.
2019-05-10 12:39:35 +02:00
Salvatore Sanfilippo
330835e25a Merge pull request #6077 from zltl/patch-7
delete sdsTest() from REDIS_TEST in server.c to fix build failed
2019-05-10 12:27:47 +02:00
antirez
50b09bc408 Threaded IO: ability to disable reads from threaded path. 2019-05-06 18:02:51 +02:00
antirez
b9b29641cf Threaded IO: read side WIP 3. 2019-05-06 18:02:51 +02:00
antirez
7bae8afef8 Threaded IO: read side WIP. 2019-05-06 18:02:51 +02:00
antirez
dc4d13e751 Threaded IO: make num of I/O threads configurable. 2019-05-06 18:02:51 +02:00
Ubuntu
0353d13321 Threaded IO: stop threads when no longer needed + C11 in Makefile.
Now threads are stopped even when the connections drop immediately to
zero, not allowing the networking code to detect the condition and stop
the threads. serverCron() will handle that.
2019-05-06 18:02:51 +02:00
antirez
df0a28f661 Threaded IO: second attempt without signaling conditions. 2019-05-06 18:02:51 +02:00
antirez
62261aa905 Threaded IO: implement handleClientsWithPendingWritesUsingThreads().
This is just an experiment for now, there are a couple of race
conditions, mostly harmless for the performance gain experiment that
this commit represents so far.

The general idea here is to take Redis single threaded and instead
fan-out on expansive kernel calls: write(2) in this case, but the same
concept could be easily implemented for read(2) and protcol parsing.

However just threading writes like in this commit, is enough to evaluate
if the approach is sounding.
2019-05-06 18:02:51 +02:00
liaotonglang
e374c6eb55 delete sdsTest() from REDIS_TEST
sdsTest() defined in sds.c dit not match the call in server.c.
remove it from REDIS_TEST, since test-sds defined in Makefile.
2019-05-06 19:24:00 +08:00
WuYunlong
0bf3acce38 Do not active expire keys in the background when the switch is off. 2019-05-06 11:46:07 +08:00
Itamar Haber
971d9ee0aa Adds a "Modules" section to INFO
Fixes #6012.

As long as "INFO is broken", this should be adequate IMO. Once we rework
`INFO`, perhaps into RESP3, this implementation should be revisited.
2019-04-16 22:16:12 +03:00
Salvatore Sanfilippo
d415aa89c0 Merge pull request #5944 from yossigo/command-filtering
Command Filtering API
2019-03-22 17:43:49 +01:00
Salvatore Sanfilippo
f87b8c9b52 Merge pull request #5243 from oranagra/sigterm_log
Add log when server dies of SIGTERM during loading
2019-03-21 11:54:09 +01:00
Oran Agra
61501773c9 getKeysFromCommand for TOUCH only extracted the first key.
also, airty for COMMAND command was wrong.
2019-03-20 17:00:39 +02:00
Yossi Gottlieb
bb6e8ba682 Initial command filter experiment. 2019-03-18 13:50:34 +02:00
Itamar Haber
dfc1ea81c6 Fixes BZ[REV]POP's arity 2019-03-03 23:10:45 +02:00
Salvatore Sanfilippo
85b84a045e Merge pull request #5875 from chendq8/partialsync
fix:Slave will do full sync when restart with SHUTDOWN SAVE on cluster mode
2019-03-01 17:29:19 +01:00
Salvatore Sanfilippo
f8322797b2 Merge pull request #3649 from Alkorin/fixTypo
Fix typo (unsupproted => unsupported) in error message
2019-02-27 22:33:22 +01:00
chendianqiang
4cf2552bd3 fix replicationid will not change for server.masterhost==NULL in cluster mode when restart slave 2019-02-27 17:43:05 +08:00
antirez
8b01d81fd4 Merge branch 'gopher' into unstable 2019-02-25 18:16:58 +01:00