Try to report source of bad Lua API calls
test-server: only listen to 127.0.0.1

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Merge pull request #819 from Keruspe/unstable

test-server: only listen to 127.0.0.1
Merge pull request #1124 from ioddly/fix-issue-1121

Try to report source of bad Lua API calls
Lua scripting: improve error reporting.

When calling Lua scripts we try to report not just the error but
information about the code line causing the error.
Lua script errors format more unified.

lua_pcall error handler now formats errors in a way more similar to
luaPushError() so that errors generated in different contexts look alike.
Fix logStackTrace() when logging to stdout.

When the semantics changed from logfile = NULL to logfile = "" to log
into standard output, no proper change was made to logStackTrace() to
make it able to work with the new setup.

This commit fixes the issue.
Allow writes from scripts called by AOF loading in read-only slaves.

This fixes issue #1163
Fix comment typo in integration/aof.tcl.
Test: regression test for #1163.
Sentinel: parse new INFO replication output correctly.

Sentinel was not able to detect slaves when connected to a very recent
version of Redis master since a previos non-backward compatible change
to INFO broken the parsing of the slaves ip:port INFO output.

This fixes issue #1164
PUBSUB command implemented.

Currently it implements three subcommands:

PUBSUB CHANNELS [<pattern>]    List channels with non-zero subscribers.
PUBSUB NUMSUB [channel_1 ...]  List number of subscribers for channels.
PUBSUB NUMPAT                  Return number of subscribed patterns.
Allow PUBSUB NUMSUB without channels.

The result is an empty list but it is handy to call it programmatically.
Initialize char* to NULL to remove compiler warning
Merge pull request #1167 from badboy/patch-1

Initialize char* to NULL to remove compiler warning
New API to force propagation.

The old REDIS_CMD_FORCE_REPLICATION flag was removed from the
implementation of Redis, now there is a new API to force specific
executions of a command to be propagated to AOF / Replication link:

    void forceCommandPropagation(int flags);

The new API is also compatible with Lua scripting, so a script that will
execute commands that are forced to be propagated, will also be
propagated itself accordingly even if no change to data is operated.

As a side effect, this new design fixes the issue with scripts not able
to propagate PUBLISH to slaves (issue #873).
Replication of scripts as EVALSHA: sha1 caching implemented.

This code is only responsible to take an LRU-evicted fixed length cache
of SHA1 that we are sure all the slaves received.

In this commit only the implementation is provided, but the Redis core
does not use it to actually send EVALSHA to slaves when possible.
Use the RSC to replicate EVALSHA unmodified.

This commit uses the Replication Script Cache in order to avoid
translating EVALSHA into EVAL whenever possible for both the AOF and
slaves.
Move Replication Script Cache initialization in safer place.

It should be called just one time at startup and not every time the Lua
scripting engine is re-initialized, otherwise memory is leaked.