pg_crash
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_crash | 1.0 | ADMIN | BSD 3-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5210 | pg_crash | No | Yes | Yes | No | No | No | - |
| Related | pg_snakeoil pg_cheat_funcs pg_savior pg_dirtyread pg_surgery pg_repack pg_rewrite pg_squeeze |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | pg_crash | - |
| RPM | PIGSTY | 1.0 | 1817161514 | pg_crash_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-pg-crash | - |
Build
You can build the RPM / DEB packages for pg_crash using pig build:
pig build pkg pg_crash # build RPM / DEB packages
Install
You can install pg_crash directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_crash; # Install for current active PG version
pig ext install -y pg_crash -v 18 # PG 18
pig ext install -y pg_crash -v 17 # PG 17
pig ext install -y pg_crash -v 16 # PG 16
pig ext install -y pg_crash -v 15 # PG 15
pig ext install -y pg_crash -v 14 # PG 14
dnf install -y pg_crash_18 # PG 18
dnf install -y pg_crash_17 # PG 17
dnf install -y pg_crash_16 # PG 16
dnf install -y pg_crash_15 # PG 15
dnf install -y pg_crash_14 # PG 14
apt install -y postgresql-18-pg-crash # PG 18
apt install -y postgresql-17-pg-crash # PG 17
apt install -y postgresql-16-pg-crash # PG 16
apt install -y postgresql-15-pg-crash # PG 15
apt install -y postgresql-14-pg-crash # PG 14
Preload:
shared_preload_libraries = 'pg_crash';
Usage
pg_crash is a chaos engineering extension that periodically sends kill signals to PostgreSQL backend processes, useful for HA and failover testing. It must be added to shared_preload_libraries.
Configuration
Add to postgresql.conf:
shared_preload_libraries = 'pg_crash'
# POSIX signals to send (space-separated)
crash.signals = '1 2 3'
# Delay in seconds between sending signals
crash.delay = 30
Signal Reference
Common POSIX signals: 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), 9 (SIGKILL), 15 (SIGTERM).
After configuring, restart the server. The background worker will periodically send the configured signals to random backend processes at the specified interval.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.