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

Commit202b56b

Browse files
committed
Remove unnecessary Windows-specific basebackup code.
Commitc6f2f01 added an explicit check for a Windows "junction point".That turned out to be needed only because get_dirent_type() was bustedon Windows. It's been fixed by commit9d3444d, so remove it.Add a TAP-test to demonstrate that in-place tablespaces are copied bypg_basebackup. This exercises the codepath that would fail beforec6f2f01 on Windows, and shows that it still doesn't fail now that we'reusing get_dirent_type() on both Windows and Unix.Back-patch to 15, where in-place tablespaces arrived and caused thisproblem (ie directories where previously only symlinks were expected).Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/CA%2BhUKGLzLK4PUPx0_AwXEWXOYAejU%3D7XpxnYE55Y%2Be7hB2N3FA%40mail.gmail.com
1 parent6d306ab commit202b56b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8294,13 +8294,8 @@ do_pg_backup_start(const char *backupidstr, bool fast, TimeLineID *starttli_p,
82948294
* we sometimes use allow_in_place_tablespaces to create
82958295
* directories directly under pg_tblspc, which would fail below.
82968296
*/
8297-
#ifdefWIN32
8298-
if (!pgwin32_is_junction(fullpath))
8299-
continue;
8300-
#else
83018297
if (get_dirent_type(fullpath,de, false,ERROR)!=PGFILETYPE_LNK)
83028298
continue;
8303-
#endif
83048299

83058300
#if defined(HAVE_READLINK)|| defined(WIN32)
83068301
rllen=readlink(fullpath,linkpath,sizeof(linkpath));

‎src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,4 +904,21 @@
904904
'background process exit message');
905905
$sigchld_bb->finish();
906906

907+
# Test that we can back up an in-place tablespace
908+
$node->safe_psql('postgres',
909+
"SET allow_in_place_tablespaces = on; CREATE TABLESPACE tblspc2 LOCATION '';");
910+
$node->safe_psql('postgres',
911+
"CREATE TABLE test2 (a int) TABLESPACE tblspc2;"
912+
."INSERT INTO test2 VALUES (1234);");
913+
my$tblspc_oid =$node->safe_psql('postgres',
914+
"SELECT oid FROM pg_tablespace WHERE spcname = 'tblspc2';");
915+
$node->backup('backup3');
916+
$node->safe_psql('postgres',"DROP TABLE test2;");
917+
$node->safe_psql('postgres',"DROP TABLESPACE tblspc2;");
918+
919+
# check that the in-place tablespace exists in the backup
920+
$backupdir =$node->backup_dir .'/backup3';
921+
my@dst_tblspc =glob"$backupdir/pg_tblspc/$tblspc_oid/PG_*";
922+
is(@dst_tblspc, 1,'tblspc directory copied');
923+
907924
done_testing();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp