Skip to content

Add SQLite health & WAL workflows + deleted-but-open files finder - #198

Open
Gromykoss wants to merge 1 commit into
warpdotdev:mainfrom
Gromykoss:sqlite-health-workflows
Open

Gromykoss wants to merge 1 commit into
warpdotdev:mainfrom
Gromykoss:sqlite-health-workflows

Conversation

@Gromykoss

Copy link
Copy Markdown

What

4 new workflow specs (3 in specs/sql/, 1 in specs/shell/):

File Command What for
specs/sql/check_sqlite_database_integrity.yaml sqlite3 <db> "PRAGMA integrity_check;" Full corruption check of a SQLite database
specs/sql/find_deleted_but_open_sqlite_wal_shm_sidecars.yaml lsof +L1 | grep ... Detects live processes holding FDs to deleted WAL/SHM sidecars — the signature of the POSIX lock-drop bug class (fails later with SQLITE_IOERR on checkpoint/clone)
specs/sql/checkpoint_sqlite_wal_file.yaml PRAGMA wal_checkpoint(TRUNCATE) Shrinks a grown-out WAL back into the main db
specs/shell/find_deleted_but_open_files_holding_disk_space.yaml lsof +L1 The classic hidden disk-space eater: daemons holding deleted FDs after log rotation / file swap

Why these

Battle-tested on a live multi-agent deployment while debugging a SQLite
permission helper that dropped active POSIX record locks (open/fchmod/close on
an ordinary descriptor cancels them), reproducing deleted WAL/SHM handles and
disk I/O errors (see stephenschoettler/hermes-lcm#588). The lsof +L1 detection
pattern is the fastest way to spot this bug class; the generic lsof +L1
workflow also catches the everyday "df says full, du says empty" case.

Format

Follows FORMAT.md: name / command with {{arg}} / tags / description / source_url / author / author_url / shells. All commands verified against live SQLite databases.

- Check SQLite database integrity (integrity_check)
- Find deleted-but-open SQLite WAL/SHM sidecars (lock-drop detection)
- Checkpoint SQLite WAL file into the main database
- Find deleted-but-open files holding disk space (lsof +L1)

Battle-tested on a live multi-agent deployment after debugging a
SQLite permission-helper lock-drop (upstream hermes-lcm #588).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant