5955 Commits

Author SHA1 Message Date
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
antirez
52b4464ed6 call(): selective ability to prevent propagation on AOF / slaves. 2015-10-30 12:06:08 +01:00
antirez
78d342ec30 call(): don't inherit CLIENT_PREVENT_PROP + minor refactoring. 2015-10-30 12:06:08 +01:00
antirez
748928c596 CONTRIBUTING updated. 2015-10-27 12:06:26 +01:00
antirez
63988c9026 CLIENT REPLY command implemented: ON, OFF and SKIP modes.
Sometimes it can be useful for clients to completely disable replies
from the Redis server. For example when the client sends fire and forget
commands or performs a mass loading of data, or in caching contexts
where new data is streamed constantly. In such contexts to use server
time and bandwidth in order to send back replies to clients, which are
going to be ignored, is a shame.

Multiple mechanisms are possible to implement such a feature. For
example it could be a feature of MULTI/EXEC, or a command prefix
such as "NOREPLY SADD myset foo", or a different mechanism that allows
to switch on/off requests using the CLIENT command.

The MULTI/EXEC approach has the problem that transactions are not
strictly part of the no-reply semantics, and if we want to insert a lot
of data in a bulk way, creating a huge MULTI/EXEC transaction in the
server memory is bad.

The prefix is the best in this specific use case since it does not allow
desynchronizations, and is pretty clear semantically. However Redis
internals and client libraries are not prepared to handle this
currently.

So the implementation uses the CLIENT command, providing a new REPLY
subcommand with three options:

    CLIENT REPLY OFF disables the replies, and does not reply itself.
    CLIENT REPLY ON re-enables the replies, replying +OK.
    CLIENT REPLY SKIP only discards the reply of the next command, and
                      like OFF does not reply anything itself.

The reason to add the SKIP command is that it allows to have an easy
way to send conceptually "single" commands that don't need a reply
as the sum of two pipelined commands:

    CLIENT REPLY SKIP
    SET key value

Note that CLIENT REPLY ON replies with +OK so it should be used when
sending multiple commands that don't need a reply. However since it
replies with +OK the client can check that the connection is still
active and all the previous commands were received.

This is currently just into Redis "unstable" so the proposal can be
modified or abandoned based on users inputs.
2015-10-21 20:43:37 +02:00
Salvatore Sanfilippo
e209b1fde3 Merge pull request #2810 from dwlt/add-copy-replace-parameters-to-redis-trib-import
Add copy & replace parameters to redis-trib import
2015-10-15 13:02:35 +02:00
antirez
0e2eb8234e Redis.conf example: make clear user must pass its path as argument. 2015-10-15 12:46:07 +02:00
antirez
70cd161879 Regression test for issue #2813. 2015-10-15 11:23:15 +02:00
antirez
0c9c68346c PR 2813 fix ported to unstable. 2015-10-15 10:20:09 +02:00
David Thomson
80d1a5c065 Add back blank line 2015-10-14 06:58:36 +01:00
David Thomson
1361b951cd Update import command to optionally use copy and replace parameters 2015-10-14 06:56:14 +01:00
antirez
9fc48ed151 DEBUG RESTART/CRASH-AND-RECOVER [delay] implemented. 2015-10-13 11:12:25 +02:00
antirez
5b7bd883e6 Server: restartServer() API.
This new function is able to restart the server "in place". The current
Redis process executes the same executable it was executed with, using
the same arguments and configuration file.
2015-10-13 11:02:35 +02:00
antirez
33dedde038 Cluster: redis-trib fix, coverage for migrating=1 case.
Kinda related to #2770.
2015-10-09 16:15:58 +02:00
antirez
6a3e201234 Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
antirez
c3dbfc8825 Test: fix attach_to_replication_stream to handle newlines. 2015-10-07 22:32:24 +02:00
antirez
246b02eebe Fix extractLongLatOrReply() sanity check conditionals.
the check for lat/long valid ranges were performed inside the for loop,
two times instead of one, and the first time when the second element of
the array, xy[1], was yet not populated. This resulted into issue #2799.

Close issue #2799.
2015-10-07 22:27:18 +02:00