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
16 changes: 14 additions & 2 deletions src/container/srv_container.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (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 @@ -1707,6 +1707,7 @@ cont_ec_agg_alloc(struct cont_svc *cont_svc, uuid_t cont_uuid,
for (i = 0; i < rank_nr; i++) {
ec_agg->ea_server_ephs[i].rank = doms[i].do_comp.co_rank;
ec_agg->ea_server_ephs[i].eph = 0;
ec_agg->ea_server_ephs[i].ee_update_ts = daos_gettime_coarse();
}
d_list_add(&ec_agg->ea_list, &cont_svc->cs_ec_agg_list);
*ec_aggp = ec_agg;
Expand Down Expand Up @@ -1764,8 +1765,10 @@ ds_cont_leader_update_agg_eph(uuid_t pool_uuid, uuid_t cont_uuid,

for (i = 0; i < ec_agg->ea_servers_num; i++) {
if (ec_agg->ea_server_ephs[i].rank == rank) {
if (ec_agg->ea_server_ephs[i].eph < eph)
if (ec_agg->ea_server_ephs[i].eph < eph) {
ec_agg->ea_server_ephs[i].eph = eph;
ec_agg->ea_server_ephs[i].ee_update_ts = daos_gettime_coarse();
}
break;
}
}
Expand Down Expand Up @@ -1989,6 +1992,7 @@ cont_agg_eph_sync(struct ds_pool *pool, struct cont_svc *svc)
daos_epoch_t cur_eph, new_eph;
daos_epoch_t min_eph;
d_rank_t rank;
uint64_t cur_ts;
int i;
int rc;

Expand All @@ -2015,6 +2019,7 @@ cont_agg_eph_sync(struct ds_pool *pool, struct cont_svc *svc)
}

min_eph = DAOS_EPOCH_MAX;
cur_ts = daos_gettime_coarse();
for (i = 0; i < ec_agg->ea_servers_num; i++) {
rank = ec_agg->ea_server_ephs[i].rank;

Expand All @@ -2024,6 +2029,13 @@ cont_agg_eph_sync(struct ds_pool *pool, struct cont_svc *svc)
continue;
}

if (pool->sp_reclaim != DAOS_RECLAIM_DISABLED &&
cur_ts > ec_agg->ea_server_ephs[i].ee_update_ts + 600)
D_WARN(DF_CONT ": Sluggish EC boundary report from rank %d, " DF_U64
" Seconds.",
DP_CONT(svc->cs_pool_uuid, ec_agg->ea_cont_uuid), rank,
cur_ts - ec_agg->ea_server_ephs[i].ee_update_ts);

if (ec_agg->ea_server_ephs[i].eph < min_eph)
min_eph = ec_agg->ea_server_ephs[i].eph;
}
Expand Down
3 changes: 2 additions & 1 deletion src/container/srv_internal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (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 @@ -61,6 +61,7 @@ extern bool ec_agg_disabled;
struct ec_eph {
d_rank_t rank;
daos_epoch_t eph;
uint64_t ee_update_ts; /* update timestamp */
};

/* container EC aggregation epoch control descriptor, which is only on leader */
Expand Down
20 changes: 17 additions & 3 deletions src/object/cli_obj.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (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 @@ -4122,8 +4122,10 @@ anchor_update_check_eof(struct obj_auxi_args *obj_auxi, daos_anchor_t *anchor)
obj_auxi_shards_iterate(obj_auxi, update_sub_anchor_cb, NULL);

sub_anchors = (struct shard_anchors *)anchor->da_sub_anchors;
if (!d_list_empty(&sub_anchors->sa_merged_list))
if (!d_list_empty(&sub_anchors->sa_merged_list)) {
D_ASSERT(obj_auxi->opc != DAOS_OBJ_RPC_ENUMERATE);
return;
}

if (sub_anchors_is_eof(sub_anchors)) {
daos_obj_list_t *obj_args;
Expand All @@ -4132,6 +4134,18 @@ anchor_update_check_eof(struct obj_auxi_args *obj_auxi, daos_anchor_t *anchor)

obj_args = dc_task_get_args(obj_auxi->obj_task);
sub_anchors_free(obj_args, obj_auxi->opc);
} else if (obj_auxi->opc == DAOS_OBJ_RPC_ENUMERATE && D_LOG_ENABLED(DB_REBUILD)) {
for (int i = 0; i < sub_anchors->sa_anchors_nr; i++) {
daos_anchor_t *sub_anchor;

sub_anchor = &sub_anchors->sa_anchors[i].ssa_anchor;
if (!daos_anchor_is_eof(sub_anchor)) {
D_DEBUG(DB_REBUILD, "shard %d sub_anchor %d/%d non EOF",
sub_anchors->sa_anchors[i].ssa_shard, i,
sub_anchors->sa_anchors_nr);
break;
}
}
}
}

Expand Down Expand Up @@ -6445,7 +6459,7 @@ shard_anchors_check_alloc_bufs(struct obj_auxi_args *obj_auxi, struct shard_anch
}

if (obj_args->recxs != NULL) {
if (sub_anchor->ssa_recxs != NULL && sub_anchors->sa_nr == nr)
if (sub_anchor->ssa_recxs != NULL && sub_anchors->sa_nr != nr)
D_FREE(sub_anchor->ssa_recxs);

if (sub_anchor->ssa_recxs == NULL) {
Expand Down
6 changes: 3 additions & 3 deletions src/object/obj_enum.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* (C) Copyright 2018-2022 Intel Corporation.
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -689,9 +690,8 @@ obj_enum_iterate(daos_key_desc_t *kdss, d_sg_list_t *sgl, int nr,
ptr = sgl_indexed_byte(sgl, &sgl_idx);
D_ASSERTF(ptr != NULL, "kds and sgl don't line up");

D_DEBUG(DB_REBUILD, "process %d, type %d, ptr %p, len "DF_U64
", total %zd\n", i, kds->kd_val_type, ptr,
kds->kd_key_len, sgl->sg_iovs[0].iov_len);
D_DEBUG(DB_REBUILD, "process %d/%d, type %d, ptr %p, len " DF_U64 ", total %zd\n",
i, nr, kds->kd_val_type, ptr, kds->kd_key_len, sgl->sg_iovs[0].iov_len);
if (kds->kd_val_type == 0 ||
(kds->kd_val_type != type && type != -1)) {
sgl_move_forward(sgl, &sgl_idx, kds->kd_key_len);
Expand Down
36 changes: 33 additions & 3 deletions src/object/srv_obj.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
* (C) Copyright 2025 Google LLC
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -2423,7 +2423,7 @@ obj_inflight_io_check(struct ds_cont_child *child, uint32_t opc,
uint32_t rpc_map_ver, uint32_t flags)
{
if (opc == DAOS_OBJ_RPC_ENUMERATE && flags & ORF_FOR_MIGRATION) {
/* EC aggregation is still inflight, rebuild should wait until it's paused */
/* EC aggregation is still in-flight, rebuild should wait until it's paused */
if (ds_cont_child_ec_aggregating(child)) {
D_ERROR(DF_CONT" ec aggregate still active, rebuilding %d\n",
DP_CONT(child->sc_pool->spc_uuid, child->sc_uuid),
Expand Down Expand Up @@ -3258,6 +3258,27 @@ obj_enum_complete(crt_rpc_t *rpc, int status, int map_version,
D_FREE(oeo->oeo_csum_iov.iov_buf);
}

static void
dump_enum_anchor(daos_unit_oid_t uoid, daos_anchor_t *anchor, char *str)
{
int nr = DAOS_ANCHOR_BUF_MAX / 8;
int i;
uint64_t data[nr];

D_DEBUG(DB_REBUILD, DF_UOID "%s anchor -", DP_UOID(uoid), str);
D_DEBUG(DB_REBUILD, "type %d, shard %d, flags 0x%x\n", anchor->da_type, anchor->da_shard,
anchor->da_flags);
for (i = 0; i < nr; i++)
data[i] = *(uint64_t *)((char *)anchor->da_buf + i * 8);
if (nr >= 13)
D_DEBUG(DB_REBUILD,
"da_buf " DF_X64 "," DF_X64 "," DF_X64 "," DF_X64 "," DF_X64 "," DF_X64
"," DF_X64 "," DF_X64 "," DF_X64 "," DF_X64 "," DF_X64 "," DF_X64
"," DF_X64,
data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7],
data[8], data[9], data[10], data[11], data[12]);
}

static int
obj_local_enum(struct obj_io_context *ioc, crt_rpc_t *rpc,
struct vos_iter_anchors *anchors, struct ds_obj_enum_arg *enum_arg,
Expand Down Expand Up @@ -3326,6 +3347,10 @@ obj_local_enum(struct obj_io_context *ioc, crt_rpc_t *rpc,
D_ASSERT(opc == DAOS_OBJ_RPC_ENUMERATE);
type = VOS_ITER_DKEY;
param.ip_flags |= VOS_IT_RECX_VISIBLE;
if (D_LOG_ENABLED(DB_REBUILD)) {
dump_enum_anchor(oei->oei_oid, &anchors->ia_dkey, "dkey");
dump_enum_anchor(oei->oei_oid, &anchors->ia_akey, "akey");
}
if (daos_anchor_get_flags(&anchors->ia_dkey) &
DIOF_WITH_SPEC_EPOCH) {
/* For obj verification case. */
Expand All @@ -3343,7 +3368,12 @@ obj_local_enum(struct obj_io_context *ioc, crt_rpc_t *rpc,
enum_arg->chk_key2big = 1;
enum_arg->need_punch = 1;
enum_arg->copy_data_cb = vos_iter_copy;
fill_oid(oei->oei_oid, enum_arg);
rc = fill_oid(oei->oei_oid, enum_arg);
if (rc != 0) {
rc = -DER_KEY2BIG;
DL_ERROR(rc, DF_UOID "fill oid failed", DP_UOID(oei->oei_oid));
goto failed;
}
}

/*
Expand Down
37 changes: 28 additions & 9 deletions src/object/srv_obj_migrate.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2019-2024 Intel Corporation.
* (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 @@ -2651,9 +2651,15 @@ migrate_enum_unpack_cb(struct dc_obj_enum_unpack_io *io, void *data)
if (rc == 1 &&
(is_ec_data_shard_by_tgt_off(unpack_tgt_off, &arg->oc_attr) ||
(io->ui_oid.id_layout_ver > 0 && io->ui_oid.id_shard != parity_shard))) {
D_DEBUG(DB_REBUILD, DF_UOID" ignore shard "DF_KEY"/%u/%d/%u/%d.\n",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey), shard,
(int)obj_ec_shard_off(obj, io->ui_dkey_hash, 0), parity_shard, rc);
if (daos_is_dkey_uint64(io->ui_oid.id_pub) && io->ui_dkey.iov_len == 8)
D_DEBUG(DB_REBUILD,
DF_UOID " ignore shard, int dkey " DF_U64 "/%u/%d/%u/%d.",
DP_UOID(io->ui_oid), *(uint64_t *)io->ui_dkey.iov_buf, shard,
(int)obj_ec_shard_off(obj, io->ui_dkey_hash, 0), parity_shard, rc);
else
D_DEBUG(DB_REBUILD, DF_UOID " ignore shard " DF_KEY "/%u/%d/%u/%d.",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey), shard,
(int)obj_ec_shard_off(obj, io->ui_dkey_hash, 0), parity_shard, rc);
D_GOTO(put, rc = 0);
}
rc = 0;
Expand All @@ -2669,9 +2675,17 @@ migrate_enum_unpack_cb(struct dc_obj_enum_unpack_io *io, void *data)
continue;
}

D_DEBUG(DB_REBUILD, DF_UOID" unpack "DF_KEY" for shard %u/%u/%u/"DF_X64"/%u\n",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey), shard, unpack_tgt_off,
migrate_tgt_off, io->ui_dkey_hash, parity_shard);
if (daos_is_dkey_uint64(io->ui_oid.id_pub) && io->ui_dkey.iov_len == 8)
D_DEBUG(DB_REBUILD,
DF_UOID " unpack int dkey " DF_U64 " for shard %u/%u/%u/" DF_X64
"/%u",
DP_UOID(io->ui_oid), *(uint64_t *)io->ui_dkey.iov_buf, shard,
unpack_tgt_off, migrate_tgt_off, io->ui_dkey_hash, parity_shard);
else
D_DEBUG(DB_REBUILD,
DF_UOID " unpack " DF_KEY " for shard %u/%u/%u/" DF_X64 "/%u",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey), shard, unpack_tgt_off,
migrate_tgt_off, io->ui_dkey_hash, parity_shard);

/**
* Since we do not need split the rebuild into parity rebuild
Expand Down Expand Up @@ -2708,8 +2722,13 @@ 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));
if (daos_is_dkey_uint64(io->ui_oid.id_pub) && io->ui_dkey.iov_len == 8)
D_DEBUG(DB_REBUILD,
DF_UOID "/int dkey: " DF_U64 " does not need rebuild.\n",
DP_UOID(io->ui_oid), *(uint64_t *)io->ui_dkey.iov_buf);
else
D_DEBUG(DB_REBUILD, DF_UOID "/" DF_KEY " does not need rebuild.\n",
DP_UOID(io->ui_oid), DP_KEY(&io->ui_dkey));

/* Create the vos container when no record need to be rebuilt for this shard,
* for the case of reintegrate the container was discarded ahead.
Expand Down
22 changes: 20 additions & 2 deletions src/pool/srv_pool.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.
* (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 @@ -2257,6 +2257,11 @@ static int pool_svc_schedule_reconf(struct pool_svc *svc, struct pool_map *map,
uint32_t map_version_for, bool sync_remove);
static void pool_svc_rfcheck_ult(void *arg);

#define RESTART_RB_DELAY_ENV "D_RESTART_RB_DELAY"
#define RESTART_RB_DELAY_MIN (60)
#define RESTART_RB_DELAY_DEF (100)
#define RESTART_RB_DELAY_MAX (600)

static int
pool_svc_step_up_cb(struct ds_rsvc *rsvc)
{
Expand All @@ -2268,6 +2273,8 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
daos_prop_t *prop = NULL;
bool cont_svc_up = false;
bool events_initialized = false;
uint64_t age_sec, delay;
uint32_t restart_rb_delay = RESTART_RB_DELAY_DEF;
d_rank_t rank = dss_self_rank();
int rc;

Expand Down Expand Up @@ -2367,7 +2374,18 @@ pool_svc_step_up_cb(struct ds_rsvc *rsvc)
if (rc != 0)
goto out;

rc = ds_rebuild_regenerate_task(svc->ps_pool, prop, 0);
rc = d_getenv_uint(RESTART_RB_DELAY_ENV, &restart_rb_delay);
if (rc == 0) {
if (restart_rb_delay < RESTART_RB_DELAY_MIN)
restart_rb_delay = RESTART_RB_DELAY_MIN;
if (restart_rb_delay > RESTART_RB_DELAY_MAX)
restart_rb_delay = RESTART_RB_DELAY_MAX;
}
age_sec = d_hlc_age2sec(dss_get_start_epoch());
delay = age_sec < restart_rb_delay ? (restart_rb_delay - age_sec) : 0;
D_INFO("delay %d, " DF_U64 " seconds for ds_rebuild_regenerate_task\n", restart_rb_delay,
delay);
rc = ds_rebuild_regenerate_task(svc->ps_pool, prop, delay);
if (rc != 0)
goto out;

Expand Down
3 changes: 2 additions & 1 deletion src/rebuild/rebuild_internal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* (C) Copyright 2017-2024 Intel Corporation.
* (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 @@ -247,6 +247,7 @@ struct rebuild_pool_tls {
d_list_t rebuild_pool_list;
uint64_t rebuild_pool_obj_count;
uint64_t rebuild_pool_reclaim_obj_count;
uint64_t rebuild_pool_reclaim_skipped;
unsigned int rebuild_pool_ver;
uint32_t rebuild_pool_gen;
uint64_t rebuild_pool_leader_term;
Expand Down
Loading
Loading