More efficient info bucket management

Logged at every state_read() and state_write()
This commit is contained in:
Andrea Mazzoleni 2026-02-08 22:56:22 +01:00
parent 83b1c9bf3b
commit d5b5a9bcbf
13 changed files with 375 additions and 495 deletions

View file

@ -31,7 +31,7 @@ NAME:VALUE:VALUE:VALUE...<EOL>
.TP
.B NAME
This is the primary tag identifier, always a lowercase string
without spaces (e.g., \`summary\`, \`block\`, \`info_time\`).
without spaces (e.g., \`summary\`, \`block\`).
.TP
.B VALUE
Following the \`NAME\`, these can be additional sub\-identifiers,
@ -338,6 +338,27 @@ meaning their parity data is out of date.
The total counter of blocks.
.PD
.RE
.TP
.B content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
.TP
.B content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
.RS 4
.PD 0
.HP 4
.I <time>
Unix timestamp of the scrub/sync.
.HP 4
.I <count_scrubbed>
Number of blocks scrubbed at this timestamp.
.HP 4
.I <count_new>
Number of blocks that were synced at this
timestamp and haven\'t been scrubbed yet.
.PD
.RE
.SH DIAGNOSTICS TAGS
.TP
.B version:<version>
@ -954,89 +975,19 @@ These tags list files with zero sub\-second timestamps.
.B zerosubsecond:<disk_name>:<file_path>
Lists files that have a zero sub\-second timestamp.
Up to 50 are logged per disk.
.SS Block Information Tags
Status of all the blocks of the array.
.TP
.B block_count:<uint>
The total number of blocks in the array.
.TP
.B block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
Status of a specific block.
Only produced when \`\-\-gui\-verbose\` option is used.
.RS 4
.PD 0
.HP 4
.I <index>
Block index.
.HP 4
.I <time>
Last scrub time (Unix timestamp). A value of 0 means
the block has never been scrubbed.
.HP 4
.I <used>
\`used\` if the block contains data, otherwise empty.
.HP 4
.I <unsynced>
\`unsynced\` if the block needs a sync, otherwise empty.
.HP 4
.I <bad>
\`bad\` if the block has errors, otherwise empty.
.HP 4
.I <rehash>
\`rehash\` if the block needs a rehash, otherwise empty.
.PD
.RE
.TP
.B block_noinfo:<index>:<used>:<unsynced>
Status of an unused block (no info recorded) in the content file.
Only produced when \`\-\-gui\-verbose\` option is used.
.RS 4
.PD 0
.HP 4
.I <index>
Block index.
.HP 4
.I <used>
\`used\` if the block contains data, otherwise empty.
.HP 4
.I <unsynced>
\`unsynced\` if the block needs a sync, otherwise empty.
.PD
.RE
.SS Scrub History Tags
These tags provide details on the scrub/sync time distribution.
.TP
.B info_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
.TP
.B info_time:<time>:<count>:<status>
All the info records.
.RS 4
.PD 0
.HP 4
.I <time>
Unix timestamp of the scrub/sync.
.HP 4
.I <count>
Number of blocks processed at this timestamp.
.HP 4
.I <status>
\`scrubbed\` (for blocks verified to be correct) or
\`new\` (for synced blocks that haven\'t been scrubbed yet).
.PD
.RE
.SS Scrub Graph Tags
These tags provide a simple graph data of the past scrub and sync
operations.
.TP
.B scrub_graph_range:<max_columns>:<max_height>
Dimensions of the scrub history graph obtained from the
\`info_time\` records. This provides the boundary for the
\`content_info:bucket\` records. This provides the boundary for the
precomputed graph data available in the \`scrub_graph_bar\` tags.
.RS 4
.PD 0
.HP 4
.I <max_columns>
The number of columns in the graph (constant
GRAPH_COLUMN).
The number of columns in the graph.
.HP 4
.I <max_height>
The maximum height (peak count) of blocks found

View file

@ -25,7 +25,7 @@ Description
=NAME
This is the primary tag identifier, always a lowercase string
without spaces (e.g., `summary`, `block`, `info_time`).
without spaces (e.g., `summary`, `block`).
=VALUE
Following the `NAME`, these can be additional sub-identifiers,
descriptive names (like a disk name), or numeric/string data
@ -210,6 +210,18 @@ Content Tags
meaning their parity data is out of date.
block - The total counter of blocks.
=content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
=content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
<time> - Unix timestamp of the scrub/sync.
<count_scrubbed> - Number of blocks scrubbed at this timestamp.
<count_new> - Number of blocks that were synced at this
timestamp and haven't been scrubbed yet.
Diagnostics Tags
=version:<version>
The version of SnapRAID run.
@ -621,54 +633,16 @@ Command Status Tags
Lists files that have a zero sub-second timestamp.
Up to 50 are logged per disk.
Block Information Tags
Status of all the blocks of the array.
=block_count:<uint>
The total number of blocks in the array.
=block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
Status of a specific block.
Only produced when `--gui-verbose` option is used.
<index> - Block index.
<time> - Last scrub time (Unix timestamp). A value of 0 means
the block has never been scrubbed.
<used> - `used` if the block contains data, otherwise empty.
<unsynced> - `unsynced` if the block needs a sync, otherwise empty.
<bad> - `bad` if the block has errors, otherwise empty.
<rehash> - `rehash` if the block needs a rehash, otherwise empty.
=block_noinfo:<index>:<used>:<unsynced>
Status of an unused block (no info recorded) in the content file.
Only produced when `--gui-verbose` option is used.
<index> - Block index.
<used> - `used` if the block contains data, otherwise empty.
<unsynced> - `unsynced` if the block needs a sync, otherwise empty.
Scrub History Tags
These tags provide details on the scrub/sync time distribution.
=info_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
=info_time:<time>:<count>:<status>
All the info records.
<time> - Unix timestamp of the scrub/sync.
<count> - Number of blocks processed at this timestamp.
<status> - `scrubbed` (for blocks verified to be correct) or
`new` (for synced blocks that haven't been scrubbed yet).
Scrub Graph Tags
These tags provide a simple graph data of the past scrub and sync
operations.
=scrub_graph_range:<max_columns>:<max_height>
Dimensions of the scrub history graph obtained from the
`info_time` records. This provides the boundary for the
`content_info:bucket` records. This provides the boundary for the
precomputed graph data available in the `scrub_graph_bar` tags.
<max_columns> - The number of columns in the graph (constant
GRAPH_COLUMN).
<max_columns> - The number of columns in the graph.
<max_height> - The maximum height (peak count) of blocks found
in any column (the highest sum of scrubbed and new blocks).

View file

@ -29,7 +29,7 @@ NAME:VALUE:VALUE:VALUE...<EOL>
NAME
This is the primary tag identifier, always a lowercase string
without spaces (e.g., `summary`, `block`, `info_time`).
without spaces (e.g., `summary`, `block`).
VALUE
Following the `NAME`, these can be additional sub-identifiers,
descriptive names (like a disk name), or numeric/string data
@ -220,6 +220,18 @@ These tags report the information stored in the content file.
meaning their parity data is out of date.
block - The total counter of blocks.
content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
<time> - Unix timestamp of the scrub/sync.
<count_scrubbed> - Number of blocks scrubbed at this timestamp.
<count_new> - Number of blocks that were synced at this
timestamp and haven't been scrubbed yet.
4 DIAGNOSTICS TAGS
==================
@ -646,54 +658,16 @@ These tags list files with zero sub-second timestamps.
Lists files that have a zero sub-second timestamp.
Up to 50 are logged per disk.
---- 8.0.4 Block Information Tags ----
Status of all the blocks of the array.
block_count:<uint>
The total number of blocks in the array.
block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
Status of a specific block.
Only produced when `--gui-verbose` option is used.
<index> - Block index.
<time> - Last scrub time (Unix timestamp). A value of 0 means
the block has never been scrubbed.
<used> - `used` if the block contains data, otherwise empty.
<unsynced> - `unsynced` if the block needs a sync, otherwise empty.
<bad> - `bad` if the block has errors, otherwise empty.
<rehash> - `rehash` if the block needs a rehash, otherwise empty.
block_noinfo:<index>:<used>:<unsynced>
Status of an unused block (no info recorded) in the content file.
Only produced when `--gui-verbose` option is used.
<index> - Block index.
<used> - `used` if the block contains data, otherwise empty.
<unsynced> - `unsynced` if the block needs a sync, otherwise empty.
---- 8.0.5 Scrub History Tags ----
These tags provide details on the scrub/sync time distribution.
info_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
info_time:<time>:<count>:<status>
All the info records.
<time> - Unix timestamp of the scrub/sync.
<count> - Number of blocks processed at this timestamp.
<status> - `scrubbed` (for blocks verified to be correct) or
`new` (for synced blocks that haven't been scrubbed yet).
---- 8.0.4 Scrub Graph Tags ----
These tags provide a simple graph data of the past scrub and sync
operations.
scrub_graph_range:<max_columns>:<max_height>
Dimensions of the scrub history graph obtained from the
`info_time` records. This provides the boundary for the
`content_info:bucket` records. This provides the boundary for the
precomputed graph data available in the `scrub_graph_bar` tags.
<max_columns> - The number of columns in the graph (constant
GRAPH_COLUMN).
<max_columns> - The number of columns in the graph.
<max_height> - The maximum height (peak count) of blocks found
in any column (the highest sum of scrubbed and new blocks).