1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-29 22:28:02 +02:00

Disable query parallelism in PostgreSQL sessions used for backup control.

There is no need to have parallelism enabled in a backup control session. In particular, 9.6 marks pg_stop_backup() as parallel-safe but an error will be thrown if pg_stop_backup() is run in a worker.
This commit is contained in:
David Steele
2020-06-25 08:02:48 -04:00
parent c5a507b9a6
commit ea04ec7b3f
7 changed files with 45 additions and 7 deletions

View File

@@ -433,6 +433,13 @@ sub clusterStart
$strCommand .= ' -c wal_level=hot_standby -c hot_standby=' . ($bHotStandby ? 'on' : 'off');
}
# Force parallel mode on to make sure we are disabling it and there are no issues. This is important for testing that 9.6
# works since pg_stop_backup() is marked parallel safe and will error if run in a worker.
if ($self->pgVersion() >= PG_VERSION_96)
{
$strCommand .= " -c force_parallel_mode='on' -c max_parallel_workers_per_gather=2";
}
$strCommand .=
($self->pgVersion() >= PG_VERSION_HOT_STANDBY ? ' -c max_wal_senders=3' : '') .
' -c listen_addresses=\'*\'' .