By: Tom Sydney Kerckhove <syd@cs-syd.eu>
Start the standby on demand The standby was started whether or not anything read from it, so a suite that never touches its replica paid for one anyway. replicatedDBStandby is an IO Standby now, started by the first test that asks and by nothing else, and the bracket became an acquire/release pair so that deferring it was possible at all. Worth about 0.17 seconds per process that never reads a replica, measured after the base backup stopped waiting for a spread checkpoint. Before that it would have been worth 13.5. StandbySpec asks the primary what is streaming from it: nothing until something asks for a standby, and the same standby however often it is asked for after that.