4878 Commits

Author SHA1 Message Date
antirez
df7add9e70 Test: ZADD INCR test 2015-05-29 12:27:17 +02:00
antirez
9003483d43 Test: ZADD NX and XX options tests 2015-05-29 12:27:17 +02:00
antirez
a13d6378c1 ZADD RETCH option: Return number of elements added or updated
Normally ZADD only returns the number of elements added to a sorted
set, using the RETCH option it returns the sum of elements added or
for which the score was updated.
2015-05-29 12:27:17 +02:00
antirez
fa17e2daf0 ZADD NX and XX options 2015-05-29 12:27:17 +02:00
antirez
ff7c1faa12 ZADD implemenation able to take options. 2015-05-29 12:27:16 +02:00
therealbill
e252e9f231 adding a sentinel command: "flushconfig"
This new command triggers a config flush to save the in-memory config to
disk. This is useful for cases of a configuration management system or a
package manager wiping out your sentinel config while the process is
still running - and has not yet been restarted. It can also be useful
for scripting a backup and migrate or clone of a running sentinel.
2015-05-25 12:06:52 +02:00
antirez
9c0a68861e Sentinel: CKQUORUM tests 2015-05-19 12:27:19 +02:00
antirez
5844f5d0d1 Sentinel: SENTINEL CKQUORUM command
A way for monitoring systems to check that Sentinel is technically able
to reach the quorum and failover, using the currently visible Sentinels.
2015-05-19 12:27:19 +02:00
antirez
a97658f293 Merge branch '3.0' of github.com:/antirez/redis into 3.0 2015-05-15 17:40:03 +02:00
antirez
138e7af57b Rewrite smoveCommand test with ternary operator 2015-05-15 17:39:37 +02:00
Glenn Nethercutt
3a9f41ad86 uphold the smove contract to return 0 when the element is not a member of the source set, even if source=dest 2015-05-15 17:39:37 +02:00
Salvatore Sanfilippo
71fba427c2 Merge pull request #2567 from ryanschwartz/patch-1
Update 00-RELEASENOTES
2015-05-15 17:22:21 +02:00
Jungtaek Lim
08d4df8d31 protocol error log should be seen debug/verbose level 2015-05-15 17:06:42 +02:00
Ryan Schwartz
e7422ef166 Update 00-RELEASENOTES
Fix typo in 00-RELEASENOTES.
2015-05-07 14:28:21 -05:00
antirez
362032e43a Release notes: Sentinel upgrade urgency moved to moderate 2015-05-05 11:16:20 +02:00
antirez
10323dc5fe Redis 3.0.1 3.0.1 2015-05-05 11:01:19 +02:00
FuGangqiang
e213c408fa sdsfree x and y 2015-05-04 13:03:01 +02:00
FuGangqiang
5674656db7 fix doc example 2015-05-04 13:03:01 +02:00
FuGangqiang
35d71b1ffc fix typo 2015-05-04 13:03:01 +02:00
Itamar Haber
6637862838 update copyright year 2015-05-04 12:56:50 +02:00
therealbill
b065f4441b Making sentinel flush config on +slave
Originally, only the +slave event which occurs when a slave is
reconfigured during sentinelResetMasterAndChangeAddress triggers a flush
of the config to disk.  However, newly discovered slaves don't
apparently trigger this flush but do trigger the +slave event issuance.

So if you start up a sentinel, add a master, then add a slave to the
master (as a way to reproduce it) you'll see the +slave event issued,
but the sentinel config won't be updated with the known-slave entry.

This change makes sentinel do the flush of the config if a new slave is
deteted in sentinelRefreshInstanceInfo.
2015-05-04 12:55:27 +02:00
antirez
bd99b26bc5 Sentinel: remove useless sentinelFlushConfig() call
To rewrite the config in the loop that adds slaves back after a master
reset, in order to handle switching to another master, is useless: it
just adds latency since there is an fsync call in the inner loop,
without providing any additional guarantee, but the contrary, since if
after the first loop iteration the server crashes we end with just a
single slave entry losing all the other informations.

It is wiser to rewrite the config at the end when the full new
state is configured.
2015-05-04 12:55:27 +02:00
Yossi Gottlieb
0560738f6b Fix Redis server crash when Lua command exceeds client output buffer
limit.
2015-05-04 12:20:24 +02:00
clark.kang
88d58661db fix sentinel memory leak 2015-05-04 12:18:05 +02:00
antirez
315e3b14ef Fix Sentinel memory leak (hiredis bug)
This fixes issue #2535, that was actually an hiredis library bug (I
submitted an issue and fix to the redis/hiredis repo as well).

When an asynchronous hiredis connection subscribes to a Pub/Sub channel
and gets an error, and in other related conditions, the function
redisProcessCallbacks() enters a code path where the link is
disconnected, however the function returns before freeing the allocated
reply object. This causes a memory leak. The memory leak was trivial to
trigger in Redis Sentinel, which uses hiredis, every time we tried to
subscribe to an instance that required a password, in case the Sentinel
was configured either with the wrong password or without password at
all. In this case, the -AUTH error caused the leaking code path to be
executed.

It was verified with Valgrind that after this change the leak no longer
happens in Sentinel with a misconfigured authentication password.
2015-04-28 22:15:09 +02:00
antirez
7ff051f6c1 sha1.c: use standard uint32_t. 2015-04-27 12:07:59 +02:00
antirez
f387a5acf8 Old warning removed from release notes. 2015-04-01 17:34:22 +02:00
antirez
1fab07e078 Redis 3.0.0. 3.0.0 2015-04-01 16:01:44 +02:00
antirez
8ebae5d630 dict.c: remove dictGetRandomKeys() API, no longer used. 2015-04-01 15:50:54 +02:00
Salvatore Sanfilippo
21c3d77118 Merge pull request #2477 from asheldon/patch-1
2.8 is a subset of 3.0, not the converse.
2015-04-01 15:32:28 +02:00
antirez
60a28fad8a Net: improve prepareClientToWrite() error handling and comments.
When we fail to setup the write handler it does not make sense to take
the client around, it is missing writes: whatever is a client or a slave
anyway the connection should terminated ASAP.

Moreover what the function does exactly with its return value, and in
which case the write handler is installed on the socket, was not clear,
so the functions comment are improved to make the goals of the function
more obvious.

Also related to #2485.
2015-04-01 15:20:54 +02:00
antirez
e42baed4c3 Test: be more patient waiting for servers to exit.
This should likely fix a false positive when running with the --valgrind
option.
2015-04-01 15:20:54 +02:00
Oran Agra
aa67aec84e fixes to diskless replication.
master was closing the connection if the RDB transfer took long time.
and also sent PINGs to the slave before it got the initial ACK, in which case the slave wouldn't be able to find the EOF marker.
2015-04-01 15:20:54 +02:00
antirez
93959bc09f Sentinel / Cluster test: exit with non-zero error code on failures. 2015-03-30 14:29:18 +02:00
antirez
2e92d0f04a Test: regression for issue #2473. 2015-03-27 12:11:27 +01:00
antirez
adcb470130 dict.c: add casting to avoid compilation warning.
rehashidx is always positive in the two code paths, since the only
negative value it could have is -1 when there is no rehashing in
progress, and the condition is explicitly checked.
2015-03-27 10:10:39 +01:00
asheldon
1b71fea998 2.8 is a subset of 3.0, not the converse. 2015-03-26 13:41:00 -07:00
antirez
2b5cf6bf78 Redis 2.9.106 (3.0.0 Release Candidate 6) 3.0.0-rc6 2015-03-24 16:27:12 +01:00
antirez
7e78ab4b6f Replication: disconnect blocked clients when switching to slave role.
Bug as old as Redis and blocking operations. It's hard to trigger since
only happens on instance role switch, but the results are quite bad
since an inconsistency between master and slave is created.

How to trigger the bug is a good description of the bug itself.

1. Client does "BLPOP mylist 0" in master.
2. Master is turned into slave, that replicates from New-Master.
3. Client does "LPUSH mylist foo" in New-Master.
4. New-Master propagates write to slave.
5. Slave receives the LPUSH, the blocked client get served.

Now Master "mylist" key has "foo", Slave "mylist" key is empty.

Highlights:

* At step "2" above, the client remains attached, basically escaping any
  check performed during command dispatch: read only slave, in that case.
* At step "5" the slave (that was the master), serves the blocked client
  consuming a list element, which is not consumed on the master side.

This scenario is technically likely to happen during failovers, however
since Redis Sentinel already disconnects clients using the CLIENT
command when changing the role of the instance, the bug is avoided in
Sentinel deployments.

Closes #2473.
2015-03-24 16:16:44 +01:00
antirez
3468cd3664 Cluster: redirection refactoring + handling of blocked clients.
There was a bug in Redis Cluster caused by clients blocked in a blocking
list pop operation, for keys no longer handled by the instance, or
in a condition where the cluster became down after the client blocked.

A typical situation is:

1) BLPOP <somekey> 0
2) <somekey> hash slot is resharded to another master.

The client will block forever int this case.

A symmentrical non-cluster-specific bug happens when an instance is
turned from master to slave. In that case it is more serious since this
will desynchronize data between slaves and masters. This other bug was
discovered as a side effect of thinking about the bug explained and
fixed in this commit, but will be fixed in a separated commit.
2015-03-24 16:16:44 +01:00
superlogical
d1b5c5defd create-cluster fix for stop and watch commands 2015-03-24 16:16:44 +01:00
antirez
66899a42fc Cluster: unit 10 modified to leave cluster in proper state. 2015-03-22 23:00:38 +01:00
antirez
76b18c7a0e Cluster: CLUSTER FAILOVER TAKEOVER tests. 2015-03-22 23:00:38 +01:00
antirez
ca804a1022 Cluster: more tests for manual failover + FORCE. 2015-03-22 23:00:38 +01:00
antirez
d15d9fecd2 Cluster: new tests1 for manual failover and scripts replication. 2015-03-22 23:00:38 +01:00
antirez
c2717911db Cluster: fix Lua scripts replication to slave nodes. 2015-03-22 22:24:05 +01:00
antirez
1641f41cfc Two cluster.c comments improved. 2015-03-21 18:23:10 +01:00
antirez
b37b2b5c14 Cluster: TAKEOVER option for manual failover. 2015-03-21 18:23:06 +01:00
antirez
c43c970344 Net: processUnblockedClients() and clientsArePaused() minor changes.
1. No need to set btype in processUnblockedClients(), since clients
   flagged REDIS_UNBLOCKED should have it already cleared.
2. When putting clients in the unblocked clients list, clientsArePaused()
   should flag them with REDIS_UNBLOCKED. Not strictly needed with the
   current code but is more coherent.
2015-03-21 18:23:01 +01:00
antirez
b64c861171 Cluster: non-conditional steps of slave failover refactored into a function. 2015-03-21 18:22:46 +01:00