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

DAOS-15847 container: add a few debug log #15962

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/container/container_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,9 @@ cont_iv_ent_fetch(struct ds_iv_entry *entry, struct ds_iv_key *key,
rc = cont_iv_prop_ent_create(entry, key);
if (rc == 0)
goto again;
D_ERROR("create cont prop iv entry failed "
""DF_RC"\n", DP_RC(rc));
D_ERROR("cont " DF_UUID " create IV_CONT_PROP iv entry failed "
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest use DL_ERROR(rc, ...) here

also it may be helpful to log the container UUID in the other log calls in this function like D_DEBUG above on line 476 for IV_CONT_SNAP case and the D_DEBUG on line 546 at the end of the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, this PR included in #15994

"" DF_RC "\n",
DP_UUID(civ_key->cont_uuid), DP_RC(rc));
} else if (class_id == IV_CONT_CAPA) {
struct container_hdl chdl = { 0 };
int rc1;
Expand Down
14 changes: 11 additions & 3 deletions src/container/srv_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -2058,8 +2058,10 @@
d_iov_set(&tmp, NULL, 0);
/* check if the container exists or not */
rc = rdb_tx_lookup(tx, &svc->cs_conts, &key, &tmp);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, "cont " DF_UUID ", rdb_tx_lookup failed.\n", DP_UUID(uuid));

Check warning on line 2062 in src/container/srv_container.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if adding an ERR message in this internal function is good - maybe it could cause a bunch of unwanted logging in certain cases? There are many callers, and it seems there are differences in the callers, whether they invoke DL_ERROR if this function returns rc != 0.

D_GOTO(err, rc);
}

D_ALLOC_PTR(p);
if (p == NULL) {
Expand Down Expand Up @@ -2126,6 +2128,7 @@
err_p:
D_FREE(p);
err:
DL_ERROR(rc, "cont " DF_UUID ", lookup failed.\n", DP_UUID(uuid));

Check warning on line 2131 in src/container/srv_container.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above. Also, if these errors are kept, probably don't need "cont " in the output since the function name already has that.

return rc;
}

Expand Down Expand Up @@ -5934,17 +5937,22 @@

D_ASSERT(dss_get_module_info()->dmi_xs_id == 0);
rc = cont_svc_lookup_leader(pool_uuid, 0, &svc, NULL);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, "pool " DF_UUID " cont_svc_lookup_leader failed\n",

Check warning on line 5941 in src/container/srv_container.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
DP_UUID(pool_uuid));
return rc;
}

rc = rdb_tx_begin(svc->cs_rsvc->s_db, svc->cs_rsvc->s_term, &tx);
if (rc != 0)
D_GOTO(out_put, rc);

ABT_rwlock_rdlock(svc->cs_lock);
rc = cont_lookup(&tx, svc, cont_uuid, &cont);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, DF_CONT " cont_lookup failed\n", DP_CONT(pool_uuid, cont_uuid));

Check warning on line 5953 in src/container/srv_container.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
D_GOTO(out_lock, rc);
}

rc = cont_prop_read(&tx, cont, DAOS_CO_QUERY_PROP_ALL, &prop, true);
cont_put(cont);
Expand Down
10 changes: 8 additions & 2 deletions src/container/srv_epoch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -682,17 +683,22 @@

D_ASSERT(dss_get_module_info()->dmi_xs_id == 0);
rc = cont_svc_lookup_leader(pool_uuid, 0, &svc, NULL);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, "pool " DF_UUID " cont_svc_lookup_leader failed\n",

Check warning on line 687 in src/container/srv_epoch.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
DP_UUID(pool_uuid));
return rc;
}

rc = rdb_tx_begin(svc->cs_rsvc->s_db, svc->cs_rsvc->s_term, &tx);
if (rc != 0)
D_GOTO(out_put, rc);

ABT_rwlock_rdlock(svc->cs_lock);
rc = cont_lookup(&tx, svc, cont_uuid, &cont);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, DF_CONT " cont_lookup failed\n", DP_CONT(pool_uuid, cont_uuid));

Check warning on line 699 in src/container/srv_epoch.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
D_GOTO(out_lock, rc);
}

rc = read_snap_list(&tx, cont, snapshots, snap_count);
cont_put(cont);
Expand Down
5 changes: 4 additions & 1 deletion src/pool/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2613,8 +2613,11 @@
int rc;

rc = pool_svc_lookup_leader(pool_uuid, &pool_svc, hint);
if (rc != 0)
if (rc != 0) {
DL_ERROR(rc, "pool " DF_UUID " pool_svc_lookup_leader failed\n",

Check warning on line 2617 in src/pool/srv_pool.c

View workflow job for this annotation

GitHub Actions / Logging macro checking

check-return, Line contains too many newlines
DP_UUID(pool_uuid));
return rc;
}
*svcp = pool_svc->ps_cont_svc;
return 0;
}
Expand Down
Loading