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
e3d27a72
Commit
e3d27a72
authored
Jun 10, 2011
by
antirez
Browse files
Avoid division by zero issues in the automatically triggered AOF rewrite feature.
parent
e087b6d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
e3d27a72
...
@@ -695,8 +695,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
...
@@ -695,8 +695,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
if
(
server
.
auto_aofrewrite_perc
&&
if
(
server
.
auto_aofrewrite_perc
&&
server
.
appendonly_current_size
>
server
.
auto_aofrewrite_min_size
)
server
.
appendonly_current_size
>
server
.
auto_aofrewrite_min_size
)
{
{
int
growth
=
(
server
.
appendonly_current_size
*
100
/
int
base
=
server
.
auto_aofrewrite_base_size
?
server
.
auto_aofrewrite_base_size
);
server
.
auto_aofrewrite_base_size
:
1
;
int
growth
=
(
server
.
appendonly_current_size
*
100
/
base
);
if
(
growth
>=
server
.
auto_aofrewrite_perc
)
{
if
(
growth
>=
server
.
auto_aofrewrite_perc
)
{
redisLog
(
REDIS_NOTICE
,
"Starting automatic rewriting of AOF on %d growth"
,
growth
);
redisLog
(
REDIS_NOTICE
,
"Starting automatic rewriting of AOF on %d growth"
,
growth
);
rewriteAppendOnlyFileBackground
();
rewriteAppendOnlyFileBackground
();
...
...
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