mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-07 13:40:17 +02:00
Merge branch 'master' into remote_pull
This commit is contained in:
commit
100899a7f1
@ -182,6 +182,7 @@ sub build_pgprobackup
|
||||
$probackup->AddFile("$pgsrc/src/bin/pg_rewind/datapagemap.c");
|
||||
|
||||
$probackup->AddFile("$pgsrc/src/interfaces/libpq/pthread-win32.c");
|
||||
$probackup->AddFile("$pgsrc/src/timezone/strftime.c");
|
||||
|
||||
$probackup->AddIncludeDir("$pgsrc/src/bin/pg_basebackup");
|
||||
$probackup->AddIncludeDir("$pgsrc/src/bin/pg_rewind");
|
||||
|
@ -561,7 +561,7 @@ backup_data_file(backup_files_arg* arguments,
|
||||
if (file->size % BLCKSZ != 0)
|
||||
{
|
||||
fio_fclose(in);
|
||||
elog(ERROR, "File: %s, invalid file size %zu", file->path, file->size);
|
||||
elog(WARNING, "File: %s, invalid file size %zu", file->path, file->size);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup";
|
||||
const char *PROGRAM_EMAIL = "https://github.com/postgrespro/pg_probackup/issues";
|
||||
const char *PROGRAM_FULL_PATH = NULL;
|
||||
|
||||
typedef enum ProbackupSubcmd
|
||||
{
|
||||
@ -204,6 +205,14 @@ main(int argc, char *argv[])
|
||||
init_config(&instance_config);
|
||||
|
||||
PROGRAM_NAME = get_progname(argv[0]);
|
||||
PROGRAM_FULL_PATH = palloc0(MAXPGPATH);
|
||||
|
||||
if (find_my_exec(argv[0],(char *) PROGRAM_FULL_PATH) < 0)
|
||||
{
|
||||
fprintf(stderr, _("%s: could not find own program executable\n"), PROGRAM_NAME);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
set_pglocale_pgservice(argv[0], "pgscripts");
|
||||
|
||||
#if PG_VERSION_NUM >= 110000
|
||||
|
@ -800,7 +800,7 @@ create_recovery_conf(time_t backup_id,
|
||||
|
||||
fio_fprintf(fp, "restore_command = '%s archive-get -B %s --instance %s "
|
||||
"--wal-file-path %%p --wal-file-name %%f'\n",
|
||||
PROGRAM_NAME, backup_path, instance_name);
|
||||
PROGRAM_FULL_PATH, backup_path, instance_name);
|
||||
|
||||
/*
|
||||
* We've already checked that only one of the four following mutually
|
||||
|
@ -480,7 +480,11 @@ logfile_getname(const char *format, time_t timestamp)
|
||||
len = strlen(filename);
|
||||
|
||||
/* Treat log_filename as a strftime pattern */
|
||||
#ifdef WIN32
|
||||
if (pg_strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
|
||||
#else
|
||||
if (strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
|
||||
#endif
|
||||
elog_stderr(ERROR, "strftime(%s) failed: %s", format, strerror(errno));
|
||||
|
||||
return filename;
|
||||
|
@ -20,6 +20,7 @@ typedef void (*pgut_atexit_callback)(bool fatal, void *userdata);
|
||||
* pgut client variables and functions
|
||||
*/
|
||||
extern const char *PROGRAM_NAME;
|
||||
extern const char *PROGRAM_FULL_PATH;
|
||||
extern const char *PROGRAM_VERSION;
|
||||
extern const char *PROGRAM_URL;
|
||||
extern const char *PROGRAM_EMAIL;
|
||||
|
@ -55,6 +55,38 @@ class DeleteTest(ProbackupTest, unittest.TestCase):
|
||||
# Clean after yourself
|
||||
self.del_test_dir(module_name, fname)
|
||||
|
||||
# @unittest.skip("skip")
|
||||
# @unittest.expectedFailure
|
||||
def test_del_instance_archive(self):
|
||||
"""delete full backups"""
|
||||
fname = self.id().split('.')[3]
|
||||
node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'node'),
|
||||
initdb_params=['--data-checksums'])
|
||||
|
||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||
self.init_pb(backup_dir)
|
||||
self.add_instance(backup_dir, 'node', node)
|
||||
self.set_archiving(backup_dir, 'node', node)
|
||||
node.slow_start()
|
||||
|
||||
# full backup
|
||||
self.backup_node(backup_dir, 'node', node)
|
||||
|
||||
# full backup
|
||||
self.backup_node(backup_dir, 'node', node)
|
||||
|
||||
# restore
|
||||
node.cleanup()
|
||||
self.restore_node(backup_dir, 'node', node)
|
||||
node.slow_start()
|
||||
|
||||
# Delete instance
|
||||
self.del_instance(backup_dir, 'node')
|
||||
|
||||
# Clean after yourself
|
||||
self.del_test_dir(module_name, fname)
|
||||
|
||||
# @unittest.skip("skip")
|
||||
# @unittest.expectedFailure
|
||||
def test_delete_archive_mix_compress_and_non_compressed_segments(self):
|
||||
|
Loading…
Reference in New Issue
Block a user