Commit Graph

2436 Commits

Author SHA1 Message Date
22ee2f9cd5 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:57 +02:00
76412ec9c0 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:26 +02:00
f42fcff6d2 Rewrite smoveCommand test with ternary operator 2015-05-15 17:39:39 +02:00
19382c8be6 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:39 +02:00
bea224308b protocol error log should be seen debug/verbose level 2015-05-15 17:06:45 +02:00
11934a9f32 Redis 2.8.20 2015-05-05 11:14:33 +02:00
8db3969971 sdsfree x and y 2015-05-04 13:03:06 +02:00
98756d4c0d fix doc example 2015-05-04 13:03:06 +02:00
7316fda33a fix typo 2015-05-04 13:03:06 +02:00
f0ab4fd6fd 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:30 +02:00
e4c54498db 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:30 +02:00
81a8ebd7f0 Fix Redis server crash when Lua command exceeds client output buffer
limit.
2015-05-04 12:20:28 +02:00
c4d4c1ed12 fix sentinel memory leak 2015-05-04 12:18:13 +02:00
d593ae8ab6 sha1.c: use standard uint32_t. 2015-04-27 12:08:03 +02:00
c72253ec54 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:21:08 +02:00
96aa610666 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:14:49 +01:00
1f5e7b8863 Config: activerehashing option support in CONFIG SET. 2015-03-08 15:34:00 +01:00
f8f40afd5d 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:53 -08:00
1f4074e957 override histfile from env - fixes #831 and copies #833 2015-02-10 14:55:17 +01:00
9e83d2d26f redis-cli --lru-test implemented (cache workload simulator). 2015-02-10 14:55:17 +01:00
ccbec34fad 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:55:17 +01:00
d29eb68f20 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:55:17 +01:00
657f719760 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:55:17 +01:00
ff13fa787d redis-cli latency dist: add new top HL. 2015-02-10 14:55:17 +01:00
f6f3cb9458 Add missing latency-dest legend symbol. 2015-02-10 14:55:17 +01:00
9d9be0e09d Initial implementation of redis-cli --latency-dist. 2015-02-10 14:55:17 +01:00
61290d819d Update redis-cli.c
Code was adding '\n'  (line 521) to the end of NIL values exlusively making csv output inconsistent.  Removed '\n'
2015-02-02 22:50:53 +01:00
18dc769104 luaRedisGenericCommand(): log error at WARNING level when re-entered.
Rationale is that when re-entering, it is likely due to Lua debugging
hooks. Returning an error will be ignored in most cases, going totally
unnoticed. With the log at least we leave a trace.

Related to issue #2302.
2015-01-22 10:36:23 +01:00
1dea8b5a29 luaRedisGenericCommand() recursion: just return an error.
Instead of calling redisPanic() to abort the server.

Related to issue #2302.
2015-01-22 10:36:19 +01:00
a0ba7b3f00 Panic on recursive calls to luaRedisGenericCommand().
Related to issue #2302.
2015-01-22 10:36:15 +01:00
e7aa5fb5ef AOF rewrite: set iterator var to NULL when freed.
The cleanup code expects that if 'di' is not NULL, it is a valid
iterator that should be freed.

The result of this bug was a crash of the AOF rewriting process if an
error occurred after the DBs data are written and the iterator is no
longer valid.
2015-01-21 16:42:56 +01:00
8a41dae49f Add "-lrt" in Makefile for Solaris.
This fix is from @NanXiao, however I was not able to retain authorship
because the Pull Request original repository was removed.
2015-01-09 11:54:52 +01:00
50cdedd127 Check for __sun macro in solarisfixes.h, not in includers. 2015-01-09 11:22:35 +01:00
22a0fe8de6 INFO loading stats: three fixes.
1. Server unxtime may remain not updated while loading AOF, so ETA is
not updated correctly.

2. Number of processed byte was not initialized.

3. Possible division by zero condition (likely cause of issue #1932).
2014-12-23 14:52:57 +01:00
585884da45 Fixed memory leaks in rdbSaveToSlavesSockets() 2014-12-22 11:01:21 +01:00
ca3dd5e5ed Fix adjustOpenFilesLimit() logging to match real state.
Fixes issue #2225.
2014-12-19 10:05:09 +01:00
6f0a7353a6 Add redis-sentinel symlink to a relative path 2014-12-17 12:27:44 +01:00
902b877dc0 Redis 2.8.19. 2014-12-16 09:18:20 +01:00
02d465c8fe Don't log admin commands in MONITOR.
Otherwise there are security risks, especially when providing Redis as a
service, the user may "sniff" for admin commands renamed to an
unguessable string via rename-command in redis.conf.
2014-12-13 09:00:03 +01:00
4d8f4262a4 List of commands flagged as admin commands modified.
The old list did not made much sense... and the flag is currently not
used at all, so no side effects.
2014-12-13 08:59:43 +01:00
d4fc65309d Merge pull request #2092 from rhoml/rhoml-install-sentinel
Adds a symlink for redis-sentinel when Make install
2014-12-12 22:58:56 +01:00
5509c141f8 Add symlink to redis-sentinel during make install 2014-12-12 20:00:08 +01:00
7de1ef773e SORT: Don't sort Set elements if not needed.
Related to #2094.
2014-12-11 16:01:21 +01:00
e945a546af Fix zero-ordering SORT when called against lists
People mostly use SORT against lists, but our prior
behavior was pretending lists were an unordered bag
requiring a forced-sort when no sort was requested.

We can just use the native list ordering to ensure
consistency across replicaion and scripting calls.

Closes #2079
Closes #545 (again)
2014-12-11 16:01:09 +01:00
dba57ea910 FIXED redis-benchmark's idle mode.With idle mode shouldn't create write event 2014-12-11 15:21:53 +01:00
888ea17548 zipmap.c: update comments above 2014-12-09 16:01:13 +01:00
86ebc139c2 replaced // comments #2150 2014-12-09 15:26:26 +01:00
3d73f088e1 redis-benchmark AUTH command to be discarded after the first send #2150 2014-12-09 15:26:26 +01:00
76d53a6770 sds.c: Correct two spelling mistakes in comments 2014-12-09 15:14:14 +01:00
4848cf9335 sds.c/sdscatvprintf: set va_end to finish va_list cpy 2014-12-09 15:14:14 +01:00