563 Commits

Author SHA1 Message Date
antirez
2e1e170aad RESP3: fix cases of NULL reported instead of empty aggregate. 2019-09-02 12:50:47 +02:00
John Sully
a21a7a8ee9 Fix race condition in PUB/SUB and other async reply commands where the client can be freed before our handler is executed on the client thread. When this occurs the client pointer is dangling
Former-commit-id: 46a78c69e718f0aeb5e62f33c59458b15b8d9bc6
2019-08-26 20:18:52 -04:00
Oran Agra
8bf7c6d789 Modlue fork is killed when the parent exists 2019-08-25 10:11:48 +03:00
antirez
e87768e8ca Replication: clarify why repl_put_online_on_ack exists at all. 2019-08-05 17:38:15 +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
Oran Agra
7d18a61559 Merge remote-tracking branch 'oss/unstable' into module_rdb_load_errors 2019-07-30 15:14:08 +03:00
Oran Agra
9fa285523c Avoid diskelss-load if modules did not declare they handle read errors 2019-07-30 15:11:57 +03:00
Salvatore Sanfilippo
8e2a99eb4b Merge pull request #6264 from oranagra/modules_api_aux_rdb
Implement module api for aux data in rdb
2019-07-30 11:50:44 +02:00
John Sully
f8884fed3a Fix crash setting expire on a key with an existing subkey expiration
Former-commit-id: 4858fd893c8e638b0efdcd3ab2c6dc188a6dc6bd
2019-07-29 17:09:51 -04:00
John Sully
e3b97286ca RREPLAY failures should be logged
Former-commit-id: 08b6a04055e950e53f043391ec9f9a09f654b1ee
2019-07-24 22:49:30 -04:00
Oran Agra
b2fce80695 Extend modules API to allow modules report to redis INFO
this implements #6012
2019-07-24 12:58:15 +03:00
antirez
83b8fbf580 Client side caching: config option for table fill rate. 2019-07-24 11:35:01 +02:00
John Sully
e06c38f1d3 Plumb support for sub expires to all expire related code
Former-commit-id: 184abac6942a9a6aa8783741b50b23210afddcc5
2019-07-23 18:53:59 -04:00
John Sully
94645b33dd Initial prototype of EXPIREMEMBER command
Former-commit-id: 0b3d74ea67d616a6869cbd66198c8dd7ffa72eb7
2019-07-23 18:53:58 -04:00
John Sully
e04cff2cfe Support TTL stats with the new expire datastructure
Former-commit-id: 271df3dad4f55f20177a8a9a065778f4943835f1
2019-07-23 18:30:10 -04:00
John Sully
a060bc7942 New expire datastructure and algorithm. Allows us to expire in sublinear time
Former-commit-id: 3880d2616c882e19169180dc10268564347b0279
2019-07-23 18:30:10 -04: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
Oran Agra
ff0780e8e6 Implement module api for aux data in rdb
Other changes:
* fix memory leak in error handling of rdb loading of type OBJ_MODULE
2019-07-22 21:15:33 +03:00
antirez
f2f3d91e78 Client side caching: split invalidation into key / slot. 2019-07-22 18:59:53 +02:00
Oran Agra
c80ad2f4b5 Allow modules to handle RDB loading errors.
This is especially needed in diskless loading, were a short read could have
caused redis to exit. now the module can handle the error and return to the
caller gracefully.

this fixes #5326
2019-07-21 18:19:32 +03:00
John Sully
c178b67ded Merge commit '9c1932beeb6e307c2fbeadcfff8954e517189ae8' into unstable
Former-commit-id: 821c12c482d20b15dfb5a6eeab52e167997627d8
2019-07-19 00:32:43 -04:00
John Sully
33acb40633 Merge commit '985e5b2c608eade2a60e50a6a177f13381c9c8d8' into unstable
Former-commit-id: 4602f8c391409e9dd59f1fbee6a5ef011b219ca1
2019-07-19 00:01:56 -04:00
John Sully
6e461c3cc3 Fix compile errors from merges
Former-commit-id: 27a927fe0011536c6539d7c2a79ccfdaf78cee22
2019-07-18 23:35:51 -04:00
Angus Pearson
12c8823c93 Add char* typeNameCanonicalize(robj*) to remove duplicate code between SCAN and TYPE commands,
and to keep OBJ_* enum to string canonicalization in one place.


Former-commit-id: 3cdc6e8d846e88cf4e250b2643662bde2a9317c5
2019-07-18 23:31:31 -04:00
John Sully
bd3cc0bb95 Resolve race on neterr variable
Former-commit-id: 1512274f4c51dc4e8f4e3d11df2f35e051c0c079
2019-07-18 17:11:28 -04:00
John Sully
857f778b38 Make object refcounts atomic, technically it doesn't need to be currently but the semantics are complicated and error prone. This is much safer with little performance impact
Former-commit-id: e310d33c121550f69b1c06d101db0c3f944a7fb0
2019-07-18 15:49:12 -04: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
zhaozhao.zz
8d5e3b7893 Client side caching: implement trackingInvalidateKeysOnFlush() 2019-07-17 20:33:52 +08:00
John Sully
add714913b Implement test mode to make finding bugs easier
Former-commit-id: 971f69fe1ff9cce50492a47f306b312457e50b9f
2019-07-15 14:55:18 -04:00
John Sully
ff0065df91 Fix more locking deadlocks
Former-commit-id: 3081b6f98b5e7a9f3ef7cfe040236070398b081c
2019-07-12 23:51:45 -04:00
John Sully
8cd37fae2c Fix deadlock with client and ae locks
Former-commit-id: 8630339e43c1de1cd723bdfdca8ab5924e2cb8b0
2019-07-12 20:46:50 -04:00
John Sully
35e23ca988 Fix compile errors on GCC v5
Former-commit-id: 1f08a0efb33511ddc75c2acc62199bfcd0860137
2019-07-11 20:20:01 -04:00
John Sully
8ba25371a5 Fix active replication offset synchronization accounting, and enable the wait command
Former-commit-id: a5784ef09e71a9a45780a8f3dbab875b1f1fe1a5
2019-07-11 17:00:23 -04: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
Salvatore Sanfilippo
9c1932beeb Merge pull request #6116 from AngusP/scan-types
SCAN: New Feature `SCAN cursor [TYPE type]` modifier suggested in issue #6107
2019-07-08 12:53:34 +02:00
Angus Pearson
00c9b4f15d Change typeNameCanonicalize -> getObjectTypeName, and other style changes 2019-07-08 11:04:37 +01:00
antirez
f3a8b5001d Client side caching: RESP2 support. 2019-07-05 12:24:28 +02:00
antirez
4b5027845e Client side caching: implement trackingInvalidateKey(). 2019-07-03 19:16:20 +02:00
antirez
a4e44726d0 Client side caching: hook inside call() for tracking. 2019-07-03 12:42:16 +02:00
antirez
b54789d472 Client side caching: enable tracking mode. 2019-06-30 06:19:08 -04:00
antirez
7f9de752de Client side caching: fields and flags for tracking mode. 2019-06-29 20:08:41 -04:00
John Sully
d4d6e7756d Fix Travis CI issue
Former-commit-id: 8238d3207e484e5c9515d00ee7d2247168c03612
2019-06-17 23:56:23 -04:00
John Sully
9725fadaba convert the pending write list to a vector for better performance and less cache thrashing
Former-commit-id: ae33ff3a6ef6d47bab63cf8362055c1ed210dbad
2019-06-17 23:00:12 -04:00
John Sully
924509f52f Move more code out of the GIL
Former-commit-id: 59dbd625c143c1a890d4387f7a32c997f0d64f5f
2019-06-17 23:00:12 -04:00
Angus Pearson
49edda41b9 Spelling cannonical -> canonical 2019-06-13 17:49:33 +01:00
Angus Pearson
5ca48db2e2 Add char* typeNameCanonicalize(robj*) to remove duplicate code between SCAN and TYPE commands,
and to keep OBJ_* enum to string canonicalization in one place.
2019-06-10 17:41:44 +01:00
Oran Agra
f7833d560d make redis purge jemalloc after flush, and enable background purging thread
jemalloc 5 doesn't immediately release memory back to the OS, instead there's a decaying
mechanism, which doesn't work when there's no traffic (no allocations).
this is most evident if there's no traffic after flushdb, the RSS will remain high.

1) enable jemalloc background purging
2) explicitly purge in flushdb
2019-06-02 15:33:14 +03:00
John Sully
dd5152f836 Fix regressions from RESP3 changes in commit c8304b099d82dba4da35f4cfaa99595bcdb46d1a
Former-commit-id: c5cbb77fc7e3b2b5124b9432e144d8c74190c755
2019-05-20 23:39:44 -04:00