mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
pg_basebackup: Try to fix some failures on Windows.
Commit ffd53659c4
messed up the
mechanism that was being used to pass parameters to LogStreamerMain()
on Windows. It worked on Linux because only Windows was using threads.
Repair by moving the additional parameters added by that commit into
the 'logstreamer_param' struct.
Along the way, fix a compiler warning on builds without HAVE_LIBZ.
Discussion: http://postgr.es/m/CA+TgmoY5=AmWOtMj3v+cySP2rR=Bt6EGyF_joAq4CfczMddKtw@mail.gmail.com
This commit is contained in:
@ -61,8 +61,6 @@ const bbsink_ops bbsink_gzip_ops = {
|
||||
bbsink *
|
||||
bbsink_gzip_new(bbsink *next, bc_specification *compress)
|
||||
{
|
||||
int compresslevel;
|
||||
|
||||
#ifndef HAVE_LIBZ
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
@ -70,6 +68,7 @@ bbsink_gzip_new(bbsink *next, bc_specification *compress)
|
||||
return NULL; /* keep compiler quiet */
|
||||
#else
|
||||
bbsink_gzip *sink;
|
||||
int compresslevel;
|
||||
|
||||
Assert(next != NULL);
|
||||
|
||||
|
@ -541,12 +541,12 @@ typedef struct
|
||||
char xlog[MAXPGPATH]; /* directory or tarfile depending on mode */
|
||||
char *sysidentifier;
|
||||
int timeline;
|
||||
WalCompressionMethod wal_compress_method;
|
||||
int wal_compress_level;
|
||||
} logstreamer_param;
|
||||
|
||||
static int
|
||||
LogStreamerMain(logstreamer_param *param,
|
||||
WalCompressionMethod wal_compress_method,
|
||||
int wal_compress_level)
|
||||
LogStreamerMain(logstreamer_param *param)
|
||||
{
|
||||
StreamCtl stream;
|
||||
|
||||
@ -575,8 +575,8 @@ LogStreamerMain(logstreamer_param *param,
|
||||
stream.do_sync);
|
||||
else
|
||||
stream.walmethod = CreateWalTarMethod(param->xlog,
|
||||
wal_compress_method,
|
||||
wal_compress_level,
|
||||
param->wal_compress_method,
|
||||
param->wal_compress_level,
|
||||
stream.do_sync);
|
||||
|
||||
if (!ReceiveXlogStream(param->bgconn, &stream))
|
||||
@ -634,6 +634,8 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier,
|
||||
param = pg_malloc0(sizeof(logstreamer_param));
|
||||
param->timeline = timeline;
|
||||
param->sysidentifier = sysidentifier;
|
||||
param->wal_compress_method = wal_compress_method;
|
||||
param->wal_compress_level = wal_compress_level;
|
||||
|
||||
/* Convert the starting position */
|
||||
if (sscanf(startpos, "%X/%X", &hi, &lo) != 2)
|
||||
@ -724,7 +726,7 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier,
|
||||
int ret;
|
||||
|
||||
/* in child process */
|
||||
ret = LogStreamerMain(param, wal_compress_method, wal_compress_level);
|
||||
ret = LogStreamerMain(param);
|
||||
|
||||
/* temp debugging aid to analyze 019_replslot_limit failures */
|
||||
if (verbose)
|
||||
|
Reference in New Issue
Block a user