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
3 changes: 1 addition & 2 deletions src/utils/ddb/ddb_printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ ddb_print_ilog_entry(struct ddb_ctx *ctx, struct ddb_ilog_entry *entry)
void
ddb_print_dtx_committed(struct ddb_ctx *ctx, struct dv_dtx_committed_entry *entry)
{
ddb_printf(ctx, "ID: "DF_DTIF"\n", DP_DTI(&entry->ddtx_id));
ddb_printf(ctx, "\tEpoch: "DF_U64"\n", entry->ddtx_epoch);
ddb_printf(ctx, "ID: " DF_DTIF "\n", DP_DTI(&entry->ddtx_id));
}

void
Expand Down
12 changes: 4 additions & 8 deletions src/utils/ddb/ddb_vos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,15 +1512,11 @@ struct active_dtx_cb_arg {
static int
committed_dtx_cb(daos_handle_t ih, d_iov_t *key, d_iov_t *val, void *cb_arg)
{
struct committed_dtx_cb_arg *arg = cb_arg;
struct dv_dtx_committed_entry entry;
struct vos_dtx_cmt_ent *ent = val->iov_buf;
int rc;

entry.ddtx_id = ent->dce_base.dce_xid;
entry.ddtx_cmt_time = ent->dce_base.dce_cmt_time;
entry.ddtx_epoch = ent->dce_base.dce_epoch;
struct committed_dtx_cb_arg *arg = cb_arg;
struct dv_dtx_committed_entry entry;
int rc;

memcpy(&entry.ddtx_id, key->iov_buf, sizeof(struct dtx_id));
rc = arg->handler(&entry, arg->handler_arg);

return rc;
Expand Down
4 changes: 1 addition & 3 deletions src/utils/ddb/ddb_vos.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ int dv_process_key_ilog_entries(daos_handle_t coh, daos_unit_oid_t oid, daos_key
daos_key_t *akey, enum ddb_ilog_op op);

struct dv_dtx_committed_entry {
struct dtx_id ddtx_id;
daos_epoch_t ddtx_cmt_time;
daos_epoch_t ddtx_epoch;
struct dtx_id ddtx_id;
};

struct dv_dtx_active_entry {
Expand Down
4 changes: 1 addition & 3 deletions src/utils/ddb/tests/ddb_commands_print_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,12 @@ static void
print_dtx_committed_test(void **state)
{
struct dv_dtx_committed_entry entry = {
.ddtx_epoch = 1234,
.ddtx_id = {.dti_uuid = {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc}, .dti_hlc = 0x1234},
.ddtx_id = {.dti_uuid = {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc}, .dti_hlc = 0x1234},
};

ddb_print_dtx_committed(&g_ctx, &entry);

assert_printed_contains("ID: 12345678-9abc-0000-0000-000000000000.1234\n");
assert_printed_contains("Epoch: 1234\n");
}

static void
Expand Down
24 changes: 12 additions & 12 deletions src/vos/vos_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ vos_tx_end(struct vos_container *cont, struct dtx_handle *dth_in,
struct umem_rsrvd_act **rsrvd_scmp, d_list_t *nvme_exts,
bool started, struct bio_desc *biod, int err)
{
struct vos_pool *pool;
struct umem_instance *umm;
struct dtx_handle *dth = dth_in;
struct vos_dtx_act_ent *dae;
struct vos_dtx_act_ent_df *dae_df;
struct dtx_rsrvd_uint *dru;
struct vos_dtx_cmt_ent *dce = NULL;
struct dtx_handle tmp = {0};
int rc = 0;
struct vos_pool *pool;
struct umem_instance *umm;
struct dtx_handle *dth = dth_in;
struct vos_dtx_act_ent *dae;
struct vos_dtx_act_ent_df *dae_df;
struct dtx_rsrvd_uint *dru;
struct dtx_handle tmp = {0};
int rc = 0;
bool cmt = false;

if (!dtx_is_valid_handle(dth)) {
/** Created a dummy dth handle for publishing extents */
Expand Down Expand Up @@ -350,7 +350,7 @@ vos_tx_end(struct vos_container *cont, struct dtx_handle *dth_in,
dth->dth_local_tx_started = 0;

if (dtx_is_valid_handle(dth_in) && err == 0 && !dth->dth_local)
err = vos_dtx_prepared(dth, &dce);
err = vos_dtx_prepared(dth, &cmt);

if (err == 0)
err = vos_tx_publish(dth, true);
Expand Down Expand Up @@ -395,9 +395,9 @@ vos_tx_end(struct vos_container *cont, struct dtx_handle *dth_in,
cont->vc_solo_dtx_epoch < dth->dth_epoch)
cont->vc_solo_dtx_epoch = dth->dth_epoch;

vos_dtx_post_handle(cont, &dae, &dce, 1, false, err != 0, false);
vos_dtx_post_handle(cont, &dae, &cmt, 1, false, err != 0, false);
} else {
D_ASSERT(dce == NULL);
D_ASSERT(!cmt);
if (err == 0 && dth->dth_active) {
D_ASSERTF(!UMOFF_IS_NULL(dae->dae_df_off),
"Non-prepared DTX " DF_DTI "\n",
Expand Down
Loading
Loading