Skip to content

macavity

Deterministic session-local fault injection for PostgreSQL test clusters

macavity · Deterministic session-local fault injection for PostgreSQL test clusters

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
5215macavitymacavity0.2.1ADMINMITC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno
Test clusters only; a crash affects the instance; 0.2 breaks arm/disarm/status; reconnect, restore grants.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.2.119 18 17 16 15macavity-
RPMPIGSTY0.2.119 18 17 16 15macavity_$v-
DEBPIGSTY0.2.119 18 17 16 15postgresql-$v-macavity-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.2.0PIGSTY 0.2.0PIGSTY 0.2.0N/A
el8.aarch64N/APIGSTY 0.2.0PIGSTY 0.2.0PIGSTY 0.2.0N/A
el9.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
el9.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
el10.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
el10.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
d12.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
d12.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
d13.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
d13.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u22.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u22.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u24.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u24.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u26.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
u26.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1N/A
PackageVersionOSORGSIZEFile URL
macavity_190.2.1el9.x86_64pigsty48.0 KiBmacavity_19-0.2.1-1PGSTY.el9.x86_64.rpm
macavity_190.2.1el9.aarch64pigsty47.7 KiBmacavity_19-0.2.1-1PGSTY.el9.aarch64.rpm
macavity_190.2.1el10.x86_64pigsty48.1 KiBmacavity_19-0.2.1-1PGSTY.el10.x86_64.rpm
macavity_190.2.1el10.aarch64pigsty47.9 KiBmacavity_19-0.2.1-1PGSTY.el10.aarch64.rpm
postgresql-19-macavity0.2.1d12.x86_64pigsty40.8 KiBpostgresql-19-macavity_0.2.1-1PGSTY~bookworm_amd64.deb
postgresql-19-macavity0.2.1d12.aarch64pigsty40.6 KiBpostgresql-19-macavity_0.2.1-1PGSTY~bookworm_arm64.deb
postgresql-19-macavity0.2.1d13.x86_64pigsty40.8 KiBpostgresql-19-macavity_0.2.1-1PGSTY~trixie_amd64.deb
postgresql-19-macavity0.2.1d13.aarch64pigsty40.6 KiBpostgresql-19-macavity_0.2.1-1PGSTY~trixie_arm64.deb
postgresql-19-macavity0.2.1u22.x86_64pigsty40.2 KiBpostgresql-19-macavity_0.2.1-1PGSTY~jammy_amd64.deb
postgresql-19-macavity0.2.1u22.aarch64pigsty39.6 KiBpostgresql-19-macavity_0.2.1-1PGSTY~jammy_arm64.deb
postgresql-19-macavity0.2.1u24.x86_64pigsty39.6 KiBpostgresql-19-macavity_0.2.1-1PGSTY~noble_amd64.deb
postgresql-19-macavity0.2.1u24.aarch64pigsty39.5 KiBpostgresql-19-macavity_0.2.1-1PGSTY~noble_arm64.deb
postgresql-19-macavity0.2.1u26.x86_64pigsty39.5 KiBpostgresql-19-macavity_0.2.1-1PGSTY~resolute_amd64.deb
postgresql-19-macavity0.2.1u26.aarch64pigsty39.4 KiBpostgresql-19-macavity_0.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
macavity_180.2.0el8.x86_64pigsty47.6 KiBmacavity_18-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_180.2.0el8.aarch64pigsty47.3 KiBmacavity_18-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_180.2.1el9.x86_64pigsty48.0 KiBmacavity_18-0.2.1-1PGSTY.el9.x86_64.rpm
macavity_180.2.1el9.aarch64pigsty47.7 KiBmacavity_18-0.2.1-1PGSTY.el9.aarch64.rpm
macavity_180.2.1el10.x86_64pigsty48.1 KiBmacavity_18-0.2.1-1PGSTY.el10.x86_64.rpm
macavity_180.2.1el10.aarch64pigsty47.9 KiBmacavity_18-0.2.1-1PGSTY.el10.aarch64.rpm
postgresql-18-macavity0.2.1d12.x86_64pigsty40.8 KiBpostgresql-18-macavity_0.2.1-1PGSTY~bookworm_amd64.deb
postgresql-18-macavity0.2.1d12.aarch64pigsty40.6 KiBpostgresql-18-macavity_0.2.1-1PGSTY~bookworm_arm64.deb
postgresql-18-macavity0.2.1d13.x86_64pigsty40.8 KiBpostgresql-18-macavity_0.2.1-1PGSTY~trixie_amd64.deb
postgresql-18-macavity0.2.1d13.aarch64pigsty40.6 KiBpostgresql-18-macavity_0.2.1-1PGSTY~trixie_arm64.deb
postgresql-18-macavity0.2.1u22.x86_64pigsty40.2 KiBpostgresql-18-macavity_0.2.1-1PGSTY~jammy_amd64.deb
postgresql-18-macavity0.2.1u22.aarch64pigsty39.6 KiBpostgresql-18-macavity_0.2.1-1PGSTY~jammy_arm64.deb
postgresql-18-macavity0.2.1u24.x86_64pigsty39.6 KiBpostgresql-18-macavity_0.2.1-1PGSTY~noble_amd64.deb
postgresql-18-macavity0.2.1u24.aarch64pigsty39.4 KiBpostgresql-18-macavity_0.2.1-1PGSTY~noble_arm64.deb
postgresql-18-macavity0.2.1u26.x86_64pigsty39.5 KiBpostgresql-18-macavity_0.2.1-1PGSTY~resolute_amd64.deb
postgresql-18-macavity0.2.1u26.aarch64pigsty39.4 KiBpostgresql-18-macavity_0.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
macavity_170.2.0el8.x86_64pigsty47.6 KiBmacavity_17-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_170.2.0el8.aarch64pigsty47.3 KiBmacavity_17-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_170.2.1el9.x86_64pigsty48.0 KiBmacavity_17-0.2.1-1PGSTY.el9.x86_64.rpm
macavity_170.2.1el9.aarch64pigsty47.7 KiBmacavity_17-0.2.1-1PGSTY.el9.aarch64.rpm
macavity_170.2.1el10.x86_64pigsty48.0 KiBmacavity_17-0.2.1-1PGSTY.el10.x86_64.rpm
macavity_170.2.1el10.aarch64pigsty47.8 KiBmacavity_17-0.2.1-1PGSTY.el10.aarch64.rpm
postgresql-17-macavity0.2.1d12.x86_64pigsty40.8 KiBpostgresql-17-macavity_0.2.1-1PGSTY~bookworm_amd64.deb
postgresql-17-macavity0.2.1d12.aarch64pigsty40.5 KiBpostgresql-17-macavity_0.2.1-1PGSTY~bookworm_arm64.deb
postgresql-17-macavity0.2.1d13.x86_64pigsty40.8 KiBpostgresql-17-macavity_0.2.1-1PGSTY~trixie_amd64.deb
postgresql-17-macavity0.2.1d13.aarch64pigsty40.6 KiBpostgresql-17-macavity_0.2.1-1PGSTY~trixie_arm64.deb
postgresql-17-macavity0.2.1u22.x86_64pigsty44.9 KiBpostgresql-17-macavity_0.2.1-1PGSTY~jammy_amd64.deb
postgresql-17-macavity0.2.1u22.aarch64pigsty44.5 KiBpostgresql-17-macavity_0.2.1-1PGSTY~jammy_arm64.deb
postgresql-17-macavity0.2.1u24.x86_64pigsty39.5 KiBpostgresql-17-macavity_0.2.1-1PGSTY~noble_amd64.deb
postgresql-17-macavity0.2.1u24.aarch64pigsty39.3 KiBpostgresql-17-macavity_0.2.1-1PGSTY~noble_arm64.deb
postgresql-17-macavity0.2.1u26.x86_64pigsty39.4 KiBpostgresql-17-macavity_0.2.1-1PGSTY~resolute_amd64.deb
postgresql-17-macavity0.2.1u26.aarch64pigsty39.2 KiBpostgresql-17-macavity_0.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
macavity_160.2.0el8.x86_64pigsty47.6 KiBmacavity_16-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_160.2.0el8.aarch64pigsty47.3 KiBmacavity_16-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_160.2.1el9.x86_64pigsty48.0 KiBmacavity_16-0.2.1-1PGSTY.el9.x86_64.rpm
macavity_160.2.1el9.aarch64pigsty47.7 KiBmacavity_16-0.2.1-1PGSTY.el9.aarch64.rpm
macavity_160.2.1el10.x86_64pigsty48.0 KiBmacavity_16-0.2.1-1PGSTY.el10.x86_64.rpm
macavity_160.2.1el10.aarch64pigsty47.8 KiBmacavity_16-0.2.1-1PGSTY.el10.aarch64.rpm
postgresql-16-macavity0.2.1d12.x86_64pigsty40.8 KiBpostgresql-16-macavity_0.2.1-1PGSTY~bookworm_amd64.deb
postgresql-16-macavity0.2.1d12.aarch64pigsty40.5 KiBpostgresql-16-macavity_0.2.1-1PGSTY~bookworm_arm64.deb
postgresql-16-macavity0.2.1d13.x86_64pigsty40.8 KiBpostgresql-16-macavity_0.2.1-1PGSTY~trixie_amd64.deb
postgresql-16-macavity0.2.1d13.aarch64pigsty40.6 KiBpostgresql-16-macavity_0.2.1-1PGSTY~trixie_arm64.deb
postgresql-16-macavity0.2.1u22.x86_64pigsty44.8 KiBpostgresql-16-macavity_0.2.1-1PGSTY~jammy_amd64.deb
postgresql-16-macavity0.2.1u22.aarch64pigsty44.4 KiBpostgresql-16-macavity_0.2.1-1PGSTY~jammy_arm64.deb
postgresql-16-macavity0.2.1u24.x86_64pigsty39.6 KiBpostgresql-16-macavity_0.2.1-1PGSTY~noble_amd64.deb
postgresql-16-macavity0.2.1u24.aarch64pigsty39.3 KiBpostgresql-16-macavity_0.2.1-1PGSTY~noble_arm64.deb
postgresql-16-macavity0.2.1u26.x86_64pigsty39.4 KiBpostgresql-16-macavity_0.2.1-1PGSTY~resolute_amd64.deb
postgresql-16-macavity0.2.1u26.aarch64pigsty39.2 KiBpostgresql-16-macavity_0.2.1-1PGSTY~resolute_arm64.deb

Source

pig build pkg macavity;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install macavity;		# install by package name

pig install macavity -v 19;   # install for PG 19
pig install macavity -v 18;   # install for PG 18
pig install macavity -v 17;   # install for PG 17
pig install macavity -v 16;   # install for PG 16

Create this extension with:

CREATE EXTENSION macavity;

Usage

Sources:

macavity 0.2.1 provides deterministic fault injection for disposable PostgreSQL test clusters. Upstream supports PostgreSQL 16–19 on Linux; other platforms are not validated, and Windows crash injection is unsupported. The crash action can disconnect every session and force crash recovery.

Event workflow

CREATE EXTENSION macavity;
SELECT * FROM macavity_points();
SELECT macavity_arm('executor_start', 'error', 1);
SELECT 1; -- expected injected error
SELECT * FROM macavity_status();
SELECT macavity_disarm();
SELECT macavity_reset();

Registry and upgrade

Each session keeps multiple events with stable IDs, separate counters and states armed, completed or disarmed. macavity_arm returns an integer event ID; its single-ID overload re-arms a completed or disarmed event. macavity_status returns zero or more event rows. macavity_disarm retains event history; macavity_reset clears it and restarts IDs.

Points are executor_start, executor_end, before_commit and before_abort; actions are error, delay and crash. Delay lasts one second. Abort-time error injection is rejected. At a shared hit, delay precedes crash, then error, with IDs breaking ties.

Creation requires a superuser; no shared preload is needed. Only point enumeration is granted to PUBLIC. Upgrading from 0.1.0 with ALTER EXTENSION macavity UPDATE recreates functions with changed signatures: restore explicit grants, update callers and reconnect old sessions. Current Pigsty package fields still refer to 0.1.0.

Version 0.2.1

The 0.2.0 to 0.2.1 SQL upgrade is a no-op; this release adds PostgreSQL 19 compatibility without changing the SQL API. Install the matching library and SQL files, run ALTER EXTENSION macavity UPDATE TO '0.2.1';, and reconnect existing sessions before testing.

Table reader