snehac-miner / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

redis-server crashes when it can't connect to MASTER and client connects to SLAVE #76

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have setup a redis SLAVE to replicate from a MASTER, and I noticed if the 
MASTER goes down, 
the SLAVE can't accept anymore connections because it crashes after it receives 
a command.

I am using Redis version 1.02

Here is what I did:

MASTER: ./redis-server redis.conf
SLAVE: ./redis-server redis.conf
SLAVE: ./redis-cli info
... output as expected
MASTER: ./redis-cli shutdown
SLAVE: ./redis-cli info
... OOPS

Here is the logfile output:

28 Oct 15:51:20 - Server started, Redis version 1.02
28 Oct 15:51:20 * WARNING overcommit_memory is set to 0! Background save may 
fail under 
low condition memory. To fix this issue add 'vm.
overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 
'sysctl 
vm.overcommit_memory=1' for this to take effect.
28 Oct 15:51:20 - The server is now ready to accept connections on port 6379
28 Oct 15:51:21 . 0 clients connected (0 slaves), 4536 bytes in use, 0 shared 
objects
28 Oct 15:51:21 - Connecting to MASTER...
28 Oct 15:51:21 - Receiving 10 bytes data dump from MASTER
28 Oct 15:51:21 - MASTER <-> SLAVE sync succeeded
28 Oct 15:51:26 . 1 clients connected (0 slaves), 4833 bytes in use, 0 shared 
objects
28 Oct 15:51:31 . 1 clients connected (0 slaves), 4833 bytes in use, 0 shared 
objects
28 Oct 15:51:36 . 1 clients connected (0 slaves), 4833 bytes in use, 0 shared 
objects
28 Oct 15:51:37 . Accepted 172.16.0.60:34657
28 Oct 15:51:37 . Client closed connection
28 Oct 15:51:41 . 1 clients connected (0 slaves), 5001 bytes in use, 0 shared 
objects
28 Oct 15:51:46 . 1 clients connected (0 slaves), 5001 bytes in use, 0 shared 
objects
28 Oct 15:51:51 . Client closed connection
28 Oct 15:51:51 . 0 clients connected (0 slaves), 4704 bytes in use, 0 shared 
objects
28 Oct 15:51:51 - Connecting to MASTER...
28 Oct 15:51:51 * Unable to connect to MASTER: Connection refused
28 Oct 15:51:52 - Connecting to MASTER...
28 Oct 15:51:52 * Unable to connect to MASTER: Connection refused
28 Oct 15:51:53 - Connecting to MASTER...
28 Oct 15:51:53 * Unable to connect to MASTER: Connection refused
28 Oct 15:51:54 - Connecting to MASTER...
28 Oct 15:51:54 * Unable to connect to MASTER: Connection refused
28 Oct 15:51:55 . Accepted 172.16.0.60:34659
28 Oct 15:51:55 * ======= Ooops! Redis 1.02 got signal: -11- =======
28 Oct 15:51:55 * redis_version:1.02; uptime_in_seconds:35; 
connected_clients:1; 
connected_slaves:0; used_memory:4704; changes_since_las
t_save:0; bgsave_in_progress:0; last_save_time:1256745080; 
total_connections_received:2; 
total_commands_processed:1; role:slave;
28 Oct 15:51:55 * 1 redis-server 0x7f2204fd9f60 keysCommand + 79478336
28 Oct 15:51:55 * 2 redis-server 0x407c1e infoCommand + 334
28 Oct 15:51:55 * 3 redis-server 0x4094ab processCommand + 427
28 Oct 15:51:55 * 4 redis-server 0x40b3a2 readQueryFromClient + 434
28 Oct 15:51:55 * ./redis-server(aeProcessEvents+0x2ef) [0x403d5f]
28 Oct 15:51:55 * ./redis-server(aeMain+0x1d) [0x403f4d]
28 Oct 15:51:55 * ./redis-server(main+0x677) [0x40d987]
28 Oct 15:51:55 * /lib/libc.so.6(__libc_start_main+0xe6) [0x7f2204fc61a6]
28 Oct 15:51:55 * ./redis-server [0x403179]

This is running on a VM with Debian Lenny (5.0) kernel 2.6.26-2-amd64

Let me know if you need more details.

Original issue reported on code.google.com by youwanta...@gmail.com on 28 Oct 2009 at 3:57

GoogleCodeExporter commented 8 years ago
I also want to add, the .pid file is still there.

Original comment by youwanta...@gmail.com on 28 Oct 2009 at 3:59

GoogleCodeExporter commented 8 years ago
Thx! I'll fix it this night as promised ;)

Original comment by anti...@gmail.com on 28 Oct 2009 at 5:26

GoogleCodeExporter commented 8 years ago
There's no rush for me since i'm still in development... but thank you for the 
great support!

Original comment by youwanta...@gmail.com on 28 Oct 2009 at 5:51

GoogleCodeExporter commented 8 years ago
No problem it's a very simple issue :) Actually it dies *only* with INFO 
command. All the 
rest is working.

Original comment by anti...@gmail.com on 28 Oct 2009 at 6:35

GoogleCodeExporter commented 8 years ago
Fixed & Verified.

Original comment by anti...@gmail.com on 29 Oct 2009 at 10:30