@cryptotaxi247 / netdata-1 / commits / c851ea0ad

Ignore dbengine journal files that can not be read (#11210)

Stelios Fragkakis committed Jun 1, 2021 at 12:44 UTC c851ea0adaab9c8f016bbe75e6b021d5ea147c17
1 file changed +4 -3
database/engine/journalfile.c
+4 -3
@@ -428,8 +428,9 @@ static uint64_t iterate_transactions(struct rrdengine_instance *ctx, struct rrde
428 iov = uv_buf_init(buf, size_bytes);
429 ret = uv_fs_read(NULL, &req, file, &iov, 1, pos, NULL);
430 if (ret < 0) {
431 - fatal("uv_fs_read: %s", uv_strerror(ret));
432 - /*uv_fs_req_cleanup(&req);*/
431 + error("uv_fs_read: pos=%lu, %s", pos, uv_strerror(ret));
432 + uv_fs_req_cleanup(&req);
433 + goto skip_file;
434 }
435 fatal_assert(req.result >= 0);
436 uv_fs_req_cleanup(&req);
@@ -451,7 +452,7 @@ static uint64_t iterate_transactions(struct rrdengine_instance *ctx, struct rrde
452 max_id = MAX(max_id, id);
453 }
454 }
454 -
455 +skip_file:
456 free(buf);
457 return max_id;
458 }