!288 修复gs_basebackup和gs_probackup相关问题

Merge pull request !288 from yukai_k/master
This commit is contained in:
opengauss-bot
2020-10-09 10:52:49 +08:00
committed by Gitee
3 changed files with 9 additions and 1 deletions

View File

@ -586,6 +586,8 @@ bool ReceiveXlogStream(PGconn* conn, XLogRecPtr startpos, uint32 timeline, const
PQclear(res);
}
fprintf(stderr, "%100s", "");
fprintf(stderr, "\r");
pg_log(PG_PROGRESS, _(" check identify system success\n"));
/* Initiate the replication stream at specified location */
@ -605,6 +607,8 @@ bool ReceiveXlogStream(PGconn* conn, XLogRecPtr startpos, uint32 timeline, const
}
PQclear(res);
fprintf(stderr, "%100s", "");
fprintf(stderr, "\r");
pg_log(PG_PROGRESS, _(" send %s success\n"), query);
/* Set the last reply timestamp */
last_recv_timestamp = localGetCurrentTimestamp();
@ -729,6 +733,8 @@ bool ReceiveXlogStream(PGconn* conn, XLogRecPtr startpos, uint32 timeline, const
pg_log(PG_WARNING, _(" keepalive message is incorrect size: %d\n"), r);
goto error;
}
fprintf(stderr, "%100s", "");
fprintf(stderr, "\r");
pg_log(PG_PRINT, _(" keepalive message is received\n"));
/* copy the received buffer to keepalive */
ret = memcpy_s(&keepalive, sizeof(PrimaryKeepaliveMessage), copybuf + 1, sizeof(PrimaryKeepaliveMessage));

View File

@ -24,7 +24,7 @@ do_init(void)
int results;
results = pg_check_dir(backup_path);
if (results == 4) /* exists and not empty*/
if (results == 2) /* exists and not empty*/
elog(ERROR, "backup catalog already exist and it's not empty");
else if (results == -1) /*trouble accessing directory*/
{

View File

@ -12402,6 +12402,7 @@ XLogRecPtr do_pg_start_backup(const char* backupidstr, bool fast, char** labelfi
}
pfree(labelfbuf.data);
#ifdef ENABLE_MULTIPLE_NODES
/* Write backup tablespace_map file. */
if (tblspc_mapfbuf.len > 0) {
if (stat(TABLESPACE_MAP, &stat_buf) != 0) {
@ -12425,6 +12426,7 @@ XLogRecPtr do_pg_start_backup(const char* backupidstr, bool fast, char** labelfi
ereport(
ERROR, (errcode_for_file_access(), errmsg("could not write file \"%s\": %m", TABLESPACE_MAP)));
}
#endif
pfree(tblspc_mapfbuf.data);
} else {
*labelfile = labelfbuf.data;