Hello Fault injection was discussed a few months ago at PGCon in Ottawa. At least a few folks showed interest and so I would like to present what we have been using in Greenplum.
The attached patch set contains the fault injector framework ported to PostgreSQL master. It provides ability to define points of interest in backend code and then inject faults at those points from SQL. Also included is an isolation test to simulate a speculative insert conflict scenario that was found to be rather cumbersome to implement using advisory locks, see [1]. The alternative isolation spec using fault injectors seems much simpler to understand. Asim [1] CAAKRu_a7hbyrk=wveHYhr4LbcRnRCG=ypuvoqyb9yo1cdub...@mail.gmail.com <https://www.postgresql.org/message-id/CAAKRu_a7hbyrk%3DwveHYhr4LbcRnRCG%3DyPUVoQYB9YO1CdUBE9Q%40mail.gmail.com>
0001-Framework-to-inject-faults-from-SQL-tests.patch
Description: Binary data
0003-Speculative-insert-isolation-test-spec-using-fault-i.patch
Description: Binary data
0004-Run-tests-with-faults-if-faultinjector-was-compiled-.patch
Description: Binary data
0002-Add-syntax-to-declare-a-step-that-is-expected-to-blo.patch
Description: Binary data
0005-Isolation-schedule-for-tests-that-inject-faults.patch
Description: Binary data