Skip to content
Open
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
12 changes: 6 additions & 6 deletions src/common/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4613,9 +4613,9 @@ btr_class_feats_init(unsigned int tree_class, uint64_t *tree_feats, struct btr_c

#define TREE_CLASS_STR "Tree class... "
#define TREE_FEATURES_STR "Tree features... "
#define INVALID_CLASS_FMT "Invalid class id: %d\n"
#define UNREGISTERED_CLASS_FMT "Unregistered class id %d\n"
#define UNSUPPORTED_FEATURES_FMT "Unsupported features " DF_X64 "/" DF_X64 "\n"
#define INVALID_CLASS_FMT "Invalid class id: %d"
#define UNREGISTERED_CLASS_FMT "Unregistered class id %d"
#define UNSUPPORTED_FEATURES_FMT "Unsupported features " DF_X64 "/" DF_X64
#define OK_STR "ok.\n"

/**
Expand Down Expand Up @@ -4654,14 +4654,14 @@ btr_class_init(umem_off_t root_off, struct btr_root *root, unsigned int tree_cla
CK_PRINTF(ck, TREE_CLASS_STR);
if (tree_class >= BTR_TYPE_MAX || DAOS_FAIL_CHECK(DAOS_FAULT_BTREE_OPEN_INV_CLASS)) {
CK_APPENDFL_ERR(ck, INVALID_CLASS_FMT, tree_class);
D_DEBUG(DB_TRACE, INVALID_CLASS_FMT, tree_class);
D_DEBUG(DB_TRACE, INVALID_CLASS_FMT "\n", tree_class);
return -DER_INVAL;
}

tc = &btr_class_registered[tree_class];
if (tc->tc_ops == NULL || DAOS_FAIL_CHECK(DAOS_FAULT_BTREE_OPEN_UNREG_CLASS)) {
CK_APPENDFL_ERR(ck, UNREGISTERED_CLASS_FMT, tree_class);
D_DEBUG(DB_TRACE, UNREGISTERED_CLASS_FMT, tree_class);
D_DEBUG(DB_TRACE, UNREGISTERED_CLASS_FMT "\n", tree_class);
return -DER_NONEXIST;
}
CK_APPENDL_OK(ck);
Expand All @@ -4670,7 +4670,7 @@ btr_class_init(umem_off_t root_off, struct btr_root *root, unsigned int tree_cla
rc = btr_class_feats_init(tree_class, tree_feats, tc);
if (rc != DER_SUCCESS) {
CK_APPENDFL_ERR(ck, UNSUPPORTED_FEATURES_FMT, *tree_feats, tc->tc_feats);
D_ERROR(UNSUPPORTED_FEATURES_FMT, *tree_feats, tc->tc_feats);
D_ERROR(UNSUPPORTED_FEATURES_FMT "\n", *tree_feats, tc->tc_feats);
return rc;
}
CK_APPENDL_OK(ck);
Expand Down
14 changes: 13 additions & 1 deletion src/include/daos/checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ ck_common_printf(struct checker *ck, const char *fmt, ...)
++(ck)->ck_status.errors_num; \
}

#define CK_RC_SET(ck, rc) \
if (IS_CHECKER(ck)) { \
if ((ck)->ck_status.rc == DER_SUCCESS) \
(ck)->ck_status.rc = (rc); \
}

#define CK_APPENDFL_ERR(ck, fmt, ...) \
do { \
CK_PRINTF_WO_PREFIX(ck, CHECKER_ERROR_INFIX fmt "\n", ##__VA_ARGS__); \
Expand Down Expand Up @@ -169,10 +175,16 @@ ck_common_printf(struct checker *ck, const char *fmt, ...)

#define CK_PRINTF_ERR(ck, fmt, ...) \
do { \
CK_PRINTF(ck, fmt, ##__VA_ARGS__); \
CK_PRINTF(ck, CHECKER_ERROR_INFIX fmt, ##__VA_ARGS__); \
CK_ERR_NUM_INC(ck); \
} while (0)

#define CK_PRINTF_WARN(ck, fmt, ...) \
do { \
CK_PRINTF(ck, CHECKER_WARNING_INFIX fmt, ##__VA_ARGS__); \
Comment thread
janekmi marked this conversation as resolved.
Resolved
CK_WARN_NUM_INC(ck); \
} while (0)

/**
* An assert while run without a checker. A checker message otherwise.
*
Expand Down
11 changes: 7 additions & 4 deletions src/utils/dlck/cmds/dlck_cmd_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#define REPORT_RESULT(CK, PREFIX_FMT, TGT_ID, UUID, RC, WARN_NUM) \
do { \
if (RC == DER_SUCCESS && WARN_NUM > 0) { \
CK_PRINTF(CK, PREFIX_FMT CHECKER_OK_INFIX DLCK_WARNINGS_NUM_FMT ".\n", \
CK_PRINTF(CK, \
PREFIX_FMT ": " CHECKER_OK_INFIX DLCK_WARNINGS_NUM_FMT ".\n", \
TGT_ID, DP_UUID(UUID), WARN_NUM); \
} else { \
CK_PRINTFL_RC(CK, RC, PREFIX_FMT, TGT_ID, DP_UUID(UUID)); \
Expand Down Expand Up @@ -215,19 +216,21 @@ pool_process(struct xstream_arg *xa, struct dlck_file *file, struct checker *ck)
checker_fi_entry(exp_fail_locs, &fi_reenable);
rc = vos_pool_open_metrics(path, file->po_uuid, DLCK_POOL_OPEN_FLAGS, NULL, ck, &poh);
checker_fi_exit(fi_reenable);
POOL_REPORT_RESULT(main_ck, xa->xs->tgt_id, file->po_uuid, rc, ck->ck_status.warnings_num);
/** vos_pool_open_metrics() is fully instrumented, so rc is already accounted for in the
* checker's status. */
dlck_status_set(&xa->status, &ck->ck_status);

report:
POOL_REPORT_RESULT(main_ck, xa->xs->tgt_id, file->po_uuid, rc, ck->ck_status.warnings_num);
if (rc == DER_SUCCESS) {
conts_process(xa, poh, ck);
(void)vos_pool_close(poh);
}
if (path != NULL) {
D_FREE(path);
}
return;

report:
POOL_REPORT_RESULT(main_ck, xa->xs->tgt_id, file->po_uuid, rc, ck->ck_status.warnings_num);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/utils/dlck/dlck_pool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -36,7 +36,6 @@ dlck_pool_mkdir(const char *storage_path, uuid_t po_uuid, struct checker *ck)
}
if (rc != 0 && errno != EEXIST) {
rc = daos_errno2der(errno);
CK_PRINTFL_RC(ck, rc, "Cannot create a pool directory: %s", path);
} else {
rc = DER_SUCCESS;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/dlck/tests/dlck_checker_macros_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ test_CK_PRINTF_ERR(void **state)
{
struct checker *ck = *state;

EXPECT_CHECKER_VFPRINTF("%sworker %d: %s\n", "-> worker 42: failed\n");
EXPECT_CHECKER_VFPRINTF("%serror: worker %d: %s\n", "-> error: worker 42: failed\n");
CK_PRINTF_ERR(ck, "worker %d: %s\n", 42, "failed");
assert_int_equal(ck->ck_status.errors_num, INITIAL_ERRORS + 1);

EXPECT_CHECKER_VFPRINTF("%sworker %d: %s\n", "-> worker 43: corrupted\n");
EXPECT_CHECKER_VFPRINTF("%serror: worker %d: %s\n", "-> error: worker 43: corrupted\n");
CK_PRINTF_ERR(ck, "worker %d: %s\n", 43, "corrupted");
assert_int_equal(ck->ck_status.errors_num, INITIAL_ERRORS + 2);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/dlck/tests/fault_injection_dlck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fault_config:
# - id: 131600 # DAOS_FAULT_GC_TREE_FEATURES
# - id: 131593 # DAOS_FAULT_POOL_EXT_PADDING
# - id: 131594 # DAOS_FAULT_POOL_EXT_RESERVED
# - id: 131344 # DLCK_FAULT_CONT_DOES_NOT_EXIST
# - id: 131346 # DLCK_FAULT_CONT_DOES_NOT_EXIST
# - id: 131841 # DAOS_FAULT_CONT_OPEN_UUID
# - id: 131842 # DAOS_FAULT_CONT_INV_PAD
# - id: 131843 # DAOS_FAULT_CONT_INV_USED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Create pools directories... ok.
Start targets... ok.
Wait for targets to stop...
[0] pool {{UUID}} check result: ok.
[0] container {{UUID}} check resultok (1 warning(s)).
[0] container {{UUID}} check result: ok (1 warning(s)).
Wait for targets to stop: ok.
Stop the engine... ok.
===============================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand All @@ -23,7 +24,6 @@ Check container:
uuid: {{UUID}}
- uuid... ok.
- Padding (cd_pad)... warning: non-zero (0)
ok.
- Padding (cd_used)... ok.
- Reserved (cd_reserv_upgrade)... ok.
- Object index tree...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Create pools directories... ok.
Start targets... ok.
Wait for targets to stop...
[0] pool {{UUID}} check result: ok.
[0] container {{UUID}} check resultok (1 warning(s)).
[0] container {{UUID}} check result: ok (1 warning(s)).
Wait for targets to stop: ok.
Stop the engine... ok.
===============================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand All @@ -25,7 +26,6 @@ Check container:
- Padding (cd_pad)... ok.
- Padding (cd_used)... ok.
- Reserved (cd_reserv_upgrade)... warning: non-zero (0)
ok.
- Object index tree...
-- Tree class... ok.
-- Tree features... ok.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Create pools directories... ok.
Start targets... ok.
Wait for targets to stop...
[0] pool {{UUID}} check result: ok.
[0] container {{UUID}} check resultok (1 warning(s)).
[0] container {{UUID}} check result: ok (1 warning(s)).
Wait for targets to stop: ok.
Stop the engine... ok.
===============================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand All @@ -24,7 +25,6 @@ Check container:
- uuid... ok.
- Padding (cd_pad)... ok.
- Padding (cd_used)... warning: non-zero (0)
ok.
- Reserved (cd_reserv_upgrade)... ok.
- Object index tree...
-- Tree class... ok.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand All @@ -22,5 +23,4 @@ Check pool: ok.
Check container:
uuid: {{UUID}}
- uuid... error: mismatch ({{UUID}} != {{UUID}})

error: Check container: DER_ID_MISMATCH(-2035): 'ID mismatch'
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
- UUID... ok.
- Containers tree...
-- Tree class... ok.
-- Tree features... error: Unsupported features 0/0

- error: Containers tree: DER_PROTO(-1014): 'Incompatible protocol'
error: Check pool: DER_PROTO(-1014): 'Incompatible protocol'
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
- UUID... ok.
- Containers tree...
-- Tree class... error: Invalid class id: 14

- error: Containers tree: DER_INVAL(-1003): 'Invalid parameters'
error: Check pool: DER_INVAL(-1003): 'Invalid parameters'
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
- UUID... ok.
- Containers tree...
-- Tree class... error: Unregistered class id 14

- error: Containers tree: DER_NONEXIST(-1005): 'The specified entity does not exist'
error: Check pool: DER_NONEXIST(-1005): 'The specified entity does not exist'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand Down Expand Up @@ -42,6 +43,6 @@ Check container:
-- DTX blob (off=0x514650)...
--- Magic... ok.
--- 7 active entries:
---- [0] invalid flags (0x20)
---- error: [0] invalid flags (0x20)
- error: Active DTX blob list: DER_IO(-2001): 'I / O error'
error: Check container: DER_IO(-2001): 'I / O error'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand Down Expand Up @@ -59,6 +60,6 @@ Check container:
---- [6] ID (dae_xid)... ok.
---- [6] LID (dae_lid)... ok.
---- [6] Append to active DTX tree... ok.
--- DTX blob (off=0x514650)... expected 5 active entries, but found 5.
--- error: DTX blob (off=0x514650)... expected 5 active entries, but found 5.
- error: Active DTX blob list: DER_IO(-2001): 'I / O error'
error: Check container: DER_IO(-2001): 'I / O error'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VOS file allocation: ok.
Check pool:
path: {{STORAGE}}/{{UUID}}/vos-0
uuid: {{UUID}}
- NVMe devices (if applicable): ok.
- NVMe devices (if applicable)... ok.
- Open the pool: ok.
- Magic... ok.
- Version... ok.
Expand All @@ -12,7 +12,8 @@ Check pool:
-- Tree features... ok.
-- Node (off=0xa7a4c0)... ok.
- Containers tree: ok.
- Pool extension (off=0x400550)... ok.
- Pool extension (off=0x400550)...
- Pool extension (off=0x400550): ok.
- Garbage collector's tree...
-- Tree class... ok.
-- Tree features... ok.
Expand Down
Loading
Loading