You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-17 07:22:20 +02:00
Merge branch 'master' into release_2_5
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
`pg_probackup` is a utility to manage backup and recovery of PostgreSQL database clusters. It is designed to perform periodic backups of the PostgreSQL instance that enable you to restore the server in case of a failure.
|
||||
|
||||
The utility is compatible with:
|
||||
* PostgreSQL 9.5, 9.6, 10, 11, 12, 13;
|
||||
* PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14;
|
||||
|
||||
As compared to other backup solutions, `pg_probackup` offers the following benefits that can help you implement different backup strategies and deal with large amounts of data:
|
||||
* Incremental backup: page-level incremental backup allows you to save disk space, speed up backup and restore. With three different incremental modes, you can plan the backup strategy in accordance with your data flow.
|
||||
@ -41,9 +41,9 @@ Regardless of the chosen backup type, all backups taken with `pg_probackup` supp
|
||||
## ptrack support
|
||||
|
||||
`PTRACK` backup support provided via following options:
|
||||
* vanilla PostgreSQL 12,13 with [ptrack extension](https://github.com/postgrespro/ptrack)
|
||||
* Postgres Pro Standard 9.6, 10, 11, 12
|
||||
* Postgres Pro Enterprise 9.6, 10, 11, 12
|
||||
* vanilla PostgreSQL 11, 12, 13, 14 with [ptrack extension](https://github.com/postgrespro/ptrack)
|
||||
* Postgres Pro Standard 9.6, 10, 11, 12, 13
|
||||
* Postgres Pro Enterprise 9.6, 10, 11, 12, 13
|
||||
|
||||
## Limitations
|
||||
|
||||
|
@ -699,7 +699,7 @@ pgdata_basic_setup(ConnectionOptions conn_opt, PGNodeInfo *nodeInfo)
|
||||
elog(WARNING, "Current PostgreSQL role is superuser. "
|
||||
"It is not recommended to run backup or checkdb as superuser.");
|
||||
|
||||
StrNCpy(current.server_version, nodeInfo->server_version_str,
|
||||
strlcpy(current.server_version, nodeInfo->server_version_str,
|
||||
sizeof(current.server_version));
|
||||
|
||||
return cur_conn;
|
||||
@ -735,7 +735,7 @@ do_backup(InstanceState *instanceState, pgSetBackupParams *set_backup_params,
|
||||
current.status = BACKUP_STATUS_RUNNING;
|
||||
current.start_time = current.backup_id;
|
||||
|
||||
StrNCpy(current.program_version, PROGRAM_VERSION,
|
||||
strlcpy(current.program_version, PROGRAM_VERSION,
|
||||
sizeof(current.program_version));
|
||||
|
||||
current.compress_alg = instance_config.compress_alg;
|
||||
|
@ -2761,14 +2761,14 @@ readBackupControlFile(const char *path)
|
||||
|
||||
if (program_version)
|
||||
{
|
||||
StrNCpy(backup->program_version, program_version,
|
||||
strlcpy(backup->program_version, program_version,
|
||||
sizeof(backup->program_version));
|
||||
pfree(program_version);
|
||||
}
|
||||
|
||||
if (server_version)
|
||||
{
|
||||
StrNCpy(backup->server_version, server_version,
|
||||
strlcpy(backup->server_version, server_version,
|
||||
sizeof(backup->server_version));
|
||||
pfree(server_version);
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ merge_chain(InstanceState *instanceState,
|
||||
* We cannot set backup status to OK just yet,
|
||||
* because it still has old start_time.
|
||||
*/
|
||||
StrNCpy(full_backup->program_version, PROGRAM_VERSION,
|
||||
strlcpy(full_backup->program_version, PROGRAM_VERSION,
|
||||
sizeof(full_backup->program_version));
|
||||
full_backup->parent_backup = INVALID_BACKUP_ID;
|
||||
full_backup->start_lsn = dest_backup->start_lsn;
|
||||
|
@ -1798,6 +1798,18 @@ extractPageInfo(XLogReaderState *record, XLogReaderData *reader_data,
|
||||
* source system.
|
||||
*/
|
||||
}
|
||||
else if (rmid == RM_XACT_ID &&
|
||||
((rminfo & XLOG_XACT_OPMASK) == XLOG_XACT_COMMIT ||
|
||||
(rminfo & XLOG_XACT_OPMASK) == XLOG_XACT_COMMIT_PREPARED ||
|
||||
(rminfo & XLOG_XACT_OPMASK) == XLOG_XACT_ABORT ||
|
||||
(rminfo & XLOG_XACT_OPMASK) == XLOG_XACT_ABORT_PREPARED))
|
||||
{
|
||||
/*
|
||||
* These records can include "dropped rels". We can safely ignore
|
||||
* them, we will see that they are missing and copy them from the
|
||||
* source.
|
||||
*/
|
||||
}
|
||||
else if (info & XLR_SPECIAL_REL_UPDATE)
|
||||
{
|
||||
/*
|
||||
|
@ -551,7 +551,7 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
|
||||
time2iso(row->recovery_time, lengthof(row->recovery_time),
|
||||
backup->recovery_time, false);
|
||||
else
|
||||
StrNCpy(row->recovery_time, "----", sizeof(row->recovery_time));
|
||||
strlcpy(row->recovery_time, "----", sizeof(row->recovery_time));
|
||||
widths[cur] = Max(widths[cur], strlen(row->recovery_time));
|
||||
cur++;
|
||||
|
||||
@ -586,7 +586,7 @@ show_instance_plain(const char *instance_name, parray *backup_list, bool show_na
|
||||
pretty_time_interval(difftime(backup->end_time, backup->start_time),
|
||||
row->duration, lengthof(row->duration));
|
||||
else
|
||||
StrNCpy(row->duration, "----", sizeof(row->duration));
|
||||
strlcpy(row->duration, "----", sizeof(row->duration));
|
||||
widths[cur] = Max(widths[cur], strlen(row->duration));
|
||||
cur++;
|
||||
|
||||
|
@ -16,6 +16,10 @@
|
||||
#include "libpq/pqsignal.h"
|
||||
#include "pqexpbuffer.h"
|
||||
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
#include "common/string.h"
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "pgut.h"
|
||||
@ -75,7 +79,16 @@ prompt_for_password(const char *username)
|
||||
password = NULL;
|
||||
}
|
||||
|
||||
#if PG_VERSION_NUM >= 100000
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
if (username == NULL)
|
||||
password = simple_prompt("Password: ", false);
|
||||
else
|
||||
{
|
||||
char message[256];
|
||||
snprintf(message, lengthof(message), "Password for user %s: ", username);
|
||||
password = simple_prompt(message , false);
|
||||
}
|
||||
#elif PG_VERSION_NUM >= 100000
|
||||
password = (char *) pgut_malloc(sizeof(char) * 100 + 1);
|
||||
if (username == NULL)
|
||||
simple_prompt("Password: ", password, 100, false);
|
||||
|
@ -139,6 +139,10 @@ def slow_start(self, replica=False):
|
||||
except testgres.QueryException as e:
|
||||
if 'database system is starting up' in e.message:
|
||||
pass
|
||||
elif 'FATAL: the database system is not accepting connections' in e.message:
|
||||
pass
|
||||
elif replica and 'Hot standby mode is disabled' in e.message:
|
||||
raise e
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
Reference in New Issue
Block a user