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
27 changes: 24 additions & 3 deletions src/container/srv_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,9 @@ ds_cont_leader_update_track_eph(uuid_t pool_uuid, uuid_t cont_uuid, d_rank_t ran
daos_epoch_t ec_agg_eph, daos_epoch_t stable_eph)
{
struct cont_svc *svc;
struct rdb_tx tx;
struct cont_track_eph_leader *eph_ldr;
struct cont *cont = NULL;
int rc;
bool retried = false;
int i;
Expand All @@ -1869,9 +1871,28 @@ ds_cont_leader_update_track_eph(uuid_t pool_uuid, uuid_t cont_uuid, d_rank_t ran
retry:
eph_ldr = cont_track_eph_leader_lookup(svc, cont_uuid);
if (eph_ldr == NULL) {
rc = cont_track_eph_leader_alloc(svc, cont_uuid, &eph_ldr);
if (rc)
/* check container's existence before creating cont_track_eph_leader */
rc = rdb_tx_begin(svc->cs_rsvc->s_db, svc->cs_rsvc->s_term, &tx);
if (rc != 0)
D_GOTO(out_put, rc);

ABT_rwlock_rdlock(svc->cs_lock);
rc = cont_lookup(&tx, svc, cont_uuid, &cont);
ABT_rwlock_unlock(svc->cs_lock);
Comment thread
liuxuezhao marked this conversation as resolved.
rdb_tx_end(&tx);
if (rc != 0) {
DL_CDEBUG(rc == -DER_NONEXIST, DB_MD, DLOG_ERR, rc,
DF_CONT " cont_lookup failed", DP_CONT(pool_uuid, cont_uuid));
D_GOTO(out_put, rc);
}
cont_put(cont);

eph_ldr = cont_track_eph_leader_lookup(svc, cont_uuid);
if (eph_ldr == NULL) {
rc = cont_track_eph_leader_alloc(svc, cont_uuid, &eph_ldr);
if (rc)
D_GOTO(out_put, rc);
}
}

for (i = 0; i < eph_ldr->cte_servers_num; i++) {
Expand Down Expand Up @@ -1908,7 +1929,7 @@ ds_cont_leader_update_track_eph(uuid_t pool_uuid, uuid_t cont_uuid, d_rank_t ran

out_put:
cont_svc_put_leader(svc);
return 0;
return rc;
}

#define EPH_ARG_TGT_INLINE (64)
Expand Down
3 changes: 2 additions & 1 deletion src/container/srv_epoch.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ ds_cont_get_snapshots(uuid_t pool_uuid, uuid_t cont_uuid,
D_ASSERT(dss_get_module_info()->dmi_xs_id == 0);
rc = cont_svc_lookup_leader(pool_uuid, 0, &svc, NULL);
if (rc != 0) {
DL_ERROR(rc, "pool " DF_UUID " cont_svc_lookup_leader failed", DP_UUID(pool_uuid));
DL_CDEBUG(rc == -DER_NOTLEADER, DB_MD, DLOG_ERR, rc,
"pool " DF_UUID " cont_svc_lookup_leader failed", DP_UUID(pool_uuid));
return rc;
}

Expand Down
5 changes: 3 additions & 2 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -2875,9 +2875,10 @@ ds_cont_eph_report(struct ds_pool *pool)
ec_eph->cte_last_ec_agg_epoch = min_ec_agg_eph;
ec_eph->cte_last_stable_epoch = min_stable_eph;
} else {
DL_ERROR(ret, DF_CONT ": Failed to update EC agg report IV.",
DP_CONT(pool->sp_uuid, ec_eph->cte_cont_uuid));
rc = ret;
DL_CDEBUG(rc == -DER_CONT_NONEXIST || rc == -DER_NONEXIST, DB_MD, DLOG_ERR,
rc, DF_CONT ": Failed to update EC agg report IV.",
DP_CONT(pool->sp_uuid, ec_eph->cte_cont_uuid));
}
}
D_FREE(failed_tgts);
Expand Down
6 changes: 4 additions & 2 deletions src/pool/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,10 @@ eph_report_ult(void *data)
/* Report EC agg epoch boundary */
rc = ds_cont_eph_report(pool);
if (rc) {
DL_ERROR(rc, "Failed to report EC agg epoch.");
sleep_intvl = EPH_REPORT_RETRY_INTVL;
DL_CDEBUG(rc == -DER_CONT_NONEXIST || rc == -DER_NONEXIST, DB_MD, DLOG_ERR,
rc, "Failed to report EC agg epoch.");
if (rc != -DER_CONT_NONEXIST && rc != -DER_NONEXIST)
sleep_intvl = EPH_REPORT_RETRY_INTVL;
}

if (eph_report_exiting(pool))
Expand Down
Loading