Commit Graph

5393 Commits

Author SHA1 Message Date
antirez
9aa1f94449 scripting.c source code better organized into sections. 2015-11-05 10:37:10 +01:00
antirez
71aa9b75f2 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
f6255703b0 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
de776a402f 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
dfe90acbd5 README new internals section improved a bit more. 2015-11-04 12:58:26 +01:00
Joe Pettersson
8bc8f6f695 Fix typo in READme sever/server 2015-11-04 11:54:50 +00:00
antirez
462026ceb7 README: remove garbage at end of line. 2015-11-04 12:52:37 +01:00
antirez
73510f4e38 README operations -> commands, is more clear now #2. 2015-11-04 12:51:45 +01:00
antirez
b9fb24014a README operations -> commands, is more clear now. 2015-11-04 12:50:32 +01:00
antirez
8badf160b6 A few README typos fixed #2. 2015-11-04 12:44:36 +01:00
antirez
d80d051792 A few README typos fixed. 2015-11-04 12:41:54 +01:00
antirez
15d57c35c3 README now has info about Redis codebase layout. 2015-11-04 12:29:54 +01:00
antirez
30b324698f 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
77362b9027 Dependencies updated. 2015-10-30 12:15:07 +01:00
antirez
5b63ae37ff Scripting: commands replication tests. 2015-10-30 12:06:09 +01:00
antirez
f26072eb66 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
073a42b997 Scripting: execute tests with command replication as well. 2015-10-30 12:06:09 +01:00
antirez
ff6d296000 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
eda06b51fb Scripting: test Redis provided Lua functions error reporting. 2015-10-30 12:06:09 +01:00
antirez
ebaa9226ee Scripting: fix error reporting of many Redis provided functions. 2015-10-30 12:06:09 +01:00
antirez
2dabf82d5f 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
514a234722 Lua script selective replication fixes. 2015-10-30 12:06:08 +01:00
antirez
a3e8de0430 Lua script selective replication WIP. 2015-10-30 12:06:08 +01:00
antirez
fc38235664 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
cdda6748c2 call(): selective ability to prevent propagation on AOF / slaves. 2015-10-30 12:06:08 +01:00
antirez
9dd3d2e9bd call(): don't inherit CLIENT_PREVENT_PROP + minor refactoring. 2015-10-30 12:06:08 +01:00
antirez
d37ef7845b CONTRIBUTING updated. 2015-10-27 12:06:26 +01:00
antirez
86f0a2ee87 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
bdcb145566 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
6ed12bd430 Redis.conf example: make clear user must pass its path as argument. 2015-10-15 12:46:07 +02:00
antirez
5f0fef5eb9 Regression test for issue #2813. 2015-10-15 11:23:15 +02:00
antirez
ed6228851c PR 2813 fix ported to unstable. 2015-10-15 10:20:09 +02:00
David Thomson
8a85ad2d1c Add back blank line 2015-10-14 06:58:36 +01:00
David Thomson
03d0de7cdf Update import command to optionally use copy and replace parameters 2015-10-14 06:56:14 +01:00
antirez
35a0c772b5 DEBUG RESTART/CRASH-AND-RECOVER [delay] implemented. 2015-10-13 11:12:25 +02:00
antirez
73427462ed 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
c372a59520 Cluster: redis-trib fix, coverage for migrating=1 case.
Kinda related to #2770.
2015-10-09 16:15:58 +02:00
antirez
6ddcba6ec9 Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
antirez
363c0f67b9 Test: fix attach_to_replication_stream to handle newlines. 2015-10-07 22:32:24 +02:00
antirez
f29e384853 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
antirez
3f38b51ad7 Jemalloc configure script fixed to work nested.
Now way to make unmodified Jemalloc configure to work when the jemalloc
source tree is inside a subdirectory of a different git repository.

Problem signaled here:
http://www.canonware.com/pipermail/jemalloc-discuss/2015-October/001174.html
2015-10-07 09:17:06 +02:00
antirez
a9951b1b6a Jemalloc updated to 4.0.3. 2015-10-06 16:55:37 +02:00
antirez
e3ded0273c Added a README into deps on dependencies and how to upgrade. 2015-10-06 10:56:16 +02:00
antirez
ceaf58dfd5 Regression test for GEORADIUS COUNT arity check. 2015-10-06 09:27:29 +02:00
antirez
319d180136 Fix GEORADIUS COUNT option arity checks. 2015-10-06 09:25:28 +02:00
antirez
19f6ab50c3 Lazyfree options documented in the example redis.conf. 2015-10-05 12:24:16 +02:00
antirez
880c606a7c Lazyfree options implemented in the configuration. 2015-10-05 12:11:27 +02:00
antirez
252cfa0a39 Lazyfree: cond vars to enabled/disable it based on DEL context. 2015-10-02 15:27:57 +02:00
antirez
5359696796 Fixed a bug in the emptyDb() new implementation. 2015-10-01 13:02:26 +02:00
antirez
ecdbc333a3 FLUSHDB and FLUSHALL ASYNC option implemented. 2015-10-01 13:02:26 +02:00