mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fast Clone Deletion
Deleting a clone requires finding blocks are clone-only, not shared with the snapshot. This was done by traversing the entire block tree which results in a large performance penalty for sparsely written clones. This is new method keeps track of clone blocks when they are modified in a "Livelist" so that, when it’s time to delete, the clone-specific blocks are already at hand. We see performance improvements because now deletion work is proportional to the number of clone-modified blocks, not the size of the original dataset. Reviewed-by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Signed-off-by: Sara Hartse <sara.hartse@delphix.com> Closes #8416
This commit is contained in:
committed by
Brian Behlendorf
parent
d274ac5460
commit
37f03da8ba
@@ -1909,6 +1909,98 @@ Pattern written to vdev free space by \fBzpool initialize\fR.
|
||||
Default value: \fB16,045,690,984,833,335,022\fR (0xdeadbeefdeadbeee).
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_max_entries\fR (ulong)
|
||||
.ad
|
||||
.RS 12n
|
||||
The threshold size (in block pointers) at which we create a new sub-livelist.
|
||||
Larger sublists are more costly from a memory perspective but the fewer
|
||||
sublists there are, the lower the cost of insertion.
|
||||
.sp
|
||||
Default value: \fB500,000\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_min_percent_shared\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
If the amount of shared space between a snapshot and its clone drops below
|
||||
this threshold, the clone turns off the livelist and reverts to the old deletion
|
||||
method. This is in place because once a clone has been overwritten enough
|
||||
livelists no long give us a benefit.
|
||||
.sp
|
||||
Default value: \fB75\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_condense_new_alloc\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
Incremented each time an extra ALLOC blkptr is added to a livelist entry while
|
||||
it is being condensed.
|
||||
This option is used by the test suite to track race conditions.
|
||||
.sp
|
||||
Default value: \fB0\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_condense_sync_cancel\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
Incremented each time livelist condensing is canceled while in
|
||||
spa_livelist_condense_sync.
|
||||
This option is used by the test suite to track race conditions.
|
||||
.sp
|
||||
Default value: \fB0\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_condense_sync_pause\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
When set, the livelist condense process pauses indefinitely before
|
||||
executing the synctask - spa_livelist_condense_sync.
|
||||
This option is used by the test suite to trigger race conditions.
|
||||
.sp
|
||||
Default value: \fB0\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_condense_zthr_cancel\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
Incremented each time livelist condensing is canceled while in
|
||||
spa_livelist_condense_cb.
|
||||
This option is used by the test suite to track race conditions.
|
||||
.sp
|
||||
Default value: \fB0\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fBzfs_livelist_condense_zthr_pause\fR (int)
|
||||
.ad
|
||||
.RS 12n
|
||||
When set, the livelist condense process pauses indefinitely before
|
||||
executing the open context condensing work in spa_livelist_condense_cb.
|
||||
This option is used by the test suite to trigger race conditions.
|
||||
.sp
|
||||
Default value: \fB0\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
|
||||
@@ -547,6 +547,26 @@ allow more data to be stored in the bonus buffer, thus potentially
|
||||
improving performance by avoiding the use of spill blocks.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fB\fBlivelist\fR\fR
|
||||
.ad
|
||||
.RS 4n
|
||||
.TS
|
||||
l l .
|
||||
GUID com.delphix:livelist
|
||||
READ\-ONLY COMPATIBLE yes
|
||||
DEPENDENCIES none
|
||||
.TE
|
||||
This feature allows clones to be deleted faster than the traditional method
|
||||
when a large number of random/sparse writes have been made to the clone.
|
||||
All blocks allocated and freed after a clone is created are tracked by the
|
||||
the clone's livelist which is referenced during the deletion of the clone.
|
||||
The feature is activated when a clone is created and remains active until all
|
||||
clones have been destroyed.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
@@ -882,7 +902,6 @@ This feature becomes \fBactive\fR when the \fBzpool checkpoint\fR subcommand
|
||||
is used to checkpoint the pool.
|
||||
The feature will only return back to being \fBenabled\fR when the pool
|
||||
is rewound or the checkpoint has been discarded.
|
||||
.RE
|
||||
|
||||
.SH "SEE ALSO"
|
||||
zpool(8)
|
||||
|
||||
Reference in New Issue
Block a user