4823 Commits

Author SHA1 Message Date
antirez
62893f5b9f Cluster: better cluster state transiction handling.
Before we relied on the global cluster state to make sure all the hash
slots are linked to some node, when getNodeByQuery() is called. So
finding the hash slot unbound was checked with an assertion. However
this is fragile. The cluster state is often updated in the
clusterBeforeSleep() function, and not ASAP on state change, so it may
happen to process clients with a cluster state that is 'ok' but yet
certain hash slots set to NULL.

With this commit the condition is also checked in getNodeByQuery() and
reported with a identical error code of -CLUSTERDOWN but slightly
different error message so that we have more debugging clue in the
future.

Root cause of issue #2288.
2015-03-20 10:06:11 +01:00
antirez
585f68ac35 Cluster: move clusterBeforeSleep() call before unblocked clients processing.
Related to issue #2288.
2015-03-20 10:06:07 +01:00
antirez
d8236ea262 Cluster: more robust slave check in CLUSTER REPLICATE.
There are rare conditions where node->slaveof may be NULL even if the
node is a slave. To check by flag is much more robust.
2015-03-18 12:09:39 +01:00
antirez
6adf3ca798 Cluster: ignore various node files in create-cluster dir. 2015-03-18 11:29:33 +01:00
antirez
6ec87978de Added regression test for issue #2371. 2015-03-18 11:29:32 +01:00
antirez
d225e79b8d HAVE_SYNC_FILE_RANGE should be protected by ifdef __linux__.
Related to issue #2372.
2015-03-18 11:29:32 +01:00
Mariano Pérez Rodríguez
586211ae60 Fix for #2371
Fixing #2371 as per @mattsta's suggestion
2015-03-18 11:29:32 +01:00
antirez
51a0ee1ed7 Norrow backtrace and setproctitle() to Linux+glibc.
Backtrace is a glibc extension, while setproctitle() implementation
depends on the memory layout and is partially libc dependent.
2015-03-18 11:29:32 +01:00
antirez
e772c8e7eb redis-cli --latency-dist: one gray more, and --mono support. 2015-03-18 11:29:32 +01:00
antirez
99764d2722 redis-cli --latency-dist, hopefully better palette.
Less grays: more readable palette since usually we have a non linear
distribution of percentages and very near gray tones are hard to take
apart. Final part of the palette is gradient from yellow to red. The red
part is hardly reached because of usual distribution of latencies, but
shows up mainly when latencies are very high because of the logarithmic
scale, this is coherent to what people expect: red = bad.
2015-03-18 11:29:32 +01:00
Masahiko Sawada
b5bd8f6afe Unify to uppercase the headline 2015-03-18 11:29:32 +01:00
Michel Martens
f36482dd5f Add command CLUSTER MYID 2015-03-18 11:29:32 +01:00
antirez
085ef2087b Net: better Unix socket error. Issue #2449. 2015-03-18 11:29:32 +01:00
Leandro López (inkel)
b10c2b7bb2 Support CLIENT commands in Redis Sentinel
When trying to debug sentinel connections or max connections errors it
would be very useful to have the ability to see the list of connected
clients to a running sentinel. At the same time it would be very helpful
to be able to name each sentinel connection or kill offending clients.

This commits adds the already defined CLIENT commands back to Redis
Sentinel.
2015-03-13 18:29:59 +01:00
antirez
f5d9e3f715 Config: activerehashing option support in CONFIG SET. 2015-03-08 15:33:49 +01:00
antirez
45ff739cdf Fix iterator for issue #2438.
Itereator misuse due to analyzeLatencyForEvent() accessing the
dictionary during the iteration, without the iterator being
reclared as safe.
2015-03-04 11:49:48 -08:00
antirez
938dfdc1ea Migrate: replace conditional with pre-computed value. 2015-02-27 22:34:18 +01:00
antirez
53659404e4 Improvements to PR #2425
1. Remove useless "cs" initialization.
2. Add a "select" var to capture a condition checked multiple times.
3. Avoid duplication of the same if (!copy) conditional.
4. Don't increment dirty if copy is given (no deletion is performed),
   otherwise we propagate MIGRATE when not needed.
2015-02-26 10:29:02 +01:00
Salvatore Sanfilippo
968ce96474 Merge pull request #2425 from twang817/migrateCacheDbid
Add last_dbid to migrateCachedSocket to avoid redundant SELECT
2015-02-26 10:17:13 +01:00
Tommy Wang
97c4167aa1 Add last_dbid to migrateCachedSocket to avoid redundant SELECT
Avoid redundant SELECT calls when continuously migrating keys to
the same dbid within a target Redis instance.
2015-02-25 13:08:35 -06:00
antirez
2c27b887b1 Merge branch 'testing' into 3.0 2015-02-13 08:55:31 +01:00
antirez
b9602d96e3 Redis 2.9.104 (3.0.0 Release Candidate 4). 3.0.0-rc4 2015-02-13 08:55:23 +01:00
antirez
36c62ae799 Merge branch 'testing' into 3.0 2015-02-12 16:55:43 +01:00
antirez
9e6155f4f8 Extend memory unit support in CONFIG SET.
Related to PR #2357.
2015-02-12 16:54:38 +01:00
antirez
304aa59c49 Better memtoll() error checking.
Related to PR #2357.
2015-02-12 16:54:38 +01:00
Chris Lamb
260cfcf7bd Support "1G" etc. units in CONFIG SET maxmemory
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
2015-02-12 16:54:30 +01:00
antirez
5bcaff429d Merge branch 'testing' into 3.0 2015-02-11 11:01:50 +01:00
antirez
967590de6e Separate latency monitoring of eviction loop and eviction DELs. 2015-02-11 11:01:46 +01:00
antirez
541eb23895 dict.c: reset emptylen when bucket is not empty.
Fixed by @oranagra, thank you.
2015-02-11 11:01:46 +01:00
antirez
08ad51762b redis-cli --stat: show LOAD when loading. 2015-02-11 11:01:46 +01:00
antirez
eaae581b55 Remove optional single-key path from evictionPoolPopulate(). 2015-02-11 11:01:46 +01:00
antirez
05a398389f dict.c: add dictGetSomeKeys(), specialized for eviction. 2015-02-11 11:01:46 +01:00
antirez
7014e1afc2 dict.c: avoid code repetition in dictRehash().
Avoid code repetition introduced with PR #2367, also fixes the return
value to always return 0 if there is nothing more to rehash.
2015-02-11 11:01:46 +01:00
Sun He
aa3de04232 dict.c/dictRehash: check again to update 2015-02-11 11:01:46 +01:00
antirez
252ebcd973 dict.c: don't try buckets that are empty for sure in dictGetRandomKey().
This is very similar to the optimization applied to dictGetRandomKeys,
but applied to the single key variant.

Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
a355568c1a dict.c: dictGetRandomKeys() optimization for big->small table case.
Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
eb4859db05 dict.c: dictGetRandomKeys() visit pattern optimization.
We use the invariant that the original table ht[0] is never populated up
to the index before the current rehashing index.

Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
e2ab7be33c dict.c: put a bound to max work dictRehash() call can do.
Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
40f64bc68a dict.c: prevent useless resize to same size.
Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
b7d20a2000 Less blocking dictGetRandomKeys().
Related to issue #2306.
2015-02-11 11:01:46 +01:00
antirez
d4f37363a4 Merge branch 'testing' into 3.0 2015-02-10 14:54:09 +01:00
Charles Hooper
3a0e69f391 override histfile from env - fixes #831 and copies #833 2015-02-10 14:52:32 +01:00
antirez
c3a5ad2018 redis-cli --lru-test implemented (cache workload simulator). 2015-02-10 14:51:25 +01:00
antirez
4793ea982a redis-cli: interactive reconnection for latency modes.
--stat mode already used to reconnect automatically if the server is no
longer available. This is useful since this is an interactive mode used
for debugging, however the same applies to --latency and --latency-dist
modes, so now both use the reconnecting command execution as well.

The reconnection code was modified to use basic VT100 escape sequences
in order to play better with different kinds of output on the screen
when the reconnection happens, and to hide the reconnection attempt
output when finally the reconnection happens.
2015-02-10 14:51:25 +01:00
antirez
9a4d71e92e redis-cli --latecy-dist reverted to gray scale.
So far not able to find a color palette within the 256 colors which is
not confusing. However I believe it is a possible task, so will try
better later.
2015-02-10 14:51:25 +01:00
antirez
ad9976cd90 redis-cli --latency-dist now uses a color palette.
Still not happy with the result but low grays are hard to see in certain
monitors with a non perfect gamma.
2015-02-10 14:51:25 +01:00
antirez
b857578ba2 redis-cli latency dist: add new top HL. 2015-02-10 14:51:25 +01:00
antirez
630634a37a Add missing latency-dest legend symbol. 2015-02-10 14:51:25 +01:00
antirez
cdf30ba8c7 Initial implementation of redis-cli --latency-dist. 2015-02-10 14:51:25 +01:00
antirez
9c40565bbe Faster memory efficiency test.
This test on Linux was extremely slow, since in Tcl we can't enable
easily tcp-nodelay, so the busy loop used to take *a lot* with bigger
writes. Fixed using pipelining.
2015-02-10 14:48:25 +01:00