Add TXG timestamp database

This feature enables tracking of when TXGs are committed to disk,
providing an estimated timestamp for each TXG.

With this information, it becomes possible to perform scrubs based
on specific date ranges, improving the granularity of data
management and recovery operations.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Signed-off-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #16853
This commit is contained in:
Mariusz Zaborski
2025-08-06 19:31:21 +02:00
committed by GitHub
parent c3496b5cc6
commit 894edd084e
21 changed files with 736 additions and 10 deletions
+41 -1
View File
@@ -28,7 +28,7 @@
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\" Copyright (c) 2025 Hewlett Packard Enterprise Development LP.
.\"
.Dd November 18, 2024
.Dd December 11, 2024
.Dt ZPOOL-SCRUB 8
.Os
.
@@ -40,6 +40,8 @@
.Cm scrub
.Op Ns Fl e | Ns Fl p | Fl s Ns | Fl C Ns
.Op Fl w
.Op Fl S Ar date
.Op Fl E Ar date
.Fl a Ns | Ns Ar pool Ns …
.
.Sh DESCRIPTION
@@ -125,6 +127,44 @@ resilvering, nor can it be run when a regular scrub is paused.
Continue scrub from last saved txg (see zpool
.Sy last_scrubbed_txg
property).
.It Fl S Ar date , Fl E Ar date
Allows specifying the date range for blocks created between these dates.
.Bl -bullet -compact -offset indent
.It
.Fl S
Defines a start date.
If not specified, scrubbing begins from the start of the pool's
existence.
.It
.Fl E
Defines an end date.
If not specified, scrubbing continues up to the most recent data.
.El
The provided date should be in the format:
.Dq YYYY-MM-DD HH:MM .
Where:
.Bl -bullet -compact -offset indent
.It
.Dq YYYY
is the year.
.It
.Dq MM
is the numeric representation of the month.
.It
.Dq DD
is the day of the month.
.It
.Dq HH
is the hour.
.It
.Dq MM
is the minutes.
.El
The hour and minutes parameters can be omitted.
The time should be provided in machine local time zone.
Specifying dates prior to enabling this feature will result in scrubbing
starting from the date the pool was created.
If the time was moved backward manually the data range may become inaccurate.
.El
.Sh EXAMPLES
.Ss Example 1