Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-15431 vos: clear DTX in CoS cache for the one committed by other - b24 #14324

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 7 additions & 4 deletions src/dtx/dtx_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@ dtx_end(struct dtx_handle *dth, struct ds_cont_child *cont, int result)
static void
dtx_flush_on_close(struct dss_module_info *dmi, struct dtx_batched_cont_args *dbca)
{
struct dss_xstream *dx = dss_current_xstream();
struct ds_cont_child *cont = dbca->dbca_cont;
struct dtx_stat stat = { 0 };
uint64_t total = 0;
Expand All @@ -1564,7 +1565,8 @@ dtx_flush_on_close(struct dss_module_info *dmi, struct dtx_batched_cont_args *db
dtx_stat(cont, &stat);

/* dbca->dbca_reg_gen != cont->sc_dtx_batched_gen means someone reopen the container. */
while (dbca->dbca_reg_gen == cont->sc_dtx_batched_gen && rc >= 0) {
while (!dss_xstream_exiting(dx) &&
dbca->dbca_reg_gen == cont->sc_dtx_batched_gen && rc >= 0) {
struct dtx_entry **dtes = NULL;
struct dtx_cos_key *dcks = NULL;

Expand Down Expand Up @@ -2197,10 +2199,11 @@ int
dtx_obj_sync(struct ds_cont_child *cont, daos_unit_oid_t *oid,
daos_epoch_t epoch)
{
int cnt;
int rc = 0;
struct dss_xstream *dx = dss_current_xstream();
int cnt;
int rc = 0;

while (dtx_cont_opened(cont)) {
while (!dss_xstream_exiting(dx) && (dtx_cont_opened(cont) || oid == NULL)) {
struct dtx_entry **dtes = NULL;
struct dtx_cos_key *dcks = NULL;

Expand Down
3 changes: 2 additions & 1 deletion src/vos/vos_dtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,8 @@ vos_dtx_commit_one(struct vos_container *cont, struct dtx_id *dti, daos_epoch_t
if (rc != 0)
D_FREE(dce);

if (rm_cos != NULL && (rc == 0 || rc == -DER_NONEXIST))
if (rm_cos != NULL &&
(rc == 0 || rc == -DER_NONEXIST || (rc == -DER_ALREADY && dae == NULL)))
*rm_cos = true;

return rc;
Expand Down
Loading