backup_total
bigint
- Total amount of data that will be streamed. If progress reporting
- is not enabled in
pg_basebackup
- (i.e., --progress option is not specified),
- this is 0 . Otherwise, this is estimated and
+ Total amount of data that will be streamed. This is estimated and
reported as of the beginning of
streaming database files phase. Note that
this is only an approximation since the database
and WAL log may be included in the backup later. This is always
the same value as backup_streamed
once the amount of data streamed exceeds the estimated
- total size.
+ total size. If the estimation is disabled in
+ (i.e., --no-estimate-size option is specified),
+ this is 0 .
|
in this case the estimated target size will increase once it passes the
total estimate without WAL.
- When this is enabled, the backup will start by enumerating the size of
- the entire database, and then go back and send the actual contents.
- This may make the backup take slightly longer, and in particular it
- will take longer before the first data is sent.
-
- Whether this is enabled or not, the
- pg_stat_progress_basebackup view
- report the progress of the backup in the server side. But note
- that the total amount of data that will be streamed is estimated
- and reported only when this option is enabled. In other words,
- backup_total column in the view always
- indicates 0 if this option is disabled.
-
+
+
+ --no-estimate-size
+
+ This option prevents the server from estimating the total
+ amount of backup data that will be streamed, resulting in the
+ backup_total column in the
+ pg_stat_progress_basebackup
+ to be 0 .
+
+ Without this option, the backup will start by enumerating
+ the size of the entire database, and then go back and send
+ the actual contents. This may make the backup take slightly
+ longer, and in particular it will take longer before the first
+ data is sent. This option is useful to avoid such estimation
+ time if it's too long.
+
+ This option is not allowed when using --progress .
+
+
+
static bool noclean = false;
static bool checksum_failure = false;
static bool showprogress = false;
+static bool estimatesize = true;
static int verbose = 0;
static int compresslevel = 0;
static IncludeWal includewal = STREAM_WAL;
printf(_(" --no-slot prevent creation of temporary replication slot\n"));
printf(_(" --no-verify-checksums\n"
" do not verify checksums\n"));
+ printf(_(" --no-estimate-size do not estimate backup size in server side\n"));
printf(_(" -?, --help show this help, then exit\n"));
printf(_("\nConnection options:\n"));
printf(_(" -d, --dbname=CONNSTR connection string\n"));
basebkp =
psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s %s",
escaped_label,
- showprogress ? "PROGRESS" : "",
+ estimatesize ? "PROGRESS" : "",
includewal == FETCH_WAL ? "WAL" : "",
fastcheckpoint ? "FAST" : "",
includewal == NO_WAL ? "" : "NOWAIT",
{"waldir", required_argument, NULL, 1},
{"no-slot", no_argument, NULL, 2},
{"no-verify-checksums", no_argument, NULL, 3},
+ {"no-estimate-size", no_argument, NULL, 4},
{NULL, 0, NULL, 0}
};
int c;
case 3:
verify_checksums = false;
break;
+ case 4:
+ estimatesize = false;
+ break;
default:
/*
}
#endif
+ if (showprogress && !estimatesize)
+ {
+ pg_log_error("--progress and --no-estimate-size are incompatible options");
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
+ progname);
+ exit(1);
+ }
+
/* connection in replication mode to server */
conn = GetConnection();
if (!conn)