summaryrefslogtreecommitdiff
path: root/src/rdb.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-12-23 14:52:57 +0100
committerantirez <antirez@gmail.com>2014-12-23 14:54:34 +0100
commit840435ad0be252094b118af428590ba45ba1cec2 (patch)
tree8c33823f90053a9815948b8cba3d0aa0ad442d87 /src/rdb.c
parent5888290d260cd60aedcd695c8625eadb6f2c349e (diff)
downloadredis-840435ad0be252094b118af428590ba45ba1cec2.tar.gz
INFO loading stats: three fixes.
1. Server unxtime may remain not updated while loading AOF, so ETA is not updated correctly. 2. Number of processed byte was not initialized. 3. Possible division by zero condition (likely cause of issue #1932).
Diffstat (limited to 'src/rdb.c')
-rw-r--r--src/rdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rdb.c b/src/rdb.c
index b98948b78..3dd69f289 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -1087,8 +1087,9 @@ void startLoading(FILE *fp) {
/* Load the DB */
server.loading = 1;
server.loading_start_time = time(NULL);
+ server.loading_loaded_bytes = 0;
if (fstat(fileno(fp), &sb) == -1) {
- server.loading_total_bytes = 1; /* just to avoid division by zero */
+ server.loading_total_bytes = 0;
} else {
server.loading_total_bytes = sb.st_size;
}