Skip to content

ZTS: fix removal_condense_export test case #11869

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

Merged
merged 1 commit into from
Apr 12, 2021
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
13 changes: 13 additions & 0 deletions man/man5/zfs-module-parameters.5
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,19 @@ to throttle vdev removal speed.
Default value: \fB0\fR (no throttle).
.RE

.sp
.ne 2
.na
\fBzfs_condense_indirect_obsolete_pct\fR (int)
.ad
.RS 12n
Minimum percent of obsolete bytes in vdev mapping required to attempt to
condense (see \fBzfs_condense_indirect_vdevs_enable\fR). Intended for use
with the test suite to facilitate triggering condensing as needed.
.sp
Default value: \fB25\fR%.
.RE

.sp
.ne 2
.na
Expand Down
7 changes: 5 additions & 2 deletions module/zfs/vdev_indirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int zfs_condense_indirect_vdevs_enable = B_TRUE;
* condenses. Higher values will condense less often (causing less
* i/o); lower values will reduce the mapping size more quickly.
*/
int zfs_indirect_condense_obsolete_pct = 25;
int zfs_condense_indirect_obsolete_pct = 25;

/*
* Condense if the obsolete space map takes up more than this amount of
Expand Down Expand Up @@ -445,7 +445,7 @@ vdev_indirect_should_condense(vdev_t *vd)
* by the mapping.
*/
if (bytes_obsolete * 100 / bytes_mapped >=
zfs_indirect_condense_obsolete_pct &&
zfs_condense_indirect_obsolete_pct &&
mapping_size > zfs_condense_min_mapping_bytes) {
zfs_dbgmsg("should condense vdev %llu because obsolete "
"spacemap covers %d%% of %lluMB mapping",
Expand Down Expand Up @@ -1892,6 +1892,9 @@ EXPORT_SYMBOL(vdev_obsolete_sm_object);
ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, indirect_vdevs_enable, INT, ZMOD_RW,
"Whether to attempt condensing indirect vdev mappings");

ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, indirect_obsolete_pct, INT, ZMOD_RW,
"Minimum obsolete percent of bytes in the mapping to attempt condensing");

ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, min_mapping_bytes, ULONG, ZMOD_RW,
"Don't bother condensing if the mapping uses less than this amount of "
"memory");
Expand Down
1 change: 0 additions & 1 deletion tests/test-runner/bin/zts-report.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ if sys.platform.startswith('freebsd'):
'delegate/zfs_allow_003_pos': ['FAIL', known_reason],
'inheritance/inherit_001_pos': ['FAIL', '11829'],
'pool_checkpoint/checkpoint_zhack_feat': ['FAIL', '11854'],
'removal/removal_condense_export': ['FAIL', known_reason],
'resilver/resilver_restart_001': ['FAIL', known_reason],
'zvol/zvol_misc/zvol_misc_volmode': ['FAIL', known_reason],
})
Expand Down
1 change: 1 addition & 0 deletions tests/zfs-tests/include/tunables.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CHECKSUM_EVENTS_PER_SECOND checksum_events_per_second zfs_checksum_events_per_se
COMMIT_TIMEOUT_PCT commit_timeout_pct zfs_commit_timeout_pct
COMPRESSED_ARC_ENABLED compressed_arc_enabled zfs_compressed_arc_enabled
CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS condense.indirect_commit_entry_delay_ms zfs_condense_indirect_commit_entry_delay_ms
CONDENSE_INDIRECT_OBSOLETE_PCT condense.indirect_obsolete_pct zfs_condense_indirect_obsolete_pct
CONDENSE_MIN_MAPPING_BYTES condense.min_mapping_bytes zfs_condense_min_mapping_bytes
DBUF_CACHE_MAX_BYTES dbuf_cache.max_bytes dbuf_cache_max_bytes
DEADMAN_CHECKTIME_MS deadman.checktime_ms zfs_deadman_checktime_ms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
function reset
{
log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 0
log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 25
log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 131072
default_cleanup_noexit
}

default_setup_noexit "$DISKS" "true"
log_onexit reset
log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 5000
log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 5
log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 1

log_must zfs set recordsize=512 $TESTPOOL/$TESTFS
Expand Down