Command line utility written in python that is meant to:
- Connect to
questdb
instance - Search for suspended WAL tables
- Search for WAL/segment ids of suspended tables from provided log file
- Search for corrupted transaction for each suspended tables
- Resume WAL by skipping corrupted transation
Essentially, it does what's described in Diagnosing corrupted WAL transactions but in automated way.
- Install dependencies from
requirements.txt
, otherwisePipfile
can be utilised along withpipenv
- Fetch logs from your
questdb
instance, forquestdb
running in docker container:docker logs questdb > logs/qdb.log
- Make sure your
questdb
instance has PGWire enabled and that it accepts connections on8812
port (or other if configured differently) - Execute with
--dry-run
flag:python main.py \ --host <host> \ --port <port> \ --username <username> \ --password <password> \ --database questdb \ --log-file logs/qdb.log \ --dry-run
- Examine if there are no errors when connecting to
questdb
or parsin log file. - Run again without
--dry-run
flag - Enjoy resumed WAL table :)
This utility was written to handle suspended WAL tables that have been suspended because of power failures on device hosting questdb
.
As pointed out in #4829 issue, skipping corrupted WAL transactions might not always work in case of serious storage corruption.