158 Commits

Author SHA1 Message Date
antirez
4ab3cff9be Lua debugger: fix trace command infinite loop.
Thanks to Itamar Haber for bug report and test case to reproduce.
2015-11-17 16:24:27 +01:00
antirez
57f51983b1 Lua debugger: maxlen command implemented.
Let the user control the replies truncation.
2015-11-17 15:43:24 +01:00
antirez
06db360f1d Lua debugger: trace command implemented. 2015-11-17 15:43:24 +01:00
antirez
7b71a14380 Lua debugger: print without args show all local vars. 2015-11-17 15:43:23 +01:00
antirez
c0a0e2c26f Lua debugger: default behavior of "list" command changed.
Now it lists code around the current position by default. Can list any
other part using other arguments, but a new "whole" command was added in
order to show the whole source code easily.
2015-11-17 15:43:23 +01:00
antirez
ab792f66b0 Lua debugging: fix error message for SCRIPT DEBUG.
"async" -> "sync".

Thanks to Itamar Haber for reporting.
2015-11-17 15:43:23 +01:00
antirez
030f64f5f6 Lua debugger: reply +OK to SCRIPT DEBUG no.
Thanks to Itamar Haber for reporting.
2015-11-17 15:43:23 +01:00
antirez
76fd26e778 Lua debugger: call wait3() if there are pending forked debugging sessions. 2015-11-17 15:43:23 +01:00
antirez
d18ba0a14b Lua debugger: abort implemented. 2015-11-17 15:43:23 +01:00
antirez
be3d13cb1c Lua debugger: ldbSendLogs() memory leak fixed. 2015-11-17 15:43:23 +01:00
antirez
2f64b9d5d8 Lua debugger: better support for synchronous mode. 2015-11-17 15:43:22 +01:00
antirez
5c05038252 Lua debugger: handle forked sessions children during shutdown. 2015-11-17 15:43:22 +01:00
antirez
42aa5b768a Lua debugger: fix help typo, beark -> break. 2015-11-17 15:43:22 +01:00
antirez
b2e30575e2 Lua debugger: clear end of session protocol.
When the debugger exits now it produces an <endsession> tag that informs
redis-cli (or other debugging clients) that the session terminated.
This way the client knows there is yet another reply to read (the one of
the EVAL script itself), and can switch to non-debugging mode ASAP.
2015-11-17 15:43:22 +01:00
antirez
bbb8a712c7 Lua debugger: redis.debug() implemented. 2015-11-17 15:43:22 +01:00
antirez
eff4ea27a7 Lua debugger: removing breakpoints now works. 2015-11-17 15:43:22 +01:00
antirez
63acf80344 Lua debugger: redis command implemented. 2015-11-17 15:43:22 +01:00
antirez
5b43ff2e5b Lua debugger: try to eval as expression first.
It's handly to just eval "5+5" without the return and see it printed on
the screen as result. However prepending "return" does not always result
into valid Lua code. So what we do is to exploit a common Lua community
trick of trying to compile with return prepended, and if compilation
fails then it's not an expression that can be returned, so we try again
without prepending "return". Works great apparently.
2015-11-17 15:43:21 +01:00
antirez
02e8af90fb Lua debugger: much better Lua values pretty printer. 2015-11-17 15:43:21 +01:00
antirez
40e8b39bbb Lua debugger: print now handles ARGV and KEYS. 2015-11-17 15:43:21 +01:00
antirez
84d6160eb8 Lua debugger: added comment about helper functions. 2015-11-17 15:43:21 +01:00
antirez
717d6de03f Lua debugger: redis.breakpoint() implemented. 2015-11-17 15:43:21 +01:00
antirez
1b70a303c6 Lua debugger: output improvements, eval command. 2015-11-17 15:43:21 +01:00
antirez
4c2fa9adcf Lua debugger: breakpoints. 2015-11-17 15:43:21 +01:00
antirez
a88e1f748b Lua debugger: ability to show local vars content. 2015-11-17 15:43:21 +01:00
antirez
2cbcb0996a Lua debugger: log Redis commands. List command. 2015-11-17 15:43:21 +01:00
antirez
e897b0142d Lua debugger: initial REPL. 2015-11-17 15:43:20 +01:00
antirez
063bbc8074 Lua debugger: foundations implemented. 2015-11-17 15:43:20 +01:00
Salvatore Sanfilippo
3893964105 Merge pull request #2848 from badboy/removed-printf
Remove printf
2015-11-09 18:06:41 +01:00
antirez
a5bf6b4b94 Scripting: fix redis.call() error reporting.
Arguments arity and arguments type error of redis.call() were not
reported correctly to Lua, so the command acted in this regard like
redis.pcall(), but just for two commands. Redis.call() should always
raise errors instead.
2015-11-09 11:43:51 +01:00
antirez
e8eb45509e Initialize all Lua scripting related things into scripting.c 2015-11-05 11:37:39 +01:00
antirez
f56eabe870 scripting.c source code better organized into sections. 2015-11-05 10:37:10 +01:00
Jan-Erik Rediger
5ce9e495c7 Remove printf 2015-11-04 11:48:14 +01:00
antirez
169e86f9b1 Scripting: ability to turn on Lua commands style replication globally.
Currently this feature is only accessible via DEBUG for testing, since
otherwise depending on the instance configuration a given script works
or is broken, which is against the Redis philosophy.
2015-10-30 12:06:09 +01:00
antirez
80649e09d1 Scripting: fix error reporting of many Redis provided functions. 2015-10-30 12:06:09 +01:00
antirez
721f612918 Fix call() FORCE_REPL/AOF flags setting.
This commit also inverts two stanzas of the code just becuase they are
more logical like that, not because currently it makes any difference.
2015-10-30 12:06:08 +01:00
antirez
7d05c2d795 Lua script selective replication fixes. 2015-10-30 12:06:08 +01:00
antirez
d8e5f64638 Lua script selective replication WIP. 2015-10-30 12:06:08 +01:00
antirez
24103bafd0 Scripting: single commands replication mode implemented.
By calling redis.replicate_commands(), the scripting engine of Redis
switches to commands replication instead of replicating whole scripts.
This is useful when the script execution is costly but only results in a
few writes performed to the dataset.

Morover, in this mode, it is possible to call functions with side
effects freely, since the script execution does not need to be
deterministic: anyway we'll capture the outcome from the point of view
of changes to the dataset.

In this mode math.random() returns different sequences at every call.

If redis.replicate_commnads() is not called before any other write, the
command returns false and sticks to whole scripts replication instead.
2015-10-30 12:06:08 +01:00
antirez
ac508699de Lazyfree: client output buffers no longer use Redis Objects. 2015-10-01 13:02:24 +02:00
antirez
c15cac0d77 RDMF: More consistent define names. 2015-07-27 14:37:58 +02:00
antirez
8a893fa4cf RDMF: REDIS_OK REDIS_ERR -> C_OK C_ERR. 2015-07-26 23:17:55 +02:00
antirez
58844a7bfe RDMF: redisAssert -> serverAssert. 2015-07-26 15:29:53 +02:00
antirez
62b27ebc2a RDMF: OBJ_ macros for object related stuff. 2015-07-26 15:28:00 +02:00
antirez
fa26d3dd63 RDMF: use client instead of redisClient, like Disque. 2015-07-26 15:20:52 +02:00
antirez
e2b858a580 RDMF: redisLog -> serverLog. 2015-07-26 15:17:43 +02:00
antirez
6a424b5e36 RDMF (Redis/Disque merge friendlyness) refactoring WIP 1. 2015-07-26 15:17:18 +02:00
antirez
886f6a2aba Merge branch 'sds' into unstable 2015-07-24 08:49:23 +02:00
Jiahao Huang
4e4a00e86a config tcp-keepalive should be numerical field not bool 2015-07-16 15:53:44 +08:00
Oran Agra
c498bcbc7f sds size classes - memory optimization 2015-07-14 17:17:06 +02:00