SHOW STUCK UNLINKS
SHOW_STUCK_UNLINKS lists groups of deleted files that SQreamDB has tried to remove from disk and failed at least
once.
When you drop a table, or clean up after a DELETE, the files that held the data are not removed at once. They are
queued, and a background process removes them from disk. If removing a group of files fails, for example because of a
storage error, the group is queued again and retried. Use SHOW_STUCK_UNLINKS when disk space is not freed after a
DROP TABLE or a clean-up, to see whether any files are waiting on a failed removal and where they are.
See also Deleting Data, DELETE.
Syntax
show_stuck_unlinks_statement ::=
SELECT SHOW_STUCK_UNLINKS()
;
The function takes no arguments.
Returns
A result set with one row for each group of files whose removal has failed at least once. Files that are queued for removal but have not yet been tried are not listed. When no removal has failed, the result set is empty.
Column name |
Description |
|---|---|
|
The folder that holds the files |
|
The number of files in the group |
|
The number of times removing the group has failed |
|
The metadata key under which the group is queued |
Permissions
The role must have SUPERUSER permissions.
Notes
A large set of files from one folder is queued in several groups, so the same
pathcan appear in more than one row.The
attemptscount is stored in the metadata, so it is kept across a restart.The result is capped at 100,000 rows. If more groups are stuck, the rest are not shown and a warning is written to the log.
The function reads the queue across all databases in the cluster.
Examples
Listing files whose removal has failed
SELECT SHOW_STUCK_UNLINKS();