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-16876 vos: skip DTX record when load partial committed DTX #15883

Merged
merged 1 commit into from
Feb 11, 2025
Merged
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
8 changes: 8 additions & 0 deletions src/vos/vos_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,14 @@ vos_mod_init(void)
d_getenv_bool("DAOS_DKEY_PUNCH_PROPAGATE", &vos_dkey_punch_propagate);
D_INFO("DKEY punch propagation is %s\n", vos_dkey_punch_propagate ? "enabled" : "disabled");

/*
* NOTE: It is used to skip old partial committed DTX records that were generated when
* ran as DAOS-2.6.3-rc{1,2}. If the user has never used such version, please do
* NOT set this environment variable.
*/
d_getenv_bool("DAOS_SKIP_OLD_PARTIAL_DTX", &vos_skip_old_partial_dtx);
D_INFO("%s old partial committed DTX record\n", vos_skip_old_partial_dtx ? "Skip" : "Keep");

vos_agg_gap = VOS_AGG_GAP_DEF;
d_getenv_uint("DAOS_VOS_AGG_GAP", &vos_agg_gap);
if (vos_agg_gap < VOS_AGG_GAP_MIN || vos_agg_gap > VOS_AGG_GAP_MAX) {
Expand Down
7 changes: 6 additions & 1 deletion src/vos/vos_dtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
DAE_EPOCH(dae)); \
} while (0)

bool vos_skip_old_partial_dtx;

static inline uint32_t
dtx_umoff_flag2type(umem_off_t umoff)
{
Expand Down Expand Up @@ -706,7 +708,7 @@ dtx_rec_release(struct vos_container *cont, struct vos_dtx_act_ent *dae, bool ab
* If it is required to keep the active DTX entry, then it must be for partial
* commit. Let's mark it as DTE_PARTIAL_COMMITTED.
*/
if ((DAE_FLAGS(dae) & DTE_PARTIAL_COMMITTED))
if (DAE_FLAGS(dae) & DTE_PARTIAL_COMMITTED)
return 0;

rc = umem_tx_add_ptr(umm, &dae_df->dae_flags, sizeof(dae_df->dae_flags));
Expand Down Expand Up @@ -3235,6 +3237,9 @@ vos_dtx_act_reindex(struct vos_container *cont)
dae->dae_need_release = 1;
D_INIT_LIST_HEAD(&dae->dae_link);

if (vos_skip_old_partial_dtx && DAE_FLAGS(dae) & DTE_PARTIAL_COMMITTED)
DAE_REC_CNT(dae) = 0;

if (DAE_REC_CNT(dae) > DTX_INLINE_REC_CNT) {
size_t size;
int count;
Expand Down
1 change: 1 addition & 0 deletions src/vos/vos_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ extern uint32_t vos_agg_gap;

extern unsigned int vos_agg_nvme_thresh;
extern bool vos_dkey_punch_propagate;
extern bool vos_skip_old_partial_dtx;

static inline uint32_t vos_byte2blkcnt(uint64_t bytes)
{
Expand Down