4495 Commits

Author SHA1 Message Date
Matt Stancliff
9d354e0b10 redis-cli: Add --no-raw option
Some people need formatted output even when they have no
interactive tty.

Fixes #760
2014-08-07 12:07:01 +02:00
Matt Stancliff
99d1ee8ed6 redis-cli: stop showing incorrectly selected DB
Previously redis-cli would happily show "-1" or "99999"
as valid DB choices.

Now, if the SELECT call returned an error, we don't update
the DB number in the CLI.

Inspired by @anupshendkar in #1313

Fixes #566, #1313
2014-08-07 12:04:33 +02:00
Matt Stancliff
678b48a2a4 redis-cli: Re-attach selected DB after auth
Previously, if you did SELECT then AUTH, redis-cli
would show your SELECT'd db even though it didn't
happen.

Note: running into this situation is a (hopefully) very limited
used case of people using multiple DBs and AUTH all at the same
time.

Fixes antirez#1639
2014-08-07 11:58:28 +02:00
Salvatore Sanfilippo
636ef842de Merge pull request #1896 from yossigo/bgsave-signal-fix
Fail SYNC if background save child aborted due to a signal.
2014-07-28 14:45:31 +02:00
Yossi Gottlieb
2c1a1612bd Fail SYNC if background save child aborted due to a signal. 2014-07-28 14:43:30 +03:00
vps
5b66eb677f * fixed doc URL for keyspace events 2014-07-28 12:49:33 +02:00
antirez
32b7102416 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2014-07-28 12:49:04 +02:00
antirez
462d12f9fc Cluster test: unit 07, replicas migration. 2014-07-28 12:48:51 +02:00
antirez
5933b4bdf5 Cluster test: unit 06 cluster creation comment fixed. 2014-07-28 12:35:05 +02:00
Salvatore Sanfilippo
ce777cbbca Merge pull request #1895 from mattrobenolt/patch-1
Fix spelling of "stand alone" in ascii art
2014-07-28 09:37:41 +02:00
Matt Robenolt
6f9327ed15 Fix spelling of "stand alone" in ascii art
Also unified the logic to match `genRedisInfoString`
2014-07-28 00:30:12 -07:00
antirez
5129a24e16 Cluster test: node reachability condition fixed. 2014-07-25 16:17:13 +02:00
antirez
75be22fd08 Cluster test: init test, be patient during restarts. 2014-07-25 16:10:18 +02:00
antirez
9ce037111f Cluster test: 03 unit speedup, don't send WAIT to slaves. 2014-07-25 16:09:31 +02:00
antirez
040e990dc7 Cluster test: unit 06, slaves with stale data can't failover. 2014-07-25 15:40:25 +02:00
antirez
c15c73db60 Example redis.conf: improve slaveof description. 2014-07-25 14:20:23 +02:00
antirez
8daba93234 Cluster test: new unit 05, slave selection. 2014-07-25 11:23:51 +02:00
antirez
8abda6a835 Cluster: don't migrate to a master that never had slaves.
Replica migration algorithm modified so that slaves never try to migrate
to masters that were never configured to have slaves in the past.
We want the algorithm to take care of masters that remained without
*working* slaves, but that used to have slaves according to the cluster
configuration.
2014-07-25 11:02:09 +02:00
antirez
91e336b8d8 Fix util.c compilation by including stdint.h. 2014-07-23 18:02:02 +02:00
antirez
ed460c1029 Faster ll2string() implementation.
Based on ideas documented in this blog post:

https://www.facebook.com/notes/facebook-engineering/three-optimization-tips-for-c/10151361643253920

The original code was modified to handle signed integers, reformetted to
fit inside the Redis code base, and was stress-tested with a program
in order to validate the implementation against snprintf().

Redis was measured to be measurably faster from the point of view of
clients in real-world operations because of this change, since sometimes
number to string conversion is used extensively (for example every time
a GET results into an integer encoded object to be returned to the
user).
2014-07-23 14:58:23 +02:00
antirez
0f5a822b92 PFSELFTEST: less false positives.
This is just a quickfix, for the nature of the test the right way to fix
it is to average the error of N runs, since otherwise it is always
possible to get a false positive with a bad run, or to minimize too much
this possibility we may end testing with too much "large" error ranges.
2014-07-23 11:43:57 +02:00
antirez
822c911566 Test: check sorted set elements order after union.
This is not a regression but issue #1786 showed the need for this test.
2014-07-22 17:52:04 +02:00
antirez
35783bc994 Remove useless var and check in zunionInterGenericCommand(). 2014-07-22 17:38:22 +02:00
antirez
11b39c194b ZUNIONSTORE reimplemented for speed.
The user @kjmph provided excellent ideas to improve speed of ZUNIONSTORE
(in certain cases by many order of magnitude), together with an
implementation of the ideas.

While the ideas were sounding, the implementation could be improved both
in terms of speed and clearness, so that's my attempt at reimplementing
the speedup proposed, trying to improve by directly using just a
dictionary with an embedded score inside, and reusing the single-pass
aggregate + order-later approach.

Note that you can't apply this commit without applying the previous
commit in this branch that adds a double in the dictEntry value union.

Issue #1786.
2014-07-22 17:38:22 +02:00
antirez
fc62a2283f Add double field in dict.c entry value union. 2014-07-22 17:38:22 +02:00
antirez
f5e4a3583d CLUSTER RESET: Flush dataset if node is a slave.
For non-empty masters, CLUSTER RESET is denied, and the user requires to
start to reset a node by explicitly clearing it with FLUSHALL.
However CLUSTER RESET when executed with slaves don't have this
restrictions since data is just a replica of the master, and with
read-only slaves it is also not possible to remove the data set. However
the node was turned from slave to master after a reset, without touching
the old slave data. This is 99.99% of times not appropriate and forces
full resets to follow this path to work with both slave and master
nodes:

    FLUSHALL
    CLUSTER RESET HARD
    FLUSHALL

Since we need the first flushall for masters, and the second for slaves.

This commit changes the behavior so that CLUSTER RESET removes the data set
of a slave node during a reset, in the moment it gets turned into a master,
so the new pattern is simply:

    FLUSHALL (that may fail for slaves)
    CLUSTER RESET
2014-07-22 15:29:57 +02:00
antirez
fb1533cd0d Cluster test: use larger keyspace in resharding test. 2014-07-21 16:29:49 +02:00
antirez
46f9ffe705 Cluster test: unit 04, consistency during resharding. 2014-07-21 16:26:05 +02:00
antirez
7cd727e7a8 Cluster: fix redis-trib --from all. 2014-07-21 15:30:25 +02:00
antirez
ffa6c6e8b9 redis-trib: allow to reshard in non-interactive way.
The introduction of --from --to --slots --yes options allow to reshard
from cli in an automated way from scripts. The code is ugly and needs
refactoring as soon as we get it in RC / stable release.
2014-07-18 17:43:49 +02:00
antirez
255a6e32aa Cluster test: test that writes are retained during failovers.
In the test we use WAIT when the master and slave are up, and only later the
partition is created killing the master, so we are sure we don't incur
in failure modes that may lose writes in this test: the goal here is to
make sure that the elected slave was replicating correctly with the
master.
2014-07-18 17:13:46 +02:00
antirez
5926e0164e Test: Pub/Sub PING. 2014-07-18 12:03:31 +02:00
antirez
65cca8c9bb Test: small integer sharing depends on maxmemory policy. 2014-07-18 10:55:08 +02:00
antirez
9c3c11e4a7 PING: backward compatible error for wrong number of args. 2014-07-18 10:15:51 +02:00
antirez
f7b31f2cde tryObjectEncoding(): use shared objects with maxmemory and non-LRU policy.
In order to make sure every object has its own private LRU counter, when
maxmemory is enabled tryObjectEncoding() does not use the pool of shared
integers. However when the policy is not LRU-based, it does not make
sense to do so, and it is much better to save memory using shared
integers.
2014-07-18 10:09:51 +02:00
antirez
c86a510c83 Variadic PING with support for Pub/Sub.
PING can now be called with an additional arugment, behaving exactly
like the ECHO command. PING can now also be called in Pub/Sub mode (with
one more more subscriptions to channels / patterns) in order to trigger
the delivery of an asynchronous pong message with the optional payload.

This fixes issue #420.
2014-07-16 17:47:17 +02:00
antirez
518288bdaf PubSub clients refactoring and new PUBSUB flag.
The code tested many times if a client had active Pub/Sub subscriptions
by checking the length of a list and dictionary where the patterns and
channels are stored. This was substituted with a client flag called
REDIS_PUBSUB that is simpler to test for. Moreover in order to manage
this flag some code was refactored.

This commit is believed to have no effects in the behavior of the
server.
2014-07-16 17:34:07 +02:00
antirez
fc21a596e6 RDB: load string objects directly as EMBSTR objects when possible. 2014-07-16 11:36:22 +02:00
Salvatore Sanfilippo
08d8fdcd63 Merge pull request #1870 from michael-grunder/object_arity
Fix OBJECT arity
2014-07-14 15:37:33 +02:00
michael-grunder
0b57f71c74 Fix OBJECT arity
Previously, the command definition for the OBJECT command specified
a minimum of two args (and that it was variadic), which meant that
if you sent this:

OBJECT foo

When cluster was enabled, it would result in an assertion/SEGFAULT
when Redis was attempting to extract keys.

It appears that OBJECT is not variadic, and only ever takes 3 args.

https://gist.github.com/michael-grunder/25960ce1508396d0d36a
2014-07-11 13:03:26 -07:00
antirez
68d6eb6a3f Fix typo in LATENCY DOCTOR output. 2014-07-11 10:57:28 +02:00
antirez
efe07ffa3a Test: more reliable AOF rewrite test under write load. 2014-07-10 16:42:43 +02:00
antirez
6f52d71a21 LATENCY command / monitor basic tests. 2014-07-10 16:23:54 +02:00
antirez
49903897ef LATENCY HISTORY returns empty array if no data is available.
Previously we returned an error.
2014-07-10 16:20:40 +02:00
antirez
186b5b0f66 Test: enable latency monitor in the default config.
This way as a side effect of running the test we also stress the latency
monitor data collection.
2014-07-10 15:04:34 +02:00
antirez
383536119d Test: AOF rewrite during write load. 2014-07-10 11:25:12 +02:00
antirez
a1f3072ab5 Fixed a few missing newline in createLatencyReport(). 2014-07-09 16:45:40 +02:00
antirez
cdc44eaf1a createLatencyReport(): compile before commit avoids commits. 2014-07-08 17:17:08 +02:00
antirez
8dfa279c19 createLatencyReport(), fix mount option name. 2014-07-08 17:12:21 +02:00
antirez
5102269c5a createLatencyReport(): initialize all advices to zero. 2014-07-08 17:11:56 +02:00