跳转到主要内容

macavity

Deterministic session-local fault injection for PostgreSQL test clusters

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

Overview

ID Extension Package Version Category License Language
5215 macavity macavity 0.2.0 ADMIN MIT C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no
Testing release; destructive crash action affects the entire instance. Disposable test clusters only.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.2.0 18 17 16 15 14 macavity -
RPM PIGSTY 0.2.0 18 17 16 15 14 macavity_$v -
DEB PIGSTY 0.2.0 18 17 16 15 14 postgresql-$v-macavity -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
el8.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
el9.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
el9.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
el10.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
el10.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
d12.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
d12.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
d13.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
d13.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u22.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u22.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u24.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u24.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u26.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
u26.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 N/A N/A
Package Version OS ORG SIZE File URL
macavity_18 0.2.0 el8.x86_64 pigsty 47.8 KiB macavity_18-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_18 0.2.0 el8.aarch64 pigsty 47.2 KiB macavity_18-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_18 0.2.0 el9.x86_64 pigsty 47.8 KiB macavity_18-0.2.0-1PGSTY.el9.x86_64.rpm
macavity_18 0.2.0 el9.aarch64 pigsty 47.3 KiB macavity_18-0.2.0-1PGSTY.el9.aarch64.rpm
macavity_18 0.2.0 el10.x86_64 pigsty 47.8 KiB macavity_18-0.2.0-1PGSTY.el10.x86_64.rpm
macavity_18 0.2.0 el10.aarch64 pigsty 47.6 KiB macavity_18-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-18-macavity 0.2.0 d12.x86_64 pigsty 40.6 KiB postgresql-18-macavity_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-18-macavity 0.2.0 d12.aarch64 pigsty 40.3 KiB postgresql-18-macavity_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-18-macavity 0.2.0 d13.x86_64 pigsty 40.6 KiB postgresql-18-macavity_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-18-macavity 0.2.0 d13.aarch64 pigsty 40.4 KiB postgresql-18-macavity_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-18-macavity 0.2.0 u22.x86_64 pigsty 40.1 KiB postgresql-18-macavity_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-18-macavity 0.2.0 u22.aarch64 pigsty 39.6 KiB postgresql-18-macavity_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-18-macavity 0.2.0 u24.x86_64 pigsty 39.5 KiB postgresql-18-macavity_0.2.0-1PGSTY~noble_amd64.deb
postgresql-18-macavity 0.2.0 u24.aarch64 pigsty 39.3 KiB postgresql-18-macavity_0.2.0-1PGSTY~noble_arm64.deb
postgresql-18-macavity 0.2.0 u26.x86_64 pigsty 39.4 KiB postgresql-18-macavity_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-18-macavity 0.2.0 u26.aarch64 pigsty 39.3 KiB postgresql-18-macavity_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
macavity_17 0.2.0 el8.x86_64 pigsty 47.8 KiB macavity_17-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_17 0.2.0 el8.aarch64 pigsty 47.2 KiB macavity_17-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_17 0.2.0 el9.x86_64 pigsty 47.7 KiB macavity_17-0.2.0-1PGSTY.el9.x86_64.rpm
macavity_17 0.2.0 el9.aarch64 pigsty 47.3 KiB macavity_17-0.2.0-1PGSTY.el9.aarch64.rpm
macavity_17 0.2.0 el10.x86_64 pigsty 47.7 KiB macavity_17-0.2.0-1PGSTY.el10.x86_64.rpm
macavity_17 0.2.0 el10.aarch64 pigsty 47.6 KiB macavity_17-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-17-macavity 0.2.0 d12.x86_64 pigsty 40.6 KiB postgresql-17-macavity_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-17-macavity 0.2.0 d12.aarch64 pigsty 40.3 KiB postgresql-17-macavity_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-17-macavity 0.2.0 d13.x86_64 pigsty 40.6 KiB postgresql-17-macavity_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-17-macavity 0.2.0 d13.aarch64 pigsty 40.4 KiB postgresql-17-macavity_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-17-macavity 0.2.0 u22.x86_64 pigsty 44.9 KiB postgresql-17-macavity_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-17-macavity 0.2.0 u22.aarch64 pigsty 44.4 KiB postgresql-17-macavity_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-17-macavity 0.2.0 u24.x86_64 pigsty 39.5 KiB postgresql-17-macavity_0.2.0-1PGSTY~noble_amd64.deb
postgresql-17-macavity 0.2.0 u24.aarch64 pigsty 39.2 KiB postgresql-17-macavity_0.2.0-1PGSTY~noble_arm64.deb
postgresql-17-macavity 0.2.0 u26.x86_64 pigsty 39.4 KiB postgresql-17-macavity_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-17-macavity 0.2.0 u26.aarch64 pigsty 39.1 KiB postgresql-17-macavity_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
macavity_16 0.2.0 el8.x86_64 pigsty 47.8 KiB macavity_16-0.2.0-1PGSTY.el8.x86_64.rpm
macavity_16 0.2.0 el8.aarch64 pigsty 47.2 KiB macavity_16-0.2.0-1PGSTY.el8.aarch64.rpm
macavity_16 0.2.0 el9.x86_64 pigsty 47.7 KiB macavity_16-0.2.0-1PGSTY.el9.x86_64.rpm
macavity_16 0.2.0 el9.aarch64 pigsty 47.3 KiB macavity_16-0.2.0-1PGSTY.el9.aarch64.rpm
macavity_16 0.2.0 el10.x86_64 pigsty 47.7 KiB macavity_16-0.2.0-1PGSTY.el10.x86_64.rpm
macavity_16 0.2.0 el10.aarch64 pigsty 47.6 KiB macavity_16-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-16-macavity 0.2.0 d12.x86_64 pigsty 40.6 KiB postgresql-16-macavity_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-16-macavity 0.2.0 d12.aarch64 pigsty 40.3 KiB postgresql-16-macavity_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-16-macavity 0.2.0 d13.x86_64 pigsty 40.6 KiB postgresql-16-macavity_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-16-macavity 0.2.0 d13.aarch64 pigsty 40.4 KiB postgresql-16-macavity_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-16-macavity 0.2.0 u22.x86_64 pigsty 44.7 KiB postgresql-16-macavity_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-16-macavity 0.2.0 u22.aarch64 pigsty 44.3 KiB postgresql-16-macavity_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-16-macavity 0.2.0 u24.x86_64 pigsty 39.5 KiB postgresql-16-macavity_0.2.0-1PGSTY~noble_amd64.deb
postgresql-16-macavity 0.2.0 u24.aarch64 pigsty 39.2 KiB postgresql-16-macavity_0.2.0-1PGSTY~noble_arm64.deb
postgresql-16-macavity 0.2.0 u26.x86_64 pigsty 39.4 KiB postgresql-16-macavity_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-16-macavity 0.2.0 u26.aarch64 pigsty 39.1 KiB postgresql-16-macavity_0.2.0-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 via package name, for the active PG version

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.0 provides deterministic fault injection for disposable PostgreSQL test clusters. Upstream tests PostgreSQL 16–18 on Linux; PostgreSQL 19+ and 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 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.