Skip to content

Commit

Permalink
DAOS-16035 rebuild: create VOS cont when no record need to be rebuilt… (
Browse files Browse the repository at this point in the history
#14841)

For EC object rebuild, some ext not exist on some shards, for this case
create VOS container when no record need to be rebuilt. To avoid
following IO cannot find container and fail at obj_ioc_init() ->
cont_child_lookup().
Another case is in cont_snap_update_one() create the vos cont if
non-exist.

Possibly yield in vos_cont_create() -> bio_wal_commit() -> wait_tx_committed(),
so tasklet cannot work.

Signed-off-by: Xuezhao Liu <[email protected]>
  • Loading branch information
liuxuezhao authored Aug 12, 2024
1 parent 23daf02 commit 19e880c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1989,9 +1989,14 @@ cont_snap_update_one(void *vin)
struct ds_cont_child *cont;
int rc;

rc = ds_cont_child_lookup(args->pool_uuid, args->cont_uuid, &cont);
/* The container should be exist on the system at this point, if non-exist on this target
* it should be the case of reintegrate the container was destroyed ahead, so just
* open_create the container here.
*/
rc = ds_cont_child_open_create(args->pool_uuid, args->cont_uuid, &cont);
if (rc != 0)
return rc;

if (args->snap_count == 0) {
if (cont->sc_snapshots != NULL) {
D_ASSERT(cont->sc_snapshots_nr > 0);
Expand Down Expand Up @@ -2045,9 +2050,9 @@ ds_cont_tgt_snapshots_update(uuid_t pool_uuid, uuid_t cont_uuid,
* the up targets in this scenario. The target property will be updated
* upon initiating container aggregation.
*/
return ds_pool_task_collective(pool_uuid, PO_COMP_ST_NEW | PO_COMP_ST_DOWN |
PO_COMP_ST_DOWNOUT | PO_COMP_ST_UP,
cont_snap_update_one, &args, 0);
return ds_pool_thread_collective(pool_uuid, PO_COMP_ST_NEW | PO_COMP_ST_DOWN |
PO_COMP_ST_DOWNOUT | PO_COMP_ST_UP,
cont_snap_update_one, &args, 0);
}

void
Expand Down
11 changes: 10 additions & 1 deletion src/object/srv_obj_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2718,9 +2718,18 @@ migrate_enum_unpack_cb(struct dc_obj_enum_unpack_io *io, void *data)
}

if (!create_migrate_one) {
struct ds_cont_child *cont = NULL;

D_DEBUG(DB_REBUILD, DF_UOID"/"DF_KEY" does not need rebuild.\n",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey));
D_GOTO(put, rc = 0);

/* Create the vos container when no record need to be rebuilt for this shard,
* for the case of reintegrate the container was discarded ahead.
*/
rc = migrate_get_cont_child(tls, arg->arg->cont_uuid, &cont, true);
if (cont != NULL)
ds_cont_child_put(cont);
D_GOTO(put, rc);
}

/* Check if some IODs from this unpack can be merged to the exist mrone, mostly for EC
Expand Down
2 changes: 1 addition & 1 deletion src/rebuild/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ rebuild_object_insert(struct rebuild_tgt_pool_tracker *rpt, uuid_t co_uuid,
}

#define LOCAL_ARRAY_SIZE 128
#define NUM_SHARDS_STEP_INCREASE 10
#define NUM_SHARDS_STEP_INCREASE 64
/* The structure for scan per xstream */
struct rebuild_scan_arg {
struct rebuild_tgt_pool_tracker *rpt;
Expand Down

0 comments on commit 19e880c

Please sign in to comment.