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

Commit0690f8d

Browse files
committed
[PBCKP-602] Added saving full size for non data files.
1 parentd672166 commit0690f8d

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

‎src/data.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,8 @@ backup_non_data_file(pgFile *file, pgFile *prev_file,
815815
if (EQ_TRADITIONAL_CRC32(file->crc,prev_file->crc))
816816
{
817817
file->write_size=BYTES_INVALID;
818+
/* get full size from previous backup for unchanged file */
819+
file->uncompressed_size=prev_file->uncompressed_size;
818820
return;/* ...skip copying file. */
819821
}
820822
}

‎tests/backup_test.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,3 +3606,36 @@ def test_regress_issue_585(self):
36063606

36073607
output=self.restore_node(backup_dir,'node',node)
36083608
self.assertNotRegex(output,r'WARNING: [^\n]* was stored as .* but looks like')
3609+
3610+
deftest_2_delta_backups(self):
3611+
"""https://github.com/postgrespro/pg_probackup/issues/596"""
3612+
node=self.make_simple_node('node',
3613+
initdb_params=['--data-checksums'])
3614+
3615+
backup_dir=os.path.join(self.tmp_path,self.module_name,self.fname,'backup')
3616+
3617+
self.init_pb(backup_dir)
3618+
self.add_instance(backup_dir,'node',node)
3619+
# self.set_archiving(backup_dir, 'node', node)
3620+
node.slow_start()
3621+
3622+
# FULL
3623+
full_backup_id=self.backup_node(backup_dir,'node',node,options=["--stream"])
3624+
3625+
# delta backup mode
3626+
delta_backup_id1=self.backup_node(
3627+
backup_dir,'node',node,backup_type="delta",options=["--stream"])
3628+
3629+
delta_backup_id2=self.backup_node(
3630+
backup_dir,'node',node,backup_type="delta",options=["--stream"])
3631+
3632+
# postgresql.conf and pg_hba.conf shouldn't be copied
3633+
conf_file=os.path.join(backup_dir,'backups','node',delta_backup_id1,'database','postgresql.conf')
3634+
self.assertFalse(
3635+
os.path.exists(conf_file),
3636+
"File should not exist: {0}".format(conf_file))
3637+
conf_file=os.path.join(backup_dir,'backups','node',delta_backup_id2,'database','postgresql.conf')
3638+
print(conf_file)
3639+
self.assertFalse(
3640+
os.path.exists(conf_file),
3641+
"File should not exist: {0}".format(conf_file))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp