Skip to content

Commit

Permalink
DAOS-15968 container: Fix CAPA fetch on NS master
Browse files Browse the repository at this point in the history
Apparently, when an I/O request fetches a container handle on the engine
who is the PS leader, if the ds_cont_hdl object is absent (because the
engine has restarted), then the cont_iv code won't create a ds_cont_hdl
object, even though the handle is found in the RDB. This patch adds a
ds_cont_tgt_open call to cont_iv_ent_fetch, so that the flow is similar
to cont_iv_ent_update.

Signed-off-by: Li Wei <wei.g.li@intel.com>
Required-githooks: true
  • Loading branch information
liw committed Jun 5, 2024
1 parent 9bcb9aa commit f5a56ea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/container/container_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,15 @@ cont_iv_ent_fetch(struct ds_iv_entry *entry, struct ds_iv_key *key,
}
prop_entry = daos_prop_entry_get(prop, DAOS_PROP_CO_STATUS);
D_ASSERT(prop_entry != NULL);

daos_prop_val_2_co_status(prop_entry->dpe_val, &stat);

rc = ds_cont_tgt_open(entry->ns->iv_pool_uuid,
civ_key->cont_uuid, chdl.ch_cont,
chdl.ch_flags, chdl.ch_sec_capas,
stat.dcs_pm_ver);
if (rc != 0)
D_GOTO(out, rc);

iv_entry.iv_capa.status_pm_ver = stat.dcs_pm_ver;
daos_prop_free(prop);
/* Only happens on xstream 0 */
Expand All @@ -524,6 +531,11 @@ cont_iv_ent_fetch(struct ds_iv_entry *entry, struct ds_iv_key *key,
rc = dbtree_update(root_hdl, &key_iov, &val_iov);
if (rc == 0)
goto again;
/*
* It seems that not rolling back the ds_cont_tgt_open call
* above is harmless. Also, an error from the dbtree_update
* call should be rare.
*/
} else {
rc = -DER_NONEXIST;
}
Expand Down

0 comments on commit f5a56ea

Please sign in to comment.