@cryptotaxi247 / netdata-1 / commits / 706f150a8

change log level to debug for dbengine routine operations on start (#16518)

Ilya Mashchenko committed Dec 1, 2023 at 19:10 UTC 706f150a8b330145b993a3e979f3370bfa607d2b
4 files changed +12 -11
collectors/proc.plugin/proc_diskstats.c
+1 -1
@@ -367,7 +367,7 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
367 DIR *dir = opendir(path);
368 if (!dir) {
369 if (errno == ENOENT)
370 - collector_info("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
370 + nd_log_collector(NDLP_DEBUG, "DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s': no such file or directory.", disk, major, minor, path);
371 else
372 collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
373 goto failed;
daemon/daemon.c
-3
@@ -108,9 +108,6 @@ int become_user(const char *username, int pid_fd) {
108 uid_t uid = pw->pw_uid;
109 gid_t gid = pw->pw_gid;
110
111 - if (am_i_root)
112 - netdata_log_info("I am root, so checking permissions");
113 -
111 prepare_required_directories(uid, gid);
112
113 if(pidfile[0]) {
database/engine/datafile.c
+5 -2
@@ -338,7 +338,8 @@ static int load_data_file(struct rrdengine_datafile *datafile)
338 ctx_fs_error(ctx);
339 return fd;
340 }
341 - netdata_log_info("DBENGINE: initializing data file \"%s\".", path);
341 +
342 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: initializing data file \"%s\".", path);
343
344 ret = check_file_properties(file, &file_size, sizeof(struct rrdeng_df_sb));
345 if (ret)
@@ -354,7 +355,8 @@ static int load_data_file(struct rrdengine_datafile *datafile)
355 datafile->file = file;
356 datafile->pos = file_size;
357
357 - netdata_log_info("DBENGINE: data file \"%s\" initialized (size:%"PRIu64").", path, file_size);
358 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: data file \"%s\" initialized (size:%" PRIu64 ").", path, file_size);
359 +
360 return 0;
361
362 error:
@@ -422,6 +424,7 @@ static int scan_data_files(struct rrdengine_instance *ctx)
424
425 ctx->atomic.last_fileno = datafiles[matched_files - 1]->fileno;
426
427 + netdata_log_info("DBENGINE: loading %d data/journal of tier %d...", matched_files, ctx->config.tier);
428 for (failed_to_load = 0, i = 0 ; i < matched_files ; ++i) {
429 uint8_t must_delete_pair = 0;
430
database/engine/journalfile.c
+6 -5
@@ -1013,7 +1013,7 @@ void journalfile_v2_populate_retention_to_mrg(struct rrdengine_instance *ctx, st
1013 journalfile_v2_data_release(journalfile);
1014 usec_t ended_ut = now_monotonic_usec();
1015
1016 - netdata_log_info("DBENGINE: journal v2 of tier %d, datafile %u populated, size: %0.2f MiB, metrics: %0.2f k, %0.2f ms"
1016 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: journal v2 of tier %d, datafile %u populated, size: %0.2f MiB, metrics: %0.2f k, %0.2f ms"
1017 , ctx->config.tier, journalfile->datafile->fileno
1018 , (double)data_size / 1024 / 1024
1019 , (double)entries / 1000
@@ -1073,7 +1073,8 @@ int journalfile_v2_load(struct rrdengine_instance *ctx, struct rrdengine_journal
1073 return 1;
1074 }
1075
1076 - netdata_log_info("DBENGINE: checking integrity of '%s'", path_v2);
1076 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: checking integrity of '%s'", path_v2);
1077 +
1078 usec_t validation_start_ut = now_monotonic_usec();
1079 int rc = journalfile_v2_validate(data_start, journal_v2_file_size, journal_v1_file_size);
1080 if (unlikely(rc)) {
@@ -1104,7 +1105,7 @@ int journalfile_v2_load(struct rrdengine_instance *ctx, struct rrdengine_journal
1105
1106 usec_t finished_ut = now_monotonic_usec();
1107
1107 - netdata_log_info("DBENGINE: journal v2 '%s' loaded, size: %0.2f MiB, metrics: %0.2f k, "
1108 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: journal v2 '%s' loaded, size: %0.2f MiB, metrics: %0.2f k, "
1109 "mmap: %0.2f ms, validate: %0.2f ms"
1110 , path_v2
1111 , (double)journal_v2_file_size / 1024 / 1024
@@ -1535,13 +1536,13 @@ int journalfile_load(struct rrdengine_instance *ctx, struct rrdengine_journalfil
1536 }
1537 ctx_io_read_op_bytes(ctx, sizeof(struct rrdeng_jf_sb));
1538
1538 - netdata_log_info("DBENGINE: loading journal file '%s'", path);
1539 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: loading journal file '%s'", path);
1540
1541 max_id = journalfile_iterate_transactions(ctx, journalfile);
1542
1543 __atomic_store_n(&ctx->atomic.transaction_id, MAX(__atomic_load_n(&ctx->atomic.transaction_id, __ATOMIC_RELAXED), max_id + 1), __ATOMIC_RELAXED);
1544
1544 - netdata_log_info("DBENGINE: journal file '%s' loaded (size:%"PRIu64").", path, file_size);
1545 + nd_log_daemon(NDLP_DEBUG, "DBENGINE: journal file '%s' loaded (size:%" PRIu64 ").", path, file_size);
1546
1547 bool is_last_file = (ctx_last_fileno_get(ctx) == journalfile->datafile->fileno);
1548 if (is_last_file && journalfile->datafile->pos <= rrdeng_target_data_file_size(ctx) / 3) {