Skip to content

Commit dca406d

Browse files
authored
DAOS-19059 vos: cache vos object after DTX commit - b26 (#18418)
It is unnecessary to evict the vos object from cache after related DTX committed; otherwise, other concurrent modification against the same object shard maybe required to retry. Signed-off-by: Fan Yong <fan.yong@hpe.com>
1 parent c3c4f25 commit dca406d

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/vos/vos_dtx.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* (C) Copyright 2019-2024 Intel Corporation.
3-
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
43
* (C) Copyright 2025 Google LLC
4+
* (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
55
*
66
* SPDX-License-Identifier: BSD-2-Clause-Patent
77
*/
@@ -2354,6 +2354,8 @@ vos_dtx_post_handle(struct vos_container *cont,
23542354
}
23552355

23562356
for (i = 0; i < count; i++) {
2357+
struct vos_dtx_act_ent *dae = NULL;
2358+
23572359
if (daes[i] == NULL)
23582360
continue;
23592361

@@ -2370,9 +2372,18 @@ vos_dtx_post_handle(struct vos_container *cont,
23702372
}
23712373

23722374
d_iov_set(&kiov, &DAE_XID(daes[i]), sizeof(DAE_XID(daes[i])));
2373-
rc = dbtree_delete(cont->vc_dtx_active_hdl, BTR_PROBE_EQ,
2374-
&kiov, NULL);
2375+
/*
2376+
* For abort case, set @args as NULL, then related vos object will be evicted from
2377+
* cache via dbtree_delete().
2378+
*/
2379+
rc = dbtree_delete(cont->vc_dtx_active_hdl, BTR_PROBE_EQ, &kiov,
2380+
abort ? NULL : &dae);
23752381
if (rc == 0 || rc == -DER_NONEXIST) {
2382+
if (dae != NULL) {
2383+
D_ASSERT(dae == daes[i]);
2384+
dtx_act_ent_cleanup(cont, dae, NULL, false, false);
2385+
}
2386+
23762387
dtx_evict_lid(cont, daes[i]);
23772388
} else {
23782389
/* The DTX entry has been committed or aborted, but we

0 commit comments

Comments
 (0)