Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
18e61fa2
Commit
18e61fa2
authored
Mar 06, 2010
by
antirez
Browse files
Fix for replicaiton with over 2GB dump file initial SYNC stage
parent
978c2c94
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
18e61fa2
...
@@ -6787,7 +6787,7 @@ static void updateSlavesWaitingBgsave(int bgsaveerr) {
...
@@ -6787,7 +6787,7 @@ static void updateSlavesWaitingBgsave(int bgsaveerr) {
static int syncWithMaster(void) {
static int syncWithMaster(void) {
char buf[1024], tmpfile[256], authcmd[1024];
char buf[1024], tmpfile[256], authcmd[1024];
int
dumpsize
;
long
dumpsize;
int fd = anetTcpConnect(NULL,server.masterhost,server.masterport);
int fd = anetTcpConnect(NULL,server.masterhost,server.masterport);
int dfd;
int dfd;
...
@@ -6839,8 +6839,8 @@ static int syncWithMaster(void) {
...
@@ -6839,8 +6839,8 @@ static int syncWithMaster(void) {
redisLog(REDIS_WARNING,"Bad protocol from MASTER, the first byte is not '$', are you sure the host and port are right?");
redisLog(REDIS_WARNING,"Bad protocol from MASTER, the first byte is not '$', are you sure the host and port are right?");
return REDIS_ERR;
return REDIS_ERR;
}
}
dumpsize
=
a
to
i
(
buf
+
1
);
dumpsize =
str
to
l
(buf+1
,NULL,10
);
redisLog
(
REDIS_NOTICE
,
"Receiving %d bytes data dump from MASTER"
,
dumpsize
);
redisLog(REDIS_NOTICE,"Receiving %
l
d bytes data dump from MASTER",dumpsize);
/* Read the bulk write data on a temp file */
/* Read the bulk write data on a temp file */
snprintf(tmpfile,256,"temp-%d.%ld.rdb",(int)time(NULL),(long int)random());
snprintf(tmpfile,256,"temp-%d.%ld.rdb",(int)time(NULL),(long int)random());
dfd = open(tmpfile,O_CREAT|O_WRONLY,0644);
dfd = open(tmpfile,O_CREAT|O_WRONLY,0644);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment