ddt: dedup table quota enforcement

This adds two new pool properties:
- dedup_table_size, the total size of all DDTs on the pool; and
- dedup_table_quota, the maximum possible size of all DDTs in the pool

When set, quota will be enforced by checking when a new entry is about
to be created. If the pool is over its dedup quota, the entry won't be
created, and the corresponding write will be converted to a regular
non-dedup write. Note that existing entries can be updated (ie their
refcounts changed), as that reuses the space rather than requiring more.

dedup_table_quota can be set to 'auto', which will set it based on the
size of the devices backing the "dedup" allocation device. This makes it
possible to limit the DDTs to the size of a dedup vdev only, such that
when the device fills, no new blocks are deduplicated.

Sponsored-by: iXsystems, Inc.
Sponsored-By: Klara Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Signed-off-by: Don Brady <don.brady@klarasystems.com>
Co-authored-by: Don Brady <don.brady@klarasystems.com>
Co-authored-by: Rob Wing <rob.wing@klarasystems.com>
Co-authored-by: Sean Eric Fagan <sean.fagan@klarasystems.com>
Closes #15889
This commit is contained in:
Allan Jude
2024-07-25 12:47:36 -04:00
committed by GitHub
parent 82f281ad99
commit c7ada64bb6
22 changed files with 599 additions and 22 deletions
+24 -1
View File
@@ -28,7 +28,7 @@
.\" Copyright (c) 2021, Colm Buckley <colm@tuatha.org>
.\" Copyright (c) 2023, Klara Inc.
.\"
.Dd January 2, 2024
.Dd January 14, 2024
.Dt ZPOOLPROPS 7
.Os
.
@@ -73,6 +73,8 @@ The amount of storage used by cloned blocks.
Percentage of pool space used.
This property can also be referred to by its shortened column name,
.Sy cap .
.It Sy dedup_table_size
Total on-disk size of the deduplication table.
.It Sy expandsize
Amount of uninitialized space within the pool or device that can be used to
increase the total capacity of the pool.
@@ -348,6 +350,27 @@ See
and
.Xr zpool-upgrade 8
for more information on the operation of compatibility feature sets.
.It Sy dedup_table_quota Ns = Ns Ar number Ns | Ns Sy none Ns | Ns Sy auto
This property sets a limit on the on-disk size of the pool's dedup table.
Entries will not be added to the dedup table once this size is reached;
if a dedup table already exists, and is larger than this size, they
will not be removed as part of setting this property.
Existing entries will still have their reference counts updated.
.Pp
The actual size limit of the table may be above or below the quota,
depending on the actual on-disk size of the entries (which may be
approximated for purposes of calculating the quota).
That is, setting a quota size of 1M may result in the maximum size being
slightly below, or slightly above, that value.
Set to
.Sy 'none'
to disable.
In automatic mode, which is the default, the size of a dedicated dedup vdev
is used as the quota limit.
.Pp
The
.Sy dedup_table_quota
property works for both legacy and fast dedup tables.
.It Sy dedupditto Ns = Ns Ar number
This property is deprecated and no longer has any effect.
.It Sy delegation Ns = Ns Sy on Ns | Ns Sy off