Skip to content

Commit

Permalink
common: addjust loging levels
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Jan 30, 2024
1 parent 672265d commit 50d5d47
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions src/common/set.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ util_poolset_chmod(struct pool_set *set, mode_t mode)
}

if (stbuf.st_mode & ~(unsigned)S_IFMT) {
CORE_LOG_ERROR(
CORE_LOG_WARNING(
"file permissions changed during pool initialization, file: %s (%o)",
part->path,
stbuf.st_mode & ~(unsigned)S_IFMT);
Expand Down Expand Up @@ -2882,8 +2882,8 @@ util_pool_open_nocheck(struct pool_set *set, unsigned flags)

if (bbs > 0) {
if (flags & POOL_OPEN_IGNORE_BAD_BLOCKS) {
CORE_LOG_ERROR(
"WARNING: pool set contains bad blocks, ignoring");
CORE_LOG_WARNING(
"pool set contains bad blocks, ignoring");
} else {
ERR_WO_ERRNO(
"pool set contains bad blocks and cannot be opened, run 'pmempool sync --bad-blocks' utility to try to recover the pool");
Expand Down Expand Up @@ -2940,7 +2940,7 @@ util_read_compat_features(struct pool_set *set, uint32_t *compat_features)
struct pool_set_part *part = &rep->part[p];

if (util_part_open(part, 0, 0 /* create */)) {
CORE_LOG_ERROR(
CORE_LOG_WARNING(
"!cannot open the part -- \"%s\"",
part->path);
/* try to open the next part */
Expand Down Expand Up @@ -3045,8 +3045,8 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize,

if (bbs > 0) {
if (flags & POOL_OPEN_IGNORE_BAD_BLOCKS) {
CORE_LOG_ERROR(
"WARNING: pool set contains bad blocks, ignoring -- '%s'",
CORE_LOG_WARNING(
"pool set contains bad blocks, ignoring -- '%s'",
path);
} else {
ERR_WO_ERRNO(
Expand Down
2 changes: 1 addition & 1 deletion src/core/log_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef CORE_LOG_DEFAULT_H
#define CORE_LOG_DEFAULT_H

void core_log_default_function(void *context, enum core_log_level level,
void core_log_default_function(void *context, enum core_log_level level,
const char *file_name, const int line_no, const char *function_name,
const char *message_format, ...);

Expand Down
14 changes: 7 additions & 7 deletions src/libpmempool/replica.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ replica_part_badblocks_recovery_file_read(struct part_health_status *part_hs)

os_fclose(recovery_file);

CORE_LOG_ERROR("bad blocks read from the recovery file -- '%s'", path);
CORE_LOG_ALWAYS("bad blocks read from the recovery file -- '%s'", path);

return 0;

Expand Down Expand Up @@ -928,7 +928,7 @@ replica_badblocks_recovery_files_read(struct pool_set *set,
continue;
}

CORE_LOG_ERROR(
CORE_LOG_NOTICE(
"reading bad blocks from the recovery file -- '%s'",
part_hs->recovery_file_name);

Expand All @@ -942,7 +942,7 @@ replica_badblocks_recovery_files_read(struct pool_set *set,
}

if (ret > 0) {
CORE_LOG_ERROR(
CORE_LOG_WARNING(
"incomplete bad block recovery file detected -- '%s'",
part_hs->recovery_file_name);
return 1;
Expand Down Expand Up @@ -1254,9 +1254,9 @@ replica_badblocks_check_or_clear(struct pool_set *set,
if (ret > 0) {
/* incomplete bad block recovery file was detected */

CORE_LOG_ERROR(
"warning: incomplete bad block recovery file detected\n"
" - all recovery files will be removed");
CORE_LOG_WARNING(
"incomplete bad block recovery file detected\n"
"- all recovery files will be removed");

/* changing status to RECOVERY_FILES_NOT_ALL_EXIST */
status = RECOVERY_FILES_NOT_ALL_EXIST;
Expand All @@ -1281,7 +1281,7 @@ replica_badblocks_check_or_clear(struct pool_set *set,
*/

if (!dry_run) {
CORE_LOG_ERROR(
CORE_LOG_ALWAYS(
"removing all bad block recovery files...");
ret = replica_remove_all_recovery_files(set_hs);
if (ret < 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/libpmempool/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ sync_badblocks_data(struct pool_set *set, struct poolset_health_status *set_hs)
sync_mark_replica_no_badblocks(r, set_hs);
}

CORE_LOG_ERROR("all bad blocks have been fixed");
CORE_LOG_ALWAYS("all bad blocks have been fixed");

if (replica_remove_all_recovery_files(set_hs)) {
CORE_LOG_ERROR("removing bad block recovery files failed");
Expand Down Expand Up @@ -1326,7 +1326,7 @@ replica_sync(struct pool_set *set, struct poolset_health_status *s_hs,

/* check if poolset is broken; if not, nothing to do */
if (replica_is_poolset_healthy(set_hs)) {
CORE_LOG_ERROR("poolset is healthy");
CORE_LOG_NOTICE("poolset is healthy");
goto out;
}
} else {
Expand All @@ -1348,7 +1348,7 @@ replica_sync(struct pool_set *set, struct poolset_health_status *s_hs,

/* in dry-run mode we can stop here */
if (is_dry_run(flags)) {
CORE_LOG_ERROR("Sync in dry-run mode finished successfully");
CORE_LOG_NOTICE("Sync in dry-run mode finished successfully");
goto out;
}

Expand Down
14 changes: 7 additions & 7 deletions src/libpmempool/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ check_if_part_used_once(struct pool_set *set, unsigned repn, unsigned partn)
struct pool_replica *rep = REP(set, repn);
char *path = util_part_realpath(PART(rep, partn)->path);
if (path == NULL) {
CORE_LOG_ERROR(
CORE_LOG_WARNING(
"cannot get absolute path for %s, replica %u, part %u",
PART(rep, partn)->path, repn, partn);
errno = 0;
Expand All @@ -81,7 +81,7 @@ check_if_part_used_once(struct pool_set *set, unsigned repn, unsigned partn)
ret = -1;
goto out;
}
CORE_LOG_ERROR(
CORE_LOG_WARNING(
"cannot get absolute path for %s, replica %u, part %u",
PART(rep, partn)->path, repn, partn);
pathp = strdup(PART(repr, p)->path);
Expand Down Expand Up @@ -259,7 +259,7 @@ check_compare_poolsets_status(struct pool_set *set_in,
struct pool_replica *rep_in = REP(set_in, ri);
for (unsigned ro = 0; ro < set_out->nreplicas; ++ro) {
struct pool_replica *rep_out = REP(set_out, ro);
CORE_LOG_ERROR("comparing rep_in %u with rep_out %u",
CORE_LOG_DEBUG("comparing rep_in %u with rep_out %u",
ri, ro);
/* skip different replicas */
if (compare_replicas(rep_in, rep_out))
Expand Down Expand Up @@ -504,7 +504,7 @@ copy_replica_data_fw(struct pool_set *set_dst, struct pool_set *set_src,
LOG(3, "set_in %p, set_out %p, repn %u", set_src, set_dst, repn);
ssize_t pool_size = replica_get_pool_size(set_src, repn);
if (pool_size < 0) {
CORE_LOG_ERROR("getting pool size from replica %u failed",
CORE_LOG_WARNING("getting pool size from replica %u failed",
repn);
pool_size = (ssize_t)set_src->poolsize;
}
Expand Down Expand Up @@ -532,7 +532,7 @@ copy_replica_data_bw(struct pool_set *set_dst, struct pool_set *set_src,
LOG(3, "set_in %p, set_out %p, repn %u", set_src, set_dst, repn);
ssize_t pool_size = replica_get_pool_size(set_src, repn);
if (pool_size < 0) {
CORE_LOG_ERROR("getting pool size from replica %u failed",
CORE_LOG_WARNING("getting pool size from replica %u failed",
repn);
pool_size = (ssize_t)set_src->poolsize;
}
Expand Down Expand Up @@ -919,7 +919,7 @@ replica_transform(struct pool_set *set_in, struct pool_set *set_out,
CORE_LOG_ERROR(
"falling back to the input poolset failed");
} else {
CORE_LOG_ERROR(
CORE_LOG_ALWAYS(
"falling back to the input poolset succeeded");
}
ret = -1;
Expand All @@ -937,7 +937,7 @@ replica_transform(struct pool_set *set_in, struct pool_set *set_out,
CORE_LOG_ERROR(
"falling back to the input poolset failed");
} else {
CORE_LOG_ERROR(
CORE_LOG_ALWAYS(
"falling back to the input poolset succeeded");
}
ret = -1;
Expand Down

0 comments on commit 50d5d47

Please sign in to comment.