Commit Graph

5373 Commits

Author SHA1 Message Date
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
antirez 1f26a9468f Lazyfree: pending objects count in INFO output. 2015-10-01 13:02:26 +02:00
antirez c69c6c80fb Lazyfree: ability to free whole DBs in background. 2015-10-01 13:02:26 +02:00
antirez b08c36c5f2 Lazyfree: keep count of objects to free. 2015-10-01 13:02:25 +02:00
antirez c7b46a4719 zmalloc.c converted to use atomicvar.h. 2015-10-01 13:02:25 +02:00
antirez 7e5d69019e Atomic vars implemented in a more general way.
We have them into zmalloc.c, but this is going to replace that
implementation, so that it's possible to use the same idea everywhere
inside the code base.
2015-10-01 13:02:25 +02:00
antirez 7af4eeb745 Lazyfree: incremental removed, only threaded survived. 2015-10-01 13:02:25 +02:00
antirez 9253d85073 Threaded lazyfree WIP #1. 2015-10-01 13:02:25 +02:00
antirez 4d50d691e3 bio.c: new API bioWaitStepOfType(). 2015-10-01 13:02:25 +02:00
antirez 5b850d7a09 Test: stack_logging var should be initialized to 0. 2015-10-01 13:02:25 +02:00
antirez 1dab60df81 Hash new implementation memleaks fixed. 2015-10-01 13:02:25 +02:00
antirez 97ba4e3886 Lazyfree: Hash converted to use plain SDS WIP 5. 2015-10-01 13:02:25 +02:00
antirez 36be34bb87 Test: support for stack logging for OSX malloc/leaks. 2015-10-01 13:02:25 +02:00
antirez 974514b936 Lazyfree: Hash converted to use plain SDS WIP 4. 2015-10-01 13:02:25 +02:00
antirez 4a18352877 Lazyfree: Hash converted to use plain SDS WIP 3. 2015-10-01 13:02:24 +02:00
antirez 777396aeba Lazyfree: Hash converted to use plain SDS WIP 2. 2015-10-01 13:02:24 +02:00
antirez 1c247556c6 Lazyfree: Hash converted to use plain SDS WIP 1. 2015-10-01 13:02:24 +02:00
antirez afc4b9241c DEBUG DIGEST Set type memory leak fixed. 2015-10-01 13:02:24 +02:00
antirez 34e489cb8c SORT memory leak fixed. 2015-10-01 13:02:24 +02:00
antirez a7c5be18a8 Lazyfree: Sorted sets convereted to plain SDS. (several commits squashed) 2015-10-01 13:02:24 +02:00
antirez 86d48efbfd Lazyfree: Convert Sets to use plains SDS (several commits squashed). 2015-10-01 13:02:24 +02:00