Skip to content

Commit 87acba1

Browse files
authored
fix: Allow setting maximum-backup-rate on create postgres step (#812)
1 parent 93fc6b1 commit 87acba1

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

docs/ref/pg_autoctl_create_postgres.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ registered too, and is known to be healthy).
4040
--server-cert set the Postgres ssl_cert_file to that file path
4141
--candidate-priority priority of the node to be promoted to become primary
4242
--replication-quorum true if node participates in write quorum
43+
--maximum-backup-rate maximum transfer rate of data transferred from the server during initial sync
4344

4445
Description
4546
-----------
@@ -261,6 +262,12 @@ The following options are available to ``pg_autoctl create postgres``:
261262
value (either ``true`` or ``false``) at node registration on the monitor.
262263
Defaults to ``true``, which enables synchronous replication.
263264

265+
--maximum-backup-rate
266+
267+
Sets the maximum transfer rate of data transferred from the server during
268+
initial sync. This is used by ``pg_basebackup``.
269+
Defaults to ``100M``.
270+
264271
--run
265272

266273
Immediately run the ``pg_autoctl`` service after having created this node.

src/bin/pg_autoctl/cli_common.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ int monitorDisabledNodeId = -1;
7373
* { "citus-cluster", required_argument, NULL, 'Z' },
7474
* { "candidate-priority", required_argument, NULL, 'P'},
7575
* { "replication-quorum", required_argument, NULL, 'r'},
76+
* { "maximum-backup-rate", required_argument, NULL, 'R' },
7677
* { "help", no_argument, NULL, 0 },
7778
* { "run", no_argument, NULL, 'x' },
7879
* { "ssl-self-signed", no_argument, NULL, 's' },
@@ -389,6 +390,16 @@ cli_common_keeper_getopts(int argc, char **argv,
389390
break;
390391
}
391392

393+
case 'R':
394+
{
395+
/* { "maximum-backup-rate", required_argument, NULL, 'R' } */
396+
strlcpy(LocalOptionConfig.maximum_backup_rate, optarg,
397+
MAXIMUM_BACKUP_RATE_LEN);
398+
log_trace("--maximum-backup-rate %s",
399+
LocalOptionConfig.maximum_backup_rate);
400+
break;
401+
}
402+
392403
case 'V':
393404
{
394405
/* keeper_cli_print_version prints version and exits. */

src/bin/pg_autoctl/cli_create_node.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ CommandLine create_postgres_command =
9191
" --pg-hba-lan edit pg_hba.conf rules for --dbname in detected LAN\n"
9292
KEEPER_CLI_SSL_OPTIONS
9393
" --candidate-priority priority of the node to be promoted to become primary\n"
94-
" --replication-quorum true if node participates in write quorum\n",
94+
" --replication-quorum true if node participates in write quorum\n"
95+
" --maximum-backup-rate maximum transfer rate of data transferred from the server during initial sync\n",
9596
cli_create_postgres_getopts,
9697
cli_create_postgres);
9798

@@ -272,6 +273,7 @@ cli_create_postgres_getopts(int argc, char **argv)
272273
{ "help", no_argument, NULL, 'h' },
273274
{ "candidate-priority", required_argument, NULL, 'P' },
274275
{ "replication-quorum", required_argument, NULL, 'r' },
276+
{ "maximum-backup-rate", required_argument, NULL, 'R' },
275277
{ "run", no_argument, NULL, 'x' },
276278
{ "no-ssl", no_argument, NULL, 'N' },
277279
{ "ssl-self-signed", no_argument, NULL, 's' },

0 commit comments

Comments
 (0)