snehac-miner / redis

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

SLAVEOF shutdowns redis-server #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. start up a fresh instance of redis-server
2. run the following:

(echo "SLAVEOF www.google.com 80";) | telnet redishost 6380

3. redis-server shuts down in rdbLoad() since the rdb file is empty. (first
fread fails)

I don't know why rdbLoad() is called under this circumstance.

Original issue reported on code.google.com by arnim...@gmail.com on 12 Oct 2009 at 4:28

GoogleCodeExporter commented 8 years ago
I analyzed this a little bit.

What happens is that the slave assumes that the response of a "SYNC\r\n" 
request to
the master is not malformed. The 2nd byte is assumed to be the response length, 
the
rest of which is then dumped straight to disk, and then read again through 
rdbLoad().

If the master response is "HTTP/1.0 400 Bad Request" (giving an expected 
response
lenght of atoi(buf+1) == 0) which is then dumped to disk, resulting in an empty 
file.

Original comment by arnim...@gmail.com on 13 Oct 2009 at 11:35

GoogleCodeExporter commented 8 years ago

Original comment by anti...@gmail.com on 23 Oct 2009 at 12:44

GoogleCodeExporter commented 8 years ago
Fixed & Verified

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

GoogleCodeExporter commented 8 years ago

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