Documentation
¶
Overview ¶
Package deadlocks defines implementation of workload which creates deadlocks between several concurrent transactions, which finally leads to Postgres have to resolve the deadlock and terminate an one participant of the deadlock.
Before starting the workload, some prepare steps have to be made - a special working table should be created. When the workload is finished this table should be dropped. For more info see prepare and cleanup methods. When working table is created, the workload is allowed to start. The number of necessary workers could be started (accordingly to Config.Jobs). Each worker calls a deadlock routine in a separate goroutine. Deadlock routine inserts to unique rows into the working table and than starts two transactions which tries to make a cross-update of these rows. Obviously, this update fails with a deadlock, which forces Postgres to resolve it. Postgres resolves the deadlock by terminating a single participant of the deadlock. As a result the second survived transaction can continue its work and return.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.