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
180c9143
Commit
180c9143
authored
Jul 04, 2014
by
antirez
Browse files
Use amount of I/O not ops to trigger aofReadDiffFromParent().
parent
e05cd363
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
180c9143
...
@@ -965,8 +965,8 @@ int rewriteAppendOnlyFile(char *filename) {
...
@@ -965,8 +965,8 @@ int rewriteAppendOnlyFile(char *filename) {
char
tmpfile
[
256
];
char
tmpfile
[
256
];
int
j
;
int
j
;
long
long
now
=
mstime
();
long
long
now
=
mstime
();
unsigned
long
ops
=
0
;
char
byte
;
char
byte
;
size_t
processed
=
0
;
/* Note that we have to use a different temp name here compared to the
/* Note that we have to use a different temp name here compared to the
* one used by rewriteAppendOnlyFileBackground() function. */
* one used by rewriteAppendOnlyFileBackground() function. */
...
@@ -1038,7 +1038,10 @@ int rewriteAppendOnlyFile(char *filename) {
...
@@ -1038,7 +1038,10 @@ int rewriteAppendOnlyFile(char *filename) {
if
(
rioWriteBulkLongLong
(
&
aof
,
expiretime
)
==
0
)
goto
werr
;
if
(
rioWriteBulkLongLong
(
&
aof
,
expiretime
)
==
0
)
goto
werr
;
}
}
/* Read some diff from the parent process from time to time. */
/* Read some diff from the parent process from time to time. */
if
(
ops
++
%
1000
)
aofReadDiffFromParent
();
if
(
aof
.
processed_bytes
>
processed
+
REDIS_AOF_AUTOSYNC_BYTES
)
{
processed
=
aof
.
processed_bytes
;
aofReadDiffFromParent
();
}
}
}
dictReleaseIterator
(
di
);
dictReleaseIterator
(
di
);
}
}
...
...
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