Skip to content

Commit 97708eb

Browse files
behlendorfmcmilk
authored andcommitted
ZTS: fix removal_condense_export test case
It's been observed in the CI that the required 25% of obsolete bytes in the mapping can be to high a threshold for this test resulting in condensing never being triggered and a test failure. To prevent these failures make the existing zfs_condense_indirect_obsolete_pct tuning available so the obsolete percentage can be reduced from 25% to 5% during this test. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#11869
1 parent b168ac2 commit 97708eb

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

man/man5/zfs-module-parameters.5

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,19 @@ to throttle vdev removal speed.
14451445
Default value: \fB0\fR (no throttle).
14461446
.RE
14471447

1448+
.sp
1449+
.ne 2
1450+
.na
1451+
\fBzfs_condense_indirect_obsolete_pct\fR (int)
1452+
.ad
1453+
.RS 12n
1454+
Minimum percent of obsolete bytes in vdev mapping required to attempt to
1455+
condense (see \fBzfs_condense_indirect_vdevs_enable\fR). Intended for use
1456+
with the test suite to facilitate triggering condensing as needed.
1457+
.sp
1458+
Default value: \fB25\fR%.
1459+
.RE
1460+
14481461
.sp
14491462
.ne 2
14501463
.na

module/zfs/vdev_indirect.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int zfs_condense_indirect_vdevs_enable = B_TRUE;
181181
* condenses. Higher values will condense less often (causing less
182182
* i/o); lower values will reduce the mapping size more quickly.
183183
*/
184-
int zfs_indirect_condense_obsolete_pct = 25;
184+
int zfs_condense_indirect_obsolete_pct = 25;
185185

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

1895+
ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, indirect_obsolete_pct, INT, ZMOD_RW,
1896+
"Minimum obsolete percent of bytes in the mapping to attempt condensing");
1897+
18951898
ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, min_mapping_bytes, ULONG, ZMOD_RW,
18961899
"Don't bother condensing if the mapping uses less than this amount of "
18971900
"memory");

tests/test-runner/bin/zts-report.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ if sys.platform.startswith('freebsd'):
263263
'delegate/zfs_allow_003_pos': ['FAIL', known_reason],
264264
'inheritance/inherit_001_pos': ['FAIL', '11829'],
265265
'pool_checkpoint/checkpoint_zhack_feat': ['FAIL', '11854'],
266-
'removal/removal_condense_export': ['FAIL', known_reason],
267266
'resilver/resilver_restart_001': ['FAIL', known_reason],
268267
'zvol/zvol_misc/zvol_misc_volmode': ['FAIL', known_reason],
269268
})

tests/zfs-tests/include/tunables.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CHECKSUM_EVENTS_PER_SECOND checksum_events_per_second zfs_checksum_events_per_se
2525
COMMIT_TIMEOUT_PCT commit_timeout_pct zfs_commit_timeout_pct
2626
COMPRESSED_ARC_ENABLED compressed_arc_enabled zfs_compressed_arc_enabled
2727
CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS condense.indirect_commit_entry_delay_ms zfs_condense_indirect_commit_entry_delay_ms
28+
CONDENSE_INDIRECT_OBSOLETE_PCT condense.indirect_obsolete_pct zfs_condense_indirect_obsolete_pct
2829
CONDENSE_MIN_MAPPING_BYTES condense.min_mapping_bytes zfs_condense_min_mapping_bytes
2930
DBUF_CACHE_MAX_BYTES dbuf_cache.max_bytes dbuf_cache_max_bytes
3031
DEADMAN_CHECKTIME_MS deadman.checktime_ms zfs_deadman_checktime_ms

tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
function reset
2525
{
2626
log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 0
27+
log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 25
2728
log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 131072
2829
default_cleanup_noexit
2930
}
3031

3132
default_setup_noexit "$DISKS" "true"
3233
log_onexit reset
3334
log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 5000
35+
log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 5
3436
log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 1
3537

3638
log_must zfs set recordsize=512 $TESTPOOL/$TESTFS

0 commit comments

Comments
 (0)