Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue 188#222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gsmolk merged 3 commits intopostgrespro:masterfromkuzmindb:issue_188
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletionssrc/validate.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,6 +120,13 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
return;
}

if (strcmp(backup->server_version, PG_MAJORVERSION) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

server_version is aint variable, you need aserver_version_str

{
elog(ERROR, "Backup was made with server version %s, but pg_probackup compiled "
"with server version %s.",
backup->server_version, PG_MAJORVERSION);
}

//if (params && params->partial_db_list)
//dbOid_exclude_list = get_dbOid_exclude_list(backup, files, params->partial_db_list,
//params->partial_restore_type);
Expand Down
54 changes: 54 additions & 0 deletionstests/validate.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3728,3 +3728,57 @@ def test_partial_validate_include(self):
# 716 if (read_len != MAXALIGN(header.compressed_size))
# -> 717 elog(ERROR, "cannot read block %u of \"%s\" read %lu of %d",
# 718 blknum, file->path, read_len, header.compressed_size);


# @unittest.skip("skip")
def test_not_validate_diffenent_pg_version(self):
"""Do not validate backup, if binary is compiled with different PG version"""
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()

backup_id = self.backup_node(backup_dir, 'node', node)

control_file = os.path.join(
backup_dir, "backups", "node", backup_id,
"backup.control")

pg_version = node.major_version

if pg_version.is_integer():
pg_version = int(pg_version)

fake_new_pg_version = pg_version + 1

with open(control_file, 'r') as f:
data = f.read();

data = data.replace(str(pg_version), str(fake_new_pg_version))

with open(control_file, 'w') as f:
f.write(data);

try:
self.validate_pb(backup_dir)
self.assertEqual(
1, 0,
"Expecting Error because validation is forbidden if server version of backup "
"is different from the server version of pg_probackup.\n Output: {0} \n CMD: {1}".format(
repr(self.output), self.cmd))
except ProbackupException as e:
self.assertIn(
"ERROR: Backup was made with server version",
e.message,
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))

# Clean after yourself
self.del_test_dir(module_name, fname)


[8]ページ先頭

©2009-2025 Movatter.jp