Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core log warning #5988

Merged
merged 6 commits into from
Feb 5, 2024
Merged

Core log warning #5988

merged 6 commits into from
Feb 5, 2024

Conversation

grom72
Copy link
Contributor

@grom72 grom72 commented Jan 29, 2024

Rrquires:


This change is Reviewable

@grom72 grom72 added sprint goal This pull request is part of the ongoing sprint no changelog Add to skip the changelog check on your pull request labels Jan 29, 2024
@grom72 grom72 requested a review from janekmi January 29, 2024 10:49
@grom72 grom72 force-pushed the core-log-warning branch 2 times, most recently from a5ffeee to 57df606 Compare January 29, 2024 12:08
@grom72 grom72 marked this pull request as ready for review January 29, 2024 13:41
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 170 lines in your changes are missing coverage. Please review.

Comparison is base (e67b654) 68.64% compared to head (99898a1) 68.62%.

❗ Current head 99898a1 differs from pull request most recent head 506a7ff. Consider uploading reports for the commit 506a7ff to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5988      +/-   ##
==========================================
- Coverage   68.64%   68.62%   -0.02%     
==========================================
  Files         132      132              
  Lines       19583    19585       +2     
  Branches     3264     3268       +4     
==========================================
- Hits        13442    13440       -2     
- Misses       6141     6145       +4     

@grom72 grom72 force-pushed the core-log-warning branch 5 times, most recently from 381c763 to 99898a1 Compare January 30, 2024 22:17
Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 11 of 21 files at r7, 1 of 3 files at r9, all commit messages.
Reviewable status: 12 of 70 files reviewed, 55 unresolved discussions (waiting on @grom72)


src/common/file.c line 212 at r10 (raw file):

	ssize_t size = util_fd_get_size(fd);
	if (size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 218 at r10 (raw file):

	addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 250 at r10 (raw file):

	ssize_t size = util_fd_get_size(fd);
	if (size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 256 at r10 (raw file):

	if (off > size) {
		CORE_LOG_WARNING("offset beyond file length, %ju > %ju", off,

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 272 at r10 (raw file):

	void *addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 307 at r10 (raw file):

		int fd = util_file_open(path, NULL, 0, O_RDWR);
		if (fd < 0) {
			CORE_LOG_WARNING("failed to open file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 320 at r10 (raw file):

	ssize_t file_size = util_file_get_size(path);
	if (file_size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 335 at r10 (raw file):

	void *addr = util_file_map_whole(path);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 361 at r10 (raw file):

		int fd = util_file_open(path, NULL, 0, O_RDONLY);
		if (fd < 0) {
			CORE_LOG_WARNING("failed to open file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 374 at r10 (raw file):

	ssize_t file_size = util_file_get_size(path);
	if (file_size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 389 at r10 (raw file):

	void *addr = util_file_map_whole(path);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/file.c line 547 at r10 (raw file):

	int fd = util_file_open(path, NULL, 0, O_RDONLY);
	if (fd < 0) {
		CORE_LOG_WARNING("failed to open file \"%s\"", path);

Suggestion:

CORE_LOG_ERROR

src/common/os_deep_linux.c line 42 at r10 (raw file):

			} else {
				errno = pmem2_err_to_errno(ret);
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 343 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; ++r) {
		if (util_replica_open(set, r, MAP_SHARED)) {
			CORE_LOG_WARNING("replica open failed: replica %u", r);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 1053 at r10 (raw file):

		ssize_t size = util_file_get_size(entry->path);
		if (size < 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 1484 at r10 (raw file):

				minsize);
		if (part->fd == -1) {
			CORE_LOG_WARNING("failed to create file: %s",

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 1494 at r10 (raw file):

		part->fd = util_file_open(part->path, &size, minsize, flags);
		if (part->fd == -1) {
			CORE_LOG_WARNING("failed to open file: %s", part->path);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 1972 at r10 (raw file):

		if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
				flags, 0) != 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2016 at r10 (raw file):

					break;
				}
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2085 at r10 (raw file):

	for (unsigned p = 0; p < rep->nhdrs; p++) {
		if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
			CORE_LOG_WARNING("header mapping failed - part #%d", p);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2093 at r10 (raw file):

	for (unsigned p = 0; p < rep->nhdrs; p++) {
		if (util_header_create(set, repidx, p, attr, 0) != 0) {
			CORE_LOG_WARNING("header creation failed - part #%d",

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2130 at r10 (raw file):

	if (PART(REP(set, repidx), 0)->addr == NULL) {
		if (util_replica_map_local(set, repidx, flags) != 0) {
			CORE_LOG_WARNING("replica #%u map failed", repidx);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2139 at r10 (raw file):

	if (util_replica_init_headers_local(set, repidx, flags, attr) != 0) {
		CORE_LOG_WARNING("replica #%u headers initialization failed",

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2398 at r10 (raw file):

			IGNORE_SDS(attr));
	if (ret < 0) {
		CORE_LOG_WARNING("cannot create pool set -- '%s'", path);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2485 at r10 (raw file):

			ret = util_uuid_generate(set->uuid);
			if (ret < 0) {
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2497 at r10 (raw file):

				ret = util_uuid_generate(rep->part[i].uuid);
				if (ret < 0) {
					CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2498 at r10 (raw file):

				if (ret < 0) {
					CORE_LOG_WARNING(
					"cannot generate pool set part UUID");

Suggestion:

						"cannot generate pool set part UUID");

src/common/set.c line 2524 at r10 (raw file):

		if (util_replica_create_local(set, r, flags, attr) !=
				0) {
			CORE_LOG_WARNING("replica #%u creation failed", r);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2601 at r10 (raw file):

		if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
				flags, 0) != 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2615 at r10 (raw file):

		for (unsigned p = 0; p < rep->nhdrs; p++) {
			if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2662 at r10 (raw file):

					break;
				}
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2793 at r10 (raw file):

		for (unsigned p = 0; p < rep->nhdrs; p++) {
			if (util_header_check(set, r, p, attr) != 0) {
				CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2823 at r10 (raw file):

			if (shutdown_state_check(&sds, &HDR(rep, 0)->sds,
					rep)) {
				CORE_LOG_WARNING("ADR failure detected");

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 2916 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; r++) {
		if (util_replica_open(set, r, mmap_flags) != 0) {
			CORE_LOG_WARNING("replica #%u open failed", r);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 3007 at r10 (raw file):

						flags & POOL_OPEN_IGNORE_SDS);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Suggestion:

CORE_LOG_ERROR

src/common/set.c line 3079 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; r++) {
		if (util_replica_open(set, r, mmap_flags) != 0) {
			CORE_LOG_WARNING("replica #%u open failed", r);

Suggestion:

CORE_LOG_ERROR

src/common/shutdown_state.c line 80 at r10 (raw file):

				"Cannot read unsafe shutdown count. For more information please check https://github.com/pmem/pmdk/issues/4207");
		}
		CORE_LOG_WARNING("cannot read unsafe shutdown count for %d",

.


src/common/uuid.c line 23 at r10 (raw file):

	if (buf == NULL) {
		CORE_LOG_WARNING("invalid buffer for uuid string");

.


src/common/uuid.c line 28 at r10 (raw file):

	if (u == NULL) {
		CORE_LOG_WARNING("invalid uuid structure");

.


src/common/uuid.c line 41 at r10 (raw file):

	if (len != POOL_HDR_UUID_STR_LEN - 1) {
		CORE_LOG_WARNING("snprintf(uuid): %d", len);

.


src/common/uuid.c line 59 at r10 (raw file):

{
	if (strlen(uuid) != 36) {
		CORE_LOG_WARNING("invalid uuid string");

.


src/common/uuid.c line 65 at r10 (raw file):

	if (uuid[8] != '-' || uuid[13] != '-' || uuid[18] != '-' ||
			uuid[23] != '-') {
		CORE_LOG_WARNING("invalid uuid string");

.


src/common/uuid.c line 78 at r10 (raw file):

	if (n != 11) {
		CORE_LOG_WARNING("sscanf(uuid)");

.


src/common/uuid_linux.c line 31 at r10 (raw file):

	if (fd < 0) {
		/* Fatal error */
		CORE_LOG_WARNING_W_ERRNO("open(uuid)");

Suggestion:

CORE_LOG_ERROR_W_ERRNO

src/common/uuid_linux.c line 37 at r10 (raw file):

	if (num < POOL_HDR_UUID_STR_LEN) {
		/* Fatal error */
		CORE_LOG_WARNING_W_ERRNO("read(uuid)");

.


src/libpmem/pmem.c line 480 at r10 (raw file):

					OS_DIR_SEP_STR"pmem.XXXXXX",
					open_flags & O_EXCL)) < 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/libpmemobj/heap.c line 1327 at r10 (raw file):

	unsigned capacity = (unsigned)VEC_CAPACITY(&h->arenas.vec);
	if (size < capacity) {
		CORE_LOG_WARNING("cannot decrease max number of arenas");

Suggestion:

CORE_LOG_ERROR

src/libpmemobj/lane.c line 417 at r10 (raw file):

		if (ulog_check((struct ulog *)&layout->internal,
		    OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/libpmemobj/lane.c line 420 at r10 (raw file):

				"lane %" PRIu64 " internal redo failed: %d",
				j, err);
			return err;

IMHO this one deserves a separate issue. Note err is not written when ulog_check() fails. So, lane_check() returns 0 on error... 😱

And... not all lanes are checked so it is assumed all other ulogs are correct as well.

Code quote:

	int err = 0;
	uint64_t j; /* lane index */
	struct lane_layout *layout;

	for (j = 0; j < pop->nlanes; ++j) {
		layout = lane_get_layout(pop, j);
		if (ulog_check((struct ulog *)&layout->internal,
		    OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) {
			CORE_LOG_WARNING(
				"lane %" PRIu64 " internal redo failed: %d",
				j, err);
			return err;

src/libpmemobj/list.c line 564 at r10 (raw file):

	if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) {
		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");

Suggestion:

CORE_LOG_ERROR

src/libpmemobj/list.c line 565 at r10 (raw file):

		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");
		return -1;

This return code is not consumed... 🤦‍♂️

https://github.com/pmem/pmdk/blob/master/src/libpmemobj/obj.c#L2752


src/libpmemobj/list.c line 603 at r10 (raw file):

	if ((ret = pmemobj_mutex_lock(pop, &head->lock))) {
		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");

.


src/libpmemobj/list.c line 731 at r10 (raw file):

	if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) {
		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");

.


src/libpmemobj/list.c line 765 at r10 (raw file):

	if ((ret = pmemobj_mutex_lock(pop, &head->lock))) {
		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");

.


src/libpmemobj/list.c line 842 at r10 (raw file):

	if ((ret = list_mutexes_lock(pop, head_new, head_old))) {
		errno = ret;
		CORE_LOG_WARNING("list_mutexes_lock failed");

.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7 of 21 files at r7, 25 of 25 files at r8, 2 of 3 files at r9, 3 of 3 files at r10.
Reviewable status: 49 of 70 files reviewed, 80 unresolved discussions (waiting on @grom72)


src/libpmemobj/obj.c line 90 at r10 (raw file):

	if (pop != NULL && (pop->ctl = ctl_new()) == NULL) {
		CORE_LOG_WARNING_W_ERRNO("ctl_new");

Suggestion:

CORE_LOG_ERROR_W_ERRNO

src/libpmemobj/obj.c line 105 at r10 (raw file):

		if (ctl_load_config_from_string(pop ? pop->ctl : NULL,
				pop, env_config) != 0) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_ERROR

src/libpmemobj/obj.c line 116 at r10 (raw file):

		if (ctl_load_config_from_file(pop ? pop->ctl : NULL,
				pop, env_config_file) != 0) {
			CORE_LOG_WARNING(

.


src/libpmemobj/obj.c line 1090 at r10 (raw file):

			PMEMOBJ_MIN_PART, &adj_pool_attr, &runtime_nlanes,
			REPLICAS_ENABLED) != 0) {
		CORE_LOG_WARNING("cannot create pool or pool set");

.


src/libpmemobj/obj.c line 1127 at r10 (raw file):

	/* create pool descriptor */
	if (obj_descr_create(pop, layout, set->poolsize) != 0) {
		CORE_LOG_WARNING("creation of pool descriptor failed");

.


src/libpmemobj/obj.c line 1189 at r10 (raw file):

	if ((errno = lane_check(pop)) != 0) {
		CORE_LOG_WARNING_W_ERRNO("lane_check");

.


src/libpmemobj/obj.c line 1198 at r10 (raw file):

		heap_size);
	if (errno != 0) {
		CORE_LOG_WARNING_W_ERRNO("heap_check");

.


src/libpmemobj/obj.c line 1238 at r10 (raw file):

	if (util_pool_open(set, path, PMEMOBJ_MIN_PART, &Obj_open_attr,
				nlanes, NULL, flags) != 0) {
		CORE_LOG_WARNING("cannot open pool or pool set");

.


src/libpmemobj/obj.c line 1375 at r10 (raw file):

		/* check descriptor */
		if (obj_descr_check(rep, layout, set->poolsize) != 0) {
			CORE_LOG_WARNING(

.


src/libpmemobj/obj.c line 2438 at r10 (raw file):

		obj_alloc_root(pop, size, constructor, arg)) {
		pmemobj_mutex_unlock_nofail(pop, &pop->rootlock);
		CORE_LOG_WARNING("obj_realloc_root failed");

.


src/libpmempool/pool.c line 190 at r10 (raw file):

				0, 0, true);
			if (ret < 0) {
				CORE_LOG_WARNING("cannot open pool set -- '%s'",

Suggestion:

CORE_LOG_ERROR

src/libpmempool/pool.c line 299 at r10 (raw file):

		0, 0, true);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Suggestion:

CORE_LOG_ERROR

src/libpmempool/rm.c line 125 at r10 (raw file):

	if (!is_poolset) {
		CORE_LOG_WARNING("%s: not a poolset file", path);

Suggestion:

CORE_LOG_ERROR

src/libpmempool/rm.c line 129 at r10 (raw file):

	}

	CORE_LOG_WARNING("%s: poolset file", path);

Suggestion:

CORE_LOG_DEBUG

src/libpmempool/sync.c line 44 at r10 (raw file):

	 */
	if (replica_check_part_sizes(set, PMEMOBJ_MIN_POOL)) {
		CORE_LOG_WARNING("part sizes check failed");

Suggestion:

CORE_LOG_ERROR

src/libpmempool/sync.c line 52 at r10 (raw file):

	 */
	if (replica_check_part_dirs(set)) {
		CORE_LOG_WARNING("part directories check failed");

.


src/libpmempool/sync.c line 854 at r10 (raw file):

			/* remove parts from broken replica */
			if (replica_remove_part(set, r, p, fix_bad_blocks)) {
				CORE_LOG_WARNING("cannot remove part");

.


src/libpmempool/sync.c line 861 at r10 (raw file):

			if (util_part_open(&broken_r->part[p], 0,
						1 /* create */)) {
				CORE_LOG_WARNING("cannot open/create parts");

.


src/libpmempool/transform.c line 377 at r10 (raw file):

		unsigned c = replica_counterpart(r, set_in_s);
		if (c != UNDEF_REPLICA) {
			CORE_LOG_WARNING("replica %u has a counterpart %u", r,

Suggestion:

CORE_LOG_DEBUG

src/libpmempool/transform.c line 383 at r10 (raw file):

					REP_HEALTH(set_in_hs, r)->pool_size;
		} else {
			CORE_LOG_WARNING("replica %u has no counterpart", r);

As far as I can tell, it looks like a regular part of the algorithm.

Suggestion:

CORE_LOG_NOTICE

src/libpmempool/transform.c line 397 at r10 (raw file):

	for (unsigned r = 0; r < set_out_s->nreplicas; ++r) {
		if (replica_counterpart(r, set_out_s) == UNDEF_REPLICA) {
			CORE_LOG_WARNING(

Suggestion:

CORE_LOG_NOTICE

src/test/pmempool_sync/TEST24 line 64 at r10 (raw file):


# Exclude error and warn messages printed out on the stderr by PMDK in debug
fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" | fgrep -v "*WARN*" > $LOG

Suggestion:

fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG

src/test/pmempool_transform/TEST5 line 96 at r10 (raw file):


# Exclude error messages printed out on the stderr by PMDK in debug
grep -v -E '\*ERROR\*|\*WARN\*' $LOG_TEMP > $LOG

Suggestion:

# Exclude error and warn messages printed out on the stderr by PMDK in debug
fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG

src/test/pmempool_transform/TEST6 line 75 at r10 (raw file):


# Exclude error messages printed out on the stderr by PMDK in debug
grep -v -E '\*ERROR\*|\*WARN\*' $LOG_TEMP > $LOG

Suggestion:

# Exclude error and warn messages printed out on the stderr by PMDK in debug
fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG

src/tools/pmempool/common.c line 1307 at r10 (raw file):

						POOL_OPEN_IGNORE_SDS);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Suggestion:

CORE_LOG_ERROR

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 18 of 27 files at r1, 1 of 1 files at r2, 1 of 1 files at r5, 1 of 1 files at r6.
Reviewable status: all files reviewed, 80 unresolved discussions (waiting on @grom72)

Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 80 unresolved discussions (waiting on @janekmi)


src/common/file.c line 212 at r10 (raw file):

	ssize_t size = util_fd_get_size(fd);
	if (size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Done.


src/common/file.c line 218 at r10 (raw file):

	addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Done.


src/common/file.c line 256 at r10 (raw file):

	if (off > size) {
		CORE_LOG_WARNING("offset beyond file length, %ju > %ju", off,

Done.


src/common/file.c line 272 at r10 (raw file):

	void *addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Done.


src/common/file.c line 307 at r10 (raw file):

		int fd = util_file_open(path, NULL, 0, O_RDWR);
		if (fd < 0) {
			CORE_LOG_WARNING("failed to open file \"%s\"", path);

Done.


src/common/file.c line 320 at r10 (raw file):

	ssize_t file_size = util_file_get_size(path);
	if (file_size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Done.


src/common/file.c line 335 at r10 (raw file):

	void *addr = util_file_map_whole(path);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Done.


src/common/file.c line 361 at r10 (raw file):

		int fd = util_file_open(path, NULL, 0, O_RDONLY);
		if (fd < 0) {
			CORE_LOG_WARNING("failed to open file \"%s\"", path);

Done.


src/common/file.c line 374 at r10 (raw file):

	ssize_t file_size = util_file_get_size(path);
	if (file_size < 0) {
		CORE_LOG_WARNING("cannot determine file length \"%s\"", path);

Done.


src/common/file.c line 389 at r10 (raw file):

	void *addr = util_file_map_whole(path);
	if (addr == NULL) {
		CORE_LOG_WARNING("failed to map entire file \"%s\"", path);

Done.


src/common/file.c line 547 at r10 (raw file):

	int fd = util_file_open(path, NULL, 0, O_RDONLY);
	if (fd < 0) {
		CORE_LOG_WARNING("failed to open file \"%s\"", path);

Done.


src/common/os_deep_linux.c line 42 at r10 (raw file):

			} else {
				errno = pmem2_err_to_errno(ret);
				CORE_LOG_WARNING(

Done.


src/common/set.c line 343 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; ++r) {
		if (util_replica_open(set, r, MAP_SHARED)) {
			CORE_LOG_WARNING("replica open failed: replica %u", r);

Done.


src/common/set.c line 1053 at r10 (raw file):

		ssize_t size = util_file_get_size(entry->path);
		if (size < 0) {
			CORE_LOG_WARNING(

Done.


src/common/set.c line 1484 at r10 (raw file):

				minsize);
		if (part->fd == -1) {
			CORE_LOG_WARNING("failed to create file: %s",

Done.


src/common/set.c line 1494 at r10 (raw file):

		part->fd = util_file_open(part->path, &size, minsize, flags);
		if (part->fd == -1) {
			CORE_LOG_WARNING("failed to open file: %s", part->path);

Done.


src/common/set.c line 1972 at r10 (raw file):

		if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
				flags, 0) != 0) {
			CORE_LOG_WARNING(

Done.


src/common/set.c line 2016 at r10 (raw file):

					break;
				}
				CORE_LOG_WARNING(

Done.


src/common/set.c line 2085 at r10 (raw file):

	for (unsigned p = 0; p < rep->nhdrs; p++) {
		if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
			CORE_LOG_WARNING("header mapping failed - part #%d", p);

Done.


src/common/set.c line 2093 at r10 (raw file):

	for (unsigned p = 0; p < rep->nhdrs; p++) {
		if (util_header_create(set, repidx, p, attr, 0) != 0) {
			CORE_LOG_WARNING("header creation failed - part #%d",

Done.


src/common/set.c line 2130 at r10 (raw file):

	if (PART(REP(set, repidx), 0)->addr == NULL) {
		if (util_replica_map_local(set, repidx, flags) != 0) {
			CORE_LOG_WARNING("replica #%u map failed", repidx);

Done.


src/common/set.c line 2139 at r10 (raw file):

	if (util_replica_init_headers_local(set, repidx, flags, attr) != 0) {
		CORE_LOG_WARNING("replica #%u headers initialization failed",

Done.


src/common/set.c line 2398 at r10 (raw file):

			IGNORE_SDS(attr));
	if (ret < 0) {
		CORE_LOG_WARNING("cannot create pool set -- '%s'", path);

Done.


src/common/set.c line 2485 at r10 (raw file):

			ret = util_uuid_generate(set->uuid);
			if (ret < 0) {
				CORE_LOG_WARNING(

Done.


src/common/set.c line 2497 at r10 (raw file):

				ret = util_uuid_generate(rep->part[i].uuid);
				if (ret < 0) {
					CORE_LOG_WARNING(

Done.


src/common/set.c line 2524 at r10 (raw file):

		if (util_replica_create_local(set, r, flags, attr) !=
				0) {
			CORE_LOG_WARNING("replica #%u creation failed", r);

Done.


src/common/set.c line 2601 at r10 (raw file):

		if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
				flags, 0) != 0) {
			CORE_LOG_WARNING(

Done.


src/common/set.c line 2615 at r10 (raw file):

		for (unsigned p = 0; p < rep->nhdrs; p++) {
			if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
				CORE_LOG_WARNING(

Done.


src/common/set.c line 2662 at r10 (raw file):

					break;
				}
				CORE_LOG_WARNING(

Done.


src/common/set.c line 2793 at r10 (raw file):

		for (unsigned p = 0; p < rep->nhdrs; p++) {
			if (util_header_check(set, r, p, attr) != 0) {
				CORE_LOG_WARNING(

Done.


src/common/set.c line 2823 at r10 (raw file):

			if (shutdown_state_check(&sds, &HDR(rep, 0)->sds,
					rep)) {
				CORE_LOG_WARNING("ADR failure detected");

Done.


src/common/set.c line 2916 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; r++) {
		if (util_replica_open(set, r, mmap_flags) != 0) {
			CORE_LOG_WARNING("replica #%u open failed", r);

Done.


src/common/set.c line 3007 at r10 (raw file):

						flags & POOL_OPEN_IGNORE_SDS);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Done.


src/common/set.c line 3079 at r10 (raw file):

	for (unsigned r = 0; r < set->nreplicas; r++) {
		if (util_replica_open(set, r, mmap_flags) != 0) {
			CORE_LOG_WARNING("replica #%u open failed", r);

Done.


src/common/shutdown_state.c line 80 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 23 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 28 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 41 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 59 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 65 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid.c line 78 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/common/uuid_linux.c line 31 at r10 (raw file):

	if (fd < 0) {
		/* Fatal error */
		CORE_LOG_WARNING_W_ERRNO("open(uuid)");

Done.


src/common/uuid_linux.c line 37 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmem/pmem.c line 480 at r10 (raw file):

					OS_DIR_SEP_STR"pmem.XXXXXX",
					open_flags & O_EXCL)) < 0) {
			CORE_LOG_WARNING(

Done.


src/libpmemobj/heap.c line 1327 at r10 (raw file):

	unsigned capacity = (unsigned)VEC_CAPACITY(&h->arenas.vec);
	if (size < capacity) {
		CORE_LOG_WARNING("cannot decrease max number of arenas");

Done.


src/libpmemobj/lane.c line 417 at r10 (raw file):

		if (ulog_check((struct ulog *)&layout->internal,
		    OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) {
			CORE_LOG_WARNING(

Done.


src/libpmemobj/list.c line 564 at r10 (raw file):

	if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) {
		errno = ret;
		CORE_LOG_WARNING("pmemobj_mutex_lock failed");

Done.


src/libpmemobj/list.c line 603 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/list.c line 731 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/list.c line 765 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/list.c line 842 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 105 at r10 (raw file):

		if (ctl_load_config_from_string(pop ? pop->ctl : NULL,
				pop, env_config) != 0) {
			CORE_LOG_WARNING(

Done.


src/libpmemobj/obj.c line 116 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 1090 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 1127 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 1238 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 1375 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 2438 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmempool/pool.c line 190 at r10 (raw file):

				0, 0, true);
			if (ret < 0) {
				CORE_LOG_WARNING("cannot open pool set -- '%s'",

Done.


src/libpmempool/pool.c line 299 at r10 (raw file):

		0, 0, true);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Done.


src/libpmempool/rm.c line 125 at r10 (raw file):

	if (!is_poolset) {
		CORE_LOG_WARNING("%s: not a poolset file", path);

Done.


src/libpmempool/rm.c line 129 at r10 (raw file):

	}

	CORE_LOG_WARNING("%s: poolset file", path);

Done.


src/libpmempool/sync.c line 44 at r10 (raw file):

	 */
	if (replica_check_part_sizes(set, PMEMOBJ_MIN_POOL)) {
		CORE_LOG_WARNING("part sizes check failed");

Done.


src/libpmempool/sync.c line 52 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmempool/sync.c line 854 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmempool/sync.c line 861 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmempool/transform.c line 383 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

As far as I can tell, it looks like a regular part of the algorithm.

Done.


src/libpmempool/transform.c line 397 at r10 (raw file):

	for (unsigned r = 0; r < set_out_s->nreplicas; ++r) {
		if (replica_counterpart(r, set_out_s) == UNDEF_REPLICA) {
			CORE_LOG_WARNING(

Done.


src/tools/pmempool/common.c line 1307 at r10 (raw file):

						POOL_OPEN_IGNORE_SDS);
	if (ret < 0) {
		CORE_LOG_WARNING("cannot open pool set -- '%s'", path);

Done.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 15 of 15 files at r11, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @grom72)


src/common/file.c line 380 at r11 (raw file):

	size_t max_size = (size_t)(file_size - offset);
	if (size > max_size) {
		CORE_LOG_ERROR(

Since the function is able to recover from it.

Suggestion:

CORE_LOG_WARNING

Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 70 files reviewed, 12 unresolved discussions (waiting on @janekmi)


src/common/set.c line 2498 at r10 (raw file):

				if (ret < 0) {
					CORE_LOG_WARNING(
					"cannot generate pool set part UUID");

Done.


src/libpmemobj/obj.c line 90 at r10 (raw file):

	if (pop != NULL && (pop->ctl = ctl_new()) == NULL) {
		CORE_LOG_WARNING_W_ERRNO("ctl_new");

Done.


src/libpmemobj/obj.c line 1189 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/libpmemobj/obj.c line 1198 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


src/test/pmempool_sync/TEST24 line 64 at r10 (raw file):


# Exclude error and warn messages printed out on the stderr by PMDK in debug
fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" | fgrep -v "*WARN*" > $LOG

Done.


src/test/pmempool_transform/TEST5 line 96 at r10 (raw file):


# Exclude error messages printed out on the stderr by PMDK in debug
grep -v -E '\*ERROR\*|\*WARN\*' $LOG_TEMP > $LOG

Done.


src/test/pmempool_transform/TEST6 line 75 at r10 (raw file):


# Exclude error messages printed out on the stderr by PMDK in debug
grep -v -E '\*ERROR\*|\*WARN\*' $LOG_TEMP > $LOG

Done.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 65 files at r12, 45 of 46 files at r13, 15 of 16 files at r15, 1 of 4 files at r17, 3 of 3 files at r18, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @grom72)

Copy link
Contributor Author

@grom72 grom72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @grom72)


src/common/file.c line 380 at r11 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Since the function is able to recover from it.

Done.


src/libpmempool/transform.c line 377 at r10 (raw file):

		unsigned c = replica_counterpart(r, set_in_s);
		if (c != UNDEF_REPLICA) {
			CORE_LOG_WARNING("replica %u has a counterpart %u", r,

Done.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @grom72)


src/libpmemobj/lane.c line 420 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

IMHO this one deserves a separate issue. Note err is not written when ulog_check() fails. So, lane_check() returns 0 on error... 😱

And... not all lanes are checked so it is assumed all other ulogs are correct as well.

#5993


src/libpmemobj/list.c line 565 at r10 (raw file):

Previously, janekmi (Jan Michalski) wrote…

This return code is not consumed... 🤦‍♂️

https://github.com/pmem/pmdk/blob/master/src/libpmemobj/obj.c#L2752

I just noticed that pmemobj_list_insert_new() returns the oidp produced by this function. So, I guess it is ok. Just the return code is redundant in most cases. Never mind.

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @grom72)

Copy link
Contributor

@janekmi janekmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong:

Reviewed 4 of 4 files at r19, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @grom72)

@janekmi janekmi merged commit 155f1df into pmem:master Feb 5, 2024
6 checks passed
Signed-off-by: Jan Michalski <[email protected]>
janekmi added a commit to janekmi/pmdk that referenced this pull request Feb 12, 2024
janekmi added a commit to janekmi/pmdk that referenced this pull request Feb 12, 2024
@grom72 grom72 deleted the core-log-warning branch February 15, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Add to skip the changelog check on your pull request sprint goal This pull request is part of the ongoing sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants