Documentation
¶
Overview ¶
Package checkpointstorm defines implementation of a workload which deliberately drives a CHECKPOINT storm on a PostgreSQL instance — an I/O sibling of the slow-line family, distinct from wal-flood (ADR-003-2).
It seeds one large table (id bigint PRIMARY KEY, payload bytea), verifies at startup that the connecting role may issue CHECKPOINT (superuser OR pg_checkpoint membership), then fans out --jobs scattered random-id UPDATE workers while a single serial forcer issues synchronous CHECKPOINTs whenever the accumulated dirty-row count crosses a threshold. The forced flushes hammer the storage layer rather than burning CPU.
The workload self-reports honestly: it keeps an in-process counter of the bytes it has dirtied (UPDATEs × payload) and never polls live server state at runtime. The seed table is dropped on a fresh connection at exit. Workload duration is controlled by a context created outside and passed to Run.
Run orchestrates the engine: seed the table, fan out the scattered-churn workers, run the single serial CHECKPOINT forcer on its own connection, and tick the self-report panel — all under one ctx, with cleanup on a fresh connection at exit.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Conninfo defines connection string used for connecting to Postgres.
// It is a secret and must never be logged.
Conninfo string
// TableSize defines the target seed-table size in bytes (from --table-size,
// base-2 parsed). It is converted to a row count via a payload-aware estimate.
TableSize int64
// DirtyPct defines the percentage of rows that must be dirtied before the forcer
// issues a synchronous CHECKPOINT (>= 5; floored anti-self-defeat).
DirtyPct int
// PayloadBytes defines the payload size in bytes written per UPDATE (>= 1).
PayloadBytes int
// Rate defines UPDATE statements rate per second PER worker; 0 means unlimited.
Rate float64
// ReportInterval defines the escalation panel print cadence.
ReportInterval time.Duration
// Jobs defines how many concurrent churn workers to run, taken from the global
// --jobs flag (>= 1).
Jobs uint16
}
Config defines configuration settings for checkpoint-storm workload.