summaryrefslogtreecommitdiff
path: root/src/bin/pg_basebackup/pg_receivexlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_basebackup/pg_receivexlog.c')
-rw-r--r--src/bin/pg_basebackup/pg_receivexlog.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index bc0940aeaf..4658f080f3 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -36,10 +36,10 @@ static char *basedir = NULL;
static int verbose = 0;
static int noloop = 0;
static int standby_message_timeout = 10 * 1000; /* 10 sec = default */
-static int fsync_interval = 0; /* 0 = default */
static volatile bool time_to_abort = false;
static bool do_create_slot = false;
static bool do_drop_slot = false;
+static bool synchronous = false;
static void usage(void);
@@ -66,12 +66,11 @@ usage(void)
printf(_(" %s [OPTION]...\n"), progname);
printf(_("\nOptions:\n"));
printf(_(" -D, --directory=DIR receive transaction log files into this directory\n"));
- printf(_(" -F --fsync-interval=SECS\n"
- " time between fsyncs to transaction log files (default: %d)\n"), (fsync_interval / 1000));
printf(_(" -n, --no-loop do not loop on connection lost\n"));
printf(_(" -s, --status-interval=SECS\n"
" time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
+ printf(_(" --synchronous flush transaction log immediately after writing\n"));
printf(_(" -v, --verbose output verbose messages\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));
@@ -343,7 +342,7 @@ StreamLog(void)
ReceiveXlogStream(conn, startpos, starttli, NULL, basedir,
stop_streaming, standby_message_timeout, ".partial",
- fsync_interval);
+ synchronous);
PQfinish(conn);
conn = NULL;
@@ -374,7 +373,6 @@ main(int argc, char **argv)
{"port", required_argument, NULL, 'p'},
{"username", required_argument, NULL, 'U'},
{"no-loop", no_argument, NULL, 'n'},
- {"fsync-interval", required_argument, NULL, 'F'},
{"no-password", no_argument, NULL, 'w'},
{"password", no_argument, NULL, 'W'},
{"status-interval", required_argument, NULL, 's'},
@@ -383,6 +381,7 @@ main(int argc, char **argv)
/* action */
{"create-slot", no_argument, NULL, 1},
{"drop-slot", no_argument, NULL, 2},
+ {"synchronous", no_argument, NULL, 3},
{NULL, 0, NULL, 0}
};
@@ -408,7 +407,7 @@ main(int argc, char **argv)
}
}
- while ((c = getopt_long(argc, argv, "D:d:h:p:U:s:S:nF:wWv",
+ while ((c = getopt_long(argc, argv, "D:d:h:p:U:s:S:nwWv",
long_options, &option_index)) != -1)
{
switch (c)
@@ -455,15 +454,6 @@ main(int argc, char **argv)
case 'n':
noloop = 1;
break;
- case 'F':
- fsync_interval = atoi(optarg) * 1000;
- if (fsync_interval < -1000)
- {
- fprintf(stderr, _("%s: invalid fsync interval \"%s\"\n"),
- progname, optarg);
- exit(1);
- }
- break;
case 'v':
verbose++;
break;
@@ -474,6 +464,9 @@ main(int argc, char **argv)
case 2:
do_drop_slot = true;
break;
+ case 3:
+ synchronous = true;
+ break;
default:
/*