Commit Graph

4825 Commits

Author SHA1 Message Date
df1a7fc4fe Cluster: fetch my IP even if msg is not MEET for the first time.
In order to avoid that misconfigured cluster nodes at some time may
force an IP update on other nodes, it is required that nodes update
their own address only on MEET messages. However it does not make sense
to do this the first time a node is contacted and yet does not have an
IP, we just risk that myself->ip remains not assigned if there are
messages lost or cluster creation procedures that don't make sure
everybody is targeted by at least one incoming MEET message.

Also fix the logging of the IP switch avoiding the :-1 tail.
2015-01-13 16:23:48 +01:00
45e2a26ded Cluster: clusterMsgDataGossip structure, explict padding + minor stuff.
Also explicitly set version to 0, add a protocol version define, improve
comments in the gossip structure.

Note that the structure layout is the same after the change, we are just
making the padding explicit with an additional not used 16 bits field.
So this commit is still able to talk with the previous versions of
cluster nodes.
2015-01-13 16:23:44 +01:00
799a3ccac1 Suppress valgrind error about write sending uninitialized data.
Valgrind checks that the buffers we transfer via syscalls are all
composed of bytes actually initialized. This is useful, it makes we able
to avoid leaking informations in non initialized parts fo messages
transferred to other hosts. This commit fixes one of such issues.
2015-01-13 16:23:40 +01:00
1584c7a31b Cluster: initialize mf_end.
Can't be initialized by resetManualFailover() since it's actual state
the function uses, so we need to initialize it at startup time. Not
really a bug in practical terms, but showed up into valgrind and is not
technically correct anyway.
2015-01-12 15:40:30 +01:00
8be8780d4a 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:50 +01:00
f2348a2b7f Check for __sun macro in solarisfixes.h, not in includers. 2015-01-09 11:22:14 +01:00
7c283c5218 Cluster test: also write from Lua script in resharding test. 2015-01-09 11:06:38 +01:00
6f3553a2fe Prevent Lua scripts from violating Redis Cluster keyspace access rules.
Before this commit scripts were able to access / create keys outside the
set of hash slots served by the local node.
2015-01-09 10:39:05 +01:00
67cc0d0851 Remove end of line whitespace from redis-trib 2015-01-08 19:46:02 +01:00
d1b607aa66 Fix redis-trib cluster create
Under certain conditions the node list wasn't being fully populated
and 'create' would fail trying to call methods on nil objects.
2015-01-08 19:46:02 +01:00
6742dab413 Improve redis-trib replica assignment
This tiny bit of code has gone through so many revisions.  Hopefully
it's more correct now.

Fixes #2204
2015-01-08 19:46:02 +01:00
2247189e3e README section about make distclean reworded / extended. 2015-01-08 16:35:39 +01:00
eff9e987d3 Explain make distclean which seems not well known 2015-01-08 16:35:34 +01:00
198fb1621a Advertise Redis Cluster as experimental in redis.conf. 2015-01-08 14:41:26 +01:00
1e8f1577c5 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:54:31 +01:00
aad0c512cc Fixed memory leaks in rdbSaveToSlavesSockets() 2014-12-22 11:01:17 +01:00
9cb99f547d Fix adjustOpenFilesLimit() logging to match real state.
Fixes issue #2225.
2014-12-19 10:05:07 +01:00
8bce654246 Cluster: Notify user on accept error
If we woke up to accept a connection, but we can't
accept it, inform the user of the error going on
with their networking.

(The previous message was the same for success or error!)
2014-12-17 17:48:55 +01:00
6aba87be82 Add redis-sentinel symlink to a relative path 2014-12-17 12:27:41 +01:00
86213b4e03 Fix comment in clusterHandleSlaveFailover(). 2014-12-16 15:03:23 +01:00
2c6dc9f15f Make sure buffer is enough in clusterSendPing(). 2014-12-15 10:18:29 +01:00
722faed62a 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 08:58:34 +01:00
cc7b9171ca 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:58:34 +01:00
31bf7976b5 Add symlink to redis-sentinel during make install 2014-12-12 22:59:28 +01:00
a419537800 Lua cmsgpack lib updated to latest version.
It fixes a bad bug that crashes the server in certain conditions
as shown in issue #2210.
2014-12-12 22:57:07 +01:00
814cd40215 SORT: Don't sort Set elements if not needed.
Related to #2094.
2014-12-11 15:58:29 +01:00
77bbc0dfad 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 15:58:29 +01:00
e1524f5010 FIXED redis-benchmark's idle mode.With idle mode shouldn't create write event 2014-12-11 15:21:42 +01:00
94d9482b61 Update redis_init_script.tpl
status command currently reports success when redis has crashed and the pid file still exists. Changing to check the actual process is running.
2014-12-11 15:21:28 +01:00
cc14d7f51d Fix function prototype in redis-cli.c.
Fix function prototype in redis-cli.c.
2014-12-11 15:09:20 +01:00
c13d787d13 Fix redis-trib import SCAN call 2014-12-11 15:07:49 +01:00
b3349204b8 Reconnect redis-cli when cluster return "moved"
if redis works in cluster-mode and redis-cli was run with argv, reconnect if needs.
    example:
    ./redis-cli set foo bar

    if return is MOVED redis-cli just do nothing.
2014-12-11 15:07:49 +01:00
0f1107432a Typo fixes in redis.conf
Fix two typos in redis.conf:

- "trnasfers" --> "transfers"
- "enalbed" --> "enabled"
2014-12-11 15:07:49 +01:00
2f52a1191f zipmap.c: update comments above 2014-12-09 16:01:11 +01:00
c86b031572 replaced // comments #2150 2014-12-09 15:26:22 +01:00
0aac7ad8ff redis-benchmark AUTH command to be discarded after the first send #2150 2014-12-09 15:26:22 +01:00
c5b449ea55 sds.c: Correct two spelling mistakes in comments 2014-12-09 15:14:09 +01:00
559cefce13 sds.c/sdscatvprintf: set va_end to finish va_list cpy 2014-12-09 15:14:09 +01:00
3959fa2c02 sds.c: Correct some comments 2014-12-09 15:14:09 +01:00
24ae9a4a82 redis-benchmark: default num of requests is now 100000.
10000 completes in a too short time and may easily provide unreliable
figures because of tiny duration.
2014-12-09 13:02:10 +01:00
97d31c63e8 fix benchmark memleak in loop mode 2014-12-09 13:02:10 +01:00
73996c8615 Cluster PUBLISH message: fix totlen count.
bulk_data field size was not removed from the count. It is not possible
to declare it simply as 'char bulk_data[]' since the structure is nested
into another structure.
2014-12-09 13:01:47 +01:00
e4d4eff15e Update whatisdoing.sh
Improved getting pid
2014-12-09 13:01:25 +01:00
2533e2994e Include stropts only if __sun is defined. 2014-12-09 12:59:36 +01:00
52bc358c11 Fix implicit declaration of ioctl on Solaris 2014-12-09 12:57:56 +01:00
aa130caeae bitops.c/bitopCommand: skip short minlen for FAST PATH 2014-12-09 12:46:43 +01:00
5fc55a1afa bitops.c/redisPopcount: little optimization in loop 2014-12-09 12:46:43 +01:00
5ab2c31189 Silence _BSD_SOURCE warnings in glibc 2.20 and forward
See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes
2014-12-09 12:24:28 +01:00
cfe04da17d Mark whatisdoing.sh as deprecated in top-comment. 2014-12-09 12:18:39 +01:00
81eed2f5f6 getting pid fixes
```sh
$ ~ pidof redis-server
# nothing

$ ~ ps aux | grep [r]edis
redis      593  0.0  0.0  36900  5564 ?        Ssl  Dec02   1:37 /usr/bin/redis-server 127.0.0.1:6379
klay     15927  0.0  0.0  16772  6068 pts/6    S+   13:58   0:00 redis-cli

$ ~ uname -a
Linux edge 3.17.4-1-ARCH #1 SMP PREEMPT Fri Nov 21 21:14:42 CET 2014 x86_64 GNU/Linux
```
2014-12-09 12:09:34 +01:00