5419 Commits

Author SHA1 Message Date
antirez
6a5c20e2ac Lua debugger: redis-cli, mark end of debugging session. 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
antirez
6adc1fe86a Remove "s" flag for MIGRATE in command table.
Maybe there are legitimate use cases for MIGRATE inside Lua scripts, at
least for now. When the command will be executed in an asynchronous
fashion (planned) it is possible we'll no longer be able to permit it
from within Lua scripts.
2015-11-17 15:43:13 +01:00
antirez
0260c0489d Update redis-cli help and the script to generate it. 2015-11-17 15:38:34 +01:00
antirez
aa2785936f Fix MIGRATE entry in command table.
Thanks to Oran Agra (@oranagra) for reporting. Key extraction would not
work otherwise and it does not make sense to take wrong data in the
command table.
2015-11-17 15:33:09 +01:00
antirez
a5dadb0866 AOF: rewriting child killed by SIGUSR1 is not an error. 2015-11-13 09:32:20 +01:00
antirez
b56cc1b939 call() deserves a good top-comment. 2015-11-10 13:31:25 +01:00
Salvatore Sanfilippo
3893964105 Merge pull request #2848 from badboy/removed-printf
Remove printf
2015-11-09 18:06:41 +01:00
antirez
dd9955a080 Best effort flush of slave buffers before SHUTDOWN. 2015-11-09 17:26:58 +01:00
antirez
198eb2a040 Use clientHasPendingReplies() in flushSlavesOutputBuffers()
The old version only flushed data to slaves if there were strings
pending in the client->reply list. Now also static buffers are flushed.
Does not help to free memory (which is the only use we have right now in
the fuction), but is more correct conceptually, and may be used in
other contexts.
2015-11-09 17:07:46 +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
f741c4871e Fix error reply in subscribed Pub/Sub mode.
PING is now a valid command to issue in this context.
2015-11-09 11:10:53 +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
antirez
12a4348a7c Fix HINCRBYFLOAT to work with long doubles.
During the refactoring needed for lazy free, specifically the conversion
of t_hash from struct robj to plain SDS strings, HINCRBFLOAT was
accidentally moved away from long doubles to doubles for internal
processing of increments and formatting.

The diminished precision created more obvious artifacts in the way small
numbers are formatted once we convert from decimal number in radix 10 to
double and back to its string in radix 10.

By using more precision, we now have less surprising results at least
with small numbers like "1.23", exactly like in the previous versions of
Redis.

See issue #2846.
2015-11-04 17:16:34 +01:00
antirez
82c68fa048 Add regression test for HINCRBYFLOAT formatting change.
This test was kindly provided by Jan-Erik Rediger (@badboy here on
Github) that discovered the issue.

See issue #2846.
2015-11-04 17:02:34 +01:00
Salvatore Sanfilippo
17e92993f4 Merge pull request #2850 from Joe8Bit/fix_typo-in-readme
Fix typo in READme sever/server
2015-11-04 12:59:11 +01:00
antirez
2008907cdc README new internals section improved a bit more. 2015-11-04 12:58:26 +01:00
Joe Pettersson
0817d61999 Fix typo in READme sever/server 2015-11-04 11:54:50 +00:00
antirez
aeef405429 README: remove garbage at end of line. 2015-11-04 12:52:37 +01:00
antirez
1a51974893 README operations -> commands, is more clear now #2. 2015-11-04 12:51:45 +01:00
antirez
27d408520f README operations -> commands, is more clear now. 2015-11-04 12:50:32 +01:00
antirez
f1fd00c0b0 A few README typos fixed #2. 2015-11-04 12:44:36 +01:00
antirez
1c06ecf39f A few README typos fixed. 2015-11-04 12:41:54 +01:00
antirez
ffab6563aa README now has info about Redis codebase layout. 2015-11-04 12:29:54 +01:00
Jan-Erik Rediger
5ce9e495c7 Remove printf 2015-11-04 11:48:14 +01:00
antirez
04278a276a Test: improve PFCOUNT with multiple keys testing.
An user raised a question about a given behavior of PFCOUNT. Added a
test to show the behavior (union) is correct when most of the items are
in common.
2015-11-03 19:03:17 +01:00
antirez
fdfaec8be3 Dependencies updated. 2015-10-30 12:15:07 +01:00
antirez
dbebe3b4cd Scripting: commands replication tests. 2015-10-30 12:06:09 +01:00
antirez
3af78260ff More reliable DEBUG loadaof.
Make sure to flush the AOF output buffers before reloading.
Result: less false timing related false positives on AOF tests.
2015-10-30 12:06:09 +01:00
antirez
65ca281273 Scripting: execute tests with command replication as well. 2015-10-30 12:06:09 +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
eca9dc7b3d Scripting: test Redis provided Lua functions error reporting. 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