216 Commits

Author SHA1 Message Date
John Sully
d62178ec8c Initial work of multithreaded key-db. Note: Fails tests 2019-02-11 03:36:18 -05:00
John Sully
2f9d958e96 Reduce memory usage for in place strings by 8 bytes 2019-02-09 13:04:18 -05:00
John Sully
3e9e84ca19 Merge branch 'unstable' of https://github.com/antirez/redis into unstable 2019-02-06 00:09:39 -05:00
John Sully
41a24e689e Make main headers C++ safe, and change rdb to use file descriptor instead of FILE pointer 2019-02-05 23:36:40 -05:00
John Sully
2f753a3539 complete malloc memory class work, and pass tests 2019-02-04 16:56:13 -05:00
antirez
38c6030278 ACL: set modules help clients to the root user.
It does not make much sense to limit what modules can do: the admin
should instead limit what module commnads an user may call. So
RedisModule_Call() and other module operations should be able to execute
everything they want: the limitation should be posed by the API exported
by the module itself.
2019-02-01 11:37:28 +01:00
antirez
15385d4d68 ACL: assign ACL command ID to modules commands. 2019-02-01 08:17:24 +01:00
John Sully
0ffcf355fe Custom flash heap 2019-01-29 18:10:46 -05:00
antirez
5190cbe08f RESP3: addReplyString() -> addReplyProto().
The function naming was totally nuts. Let's fix it as we break PRs
anyway with RESP3 refactoring and changes.
2019-01-09 17:00:30 +01:00
antirez
75a6d12dd0 RESP3: initial implementation of the HELLO command. 2019-01-09 17:00:29 +01:00
antirez
1916a890f7 RESP3: module.c updated. 2019-01-09 17:00:29 +01:00
Hamid Alaei
a2ddb585ec fix timer context selected database 2018-10-04 17:02:10 +03:30
Hamid Alaei
168f8b7ef6 fix dict get on not found 2018-10-01 13:57:25 +03:30
antirez
4732fe03d0 Modules: Modules: dictionary API WIP #13: Compare API exported. 2018-09-27 11:46:22 +02:00
antirez
458813e132 Modules: Modules: dictionary API WIP #12: DictCompare API. 2018-09-27 11:44:25 +02:00
antirez
246d0517a8 Modules: Modules: dictionary API WIP #11: DictCompareC API. 2018-09-27 11:44:16 +02:00
antirez
fee4574b1e Modules: dictionary API WIP #10: export API to modules. 2018-09-26 13:39:01 +02:00
antirez
1630079948 Modules: dictionary API WIP #9: iterator returning string object. 2018-09-25 16:49:46 +02:00
antirez
a46eaab34c Modules: dictionary API WIP #8: Iterator next/prev. 2018-09-25 16:25:46 +02:00
antirez
7d375cbd91 Modules: dictionary API WIP #7: don't store the context.
Storing the context is useless, because we can't really reuse that
later. For instance in the API RM_DictNext() that returns a
RedisModuleString for the next key iterated, the user should pass the
new context, because we may run the keys of the dictionary in a
different context of the one where the dictionary was created. Also the
dictionary may be created without a context, but we may still demand
automatic memory management for the returned strings while iterating.
2018-09-25 12:58:16 +02:00
antirez
fba628b4be Modules: dictionary API WIP #6: implement automatic memory management. 2018-09-25 12:45:08 +02:00
antirez
9c118be041 Modules: dictionary API work in progress #5: rename API for consistency.
By using the "C" suffix for functions getting pointer/len, we can do the
same in the future for other modules APIs that need a variant with
pointer/len and that are now accepting a RedisModuleString.
2018-09-25 12:31:46 +02:00
antirez
7091574577 Modules: change RedisModuleString API to allow NULL context.
The burden of having to always create RedisModuleString objects within a
module context was too much, especially now that we have threaded
operations and modules are doing more interesting things. The context in
the string API is currently only used for automatic memory managemnet,
so now the API was modified so that the user can opt-out this feature by
passing a NULL context.
2018-09-24 17:20:00 +02:00
antirez
fb1700e148 Modules: dictionary API work in progress #4: reseek API. 2018-09-24 16:43:47 +02:00
antirez
a10b1434f3 Modules: dictionary API work in progress #3: Iterator creation. 2018-09-24 11:44:49 +02:00
antirez
f301984f51 Modules: dictionary API work in progress #2: Del API. 2018-09-24 11:16:58 +02:00
antirez
2cef32fd2f Modules: dictionary API work in progress #1. 2018-09-21 17:54:09 +02:00
antirez
2c89c5656a Module cluster flags: use RM_SetClusterFlags() in the example. 2018-09-19 16:17:20 +02:00
antirez
950acfe8c8 Module cluster flags: add RM_SetClusterFlags() API. 2018-09-19 12:02:37 +02:00
antirez
67210b0a6a Modules: rename the reused static client to something more general. 2018-09-18 13:22:05 +02:00
antirez
1a5e5264fa Modules: associate a fake client to timer context callback. 2018-09-18 13:19:33 +02:00
antirez
8888dcec36 Modules: associate a fake client to cluster message context callback.
Fixes #5354.
2018-09-18 13:15:40 +02:00
Guy Korland
461e06e27e Merge pull request #1 from gkorland/patch-5
Fix few typos
2018-09-17 14:15:39 +03:00
Guy Korland
572a3f9b89 Fix few typos 2018-09-17 14:13:46 +03:00
Guy Korland
1901515e92 RedisModule_HashSet call must end with NULL
Extended the RedisModule_HashSet doc to mark that each call must end with NULL
2018-09-17 13:54:56 +03:00
Guy Korland
59f2b7c2e6 Few typo fixes 2018-07-30 16:18:56 +03:00
Oran Agra
1f2ed12d07 slave buffers were wasteful and incorrectly counted causing eviction
A) slave buffers didn't count internal fragmentation and sds unused space,
   this caused them to induce eviction although we didn't mean for it.

B) slave buffers were consuming about twice the memory of what they actually needed.
- this was mainly due to sdsMakeRoomFor growing to twice as much as needed each time
  but networking.c not storing more than 16k (partially fixed recently in 237a38737).
- besides it wasn't able to store half of the new string into one buffer and the
  other half into the next (so the above mentioned fix helped mainly for small items).
- lastly, the sds buffers had up to 30% internal fragmentation that was wasted,
  consumed but not used.

C) inefficient performance due to starting from a small string and reallocing many times.

what i changed:
- creating dedicated buffers for reply list, counting their size with zmalloc_size
- when creating a new reply node from, preallocate it to at least 16k.
- when appending a new reply to the buffer, first fill all the unused space of the
  previous node before starting a new one.

other changes:
- expose mem_not_counted_for_evict info field for the benefit of the test suite
- add a test to make sure slave buffers are counted correctly and that they don't cause eviction
2018-07-16 16:43:42 +03:00
Jack Drogon
df7bafeb44 Fix typo 2018-07-03 18:19:46 +02:00
antirez
9f30306d44 addReplySubSyntaxError() renamed to addReplySubcommandSyntaxError(). 2018-07-02 18:49:34 +02:00
Salvatore Sanfilippo
e7b480369b Merge pull request #4998 from itamarhaber/module_command_help
Module command help
2018-07-02 18:46:56 +02:00
shenlongxing
bdb2664a81 fix typo 2018-06-21 22:08:09 +08:00
antirez
88c5e317c6 Modules: convert hash to hash table for big objects. 2018-06-19 16:03:00 +02:00
Itamar Haber
4502f10789 Capitalizes subscommands 2018-06-09 20:54:05 +03:00
Itamar Haber
041354e665 Adds MODULE HELP and implements addReplySubSyntaxError 2018-06-07 18:34:58 +03:00
zhaozhao.zz
ba2dbba0cb Modules Timer API: fix wrong raxInsert() usage 2018-04-14 01:20:02 +08:00
antirez
7365cbf830 Modules API: Add call to get the blocked client handle from the context.
This is useful in the reply and timeout callback, if the module wants to
do some cleanup of the blocked client handle that may be stored around
in the module-private data structures.
2018-04-13 13:48:11 +02:00
antirez
d7fdac673c Modules API: moduleGetReplyClient() refactoring. 2018-04-13 13:42:49 +02:00
antirez
f305a7790d Modules API: blocked client disconnection callback. 2018-04-12 13:21:48 +02:00
antirez
643d5348cc Modules API: fix OOM_WARNING flag implementation. 2018-04-11 16:25:54 +02:00
antirez
936e29a1f3 Modules API: OOM_WARNING flags.
In some modules it may be useful to have an idea about being near to
OOM. Anyway additionally an explicit call to get the fill ratio will be
added in the future.
2018-04-11 16:22:52 +02:00