- 20 Sep, 2019 2 commits
- 17 Sep, 2019 4 commits
- 16 Sep, 2019 6 commits
-
-
antirez authored
-
antirez authored
Here we introduce a change in the way we convert values from Lua to Redis when RESP3 is selected: this is possible without breaking the fact we can return directly what a command returned, because there is no Redis command in RESP2 that returns true or false to Lua, so the conversion in the case of RESP2 is totally arbitrary. When a script is written selecting RESP3 from Lua, it totally makes sense to change such behavior and return RESP3 true/false when Lua true/false is returned.
-
antirez authored
-
antirez authored
-
antirez authored
-
antirez authored
-
- 13 Sep, 2019 3 commits
-
-
antirez authored
We want all the scripts to run in RESP2 mode by default. It's up to the caller to switch to V3 using redis.setresp() if it is really needed. This way most scripts written for past Redis versions will continue to work with Redis >= 6 even if the client is in RESP3 mode.
-
antirez authored
-
antirez authored
-
- 18 Mar, 2019 1 commit
-
-
Yossi Gottlieb authored
-
- 29 Jan, 2019 1 commit
-
-
antirez authored
-
- 09 Jan, 2019 3 commits
- 09 Oct, 2018 1 commit
-
-
antirez authored
Related to #4804.
-
- 30 Sep, 2018 1 commit
-
-
Bruce Merry authored
sdsZmallocSize assumes a dynamically allocated SDS. When given a string object created by createEmbeddedStringObject, it calls zmalloc_size on a pointer that isn't the one returned by zmalloc
-
- 11 Sep, 2018 1 commit
-
-
antirez authored
-
- 05 Sep, 2018 3 commits
-
-
antirez authored
See issue #5250 and issue #5292 for more info.
-
antirez authored
Here the idea is that we do not want freeMemoryIfNeeded() to propagate a DEL command before the script and change what happens in the script execution once it reaches the slave. For example see this potential issue (in the words of @soloestoy): On master, we run the following script: if redis.call('get','key') then redis.call('set','xxx','yyy') end redis.call('set','c','d') Then when redis attempts to execute redis.call('set','xxx','yyy'), we call freeMemoryIfNeeded(), and the key may get deleted, and because redis.call('set','xxx','yyy') has already been executed on master, this script will be replicated to slave. But the slave received "DEL key" before the script, and will ignore maxmemory, so after that master has xxx and c, slave has only one key c. Note that this patch (and other related work) was authored collaboratively in issue #5250 with the help of @soloestoy and @oranagra. Related to issue #5250.
-
antirez authored
See issue #5250 and the new comments added to the code in this commit for details.
-
- 03 Sep, 2018 2 commits
-
-
antirez authored
-
zhaozhao.zz authored
-
- 31 Aug, 2018 3 commits
-
-
antirez authored
Technically speaking we don't really need to put the master client in the clients that need to be processed, since in practice the PING commands from the master will take care, however it is conceptually more sane to do so.
-
antirez authored
However the master scripts will be impossible to kill. Related to #5297.
-
antirez authored
See reasoning in #5297.
-
- 26 Aug, 2018 1 commit
-
-
Chris Lamb authored
-
- 31 Jul, 2018 1 commit
-
-
antirez authored
-
- 22 Jul, 2018 1 commit
-
-
Itamar Haber authored
-
- 21 Jul, 2018 1 commit
-
-
WuYunlong authored
-
- 16 Jul, 2018 1 commit
-
-
Oran Agra authored
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
-
- 02 Jul, 2018 1 commit
-
-
antirez authored
-
- 09 Jun, 2018 1 commit
-
-
Itamar Haber authored
-
- 07 Jun, 2018 1 commit
-
-
Itamar Haber authored
-
- 30 Apr, 2018 1 commit
-
-
Itamar Haber authored
Implementation notes: as INFO is "already broken", I didn't want to break it further. Instead of computing the server.lua_script dict size on every call, I'm keeping a running sum of the body's length and dict overheads. This implementation is naive as it **does not** take into consideration dict rehashing, but that inaccuracy pays off in speed ;) Demo time: ```bash $ redis-cli info memory | grep "script" used_memory_scripts:96 used_memory_scripts_human:96B number_of_cached_scripts:0 $ redis-cli eval "" 0 ; redis-cli info memory | grep "script" (nil) used_memory_scripts:120 used_memory_scripts_human:120B number_of_cached_scripts:1 $ redis-cli script flush ; redis-cli info memory | grep "script" OK used_memory_scripts:96 used_memory_scripts_human:96B number_of_cached_scripts:0 $ redis-cli eval "return('Hello, Script Cache :)')" 0 ; redis-cli info memory | grep "script" "Hello, Script Cache :)" used_memory_scripts:152 used_memory_scripts_human:152B number_of_cached_scripts:1 $ redis-cli eval "return redis.sha1hex(\"return('Hello, Script Cache :)')\")" 0 ; redis-cli info memory | grep "script" "1be72729d43da5114929c1260a749073732dc822" used_memory_scripts:232 used_memory_scripts_human:232B number_of_cached_scripts:2
✔ 19:03:54 redis [lua_scripts-in-info-memory L ✚…⚑] $ redis-cli evalsha 1be72729d43da5114929c1260a749073732dc822 0 "Hello, Script Cache :)" ```
-