Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9310729

Browse files
committed
Traverse 'global' directory in snapshot recovery
1 parent 736a105 commit 9310729

File tree

1 file changed

+3
-2
lines changed
  • src/backend/storage/file

1 file changed

+3
-2
lines changed

src/backend/storage/file/fd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,6 +3843,7 @@ static void
38433843
walk_data_dir(void (*action) (const char *fname, bool isdir, int elevel), int elevel)
38443844
{
38453845
walkdir("base", action, false, elevel);
3846+
walkdir("global", action, false, elevel);
38463847
walkdir("pg_tblspc", action, true, elevel);
38473848
}
38483849

@@ -3895,15 +3896,15 @@ sfs_recover_snapshot_file(const char *fname, bool isdir, int elevel)
38953896
{
38963897
SnapshotId snap_id;
38973898

3898-
/* Copy saved pages from snapshots files following or equal specified snapshot */
3899+
/* Copy saved pages from snapshot files following or equal specified snapshot */
38993900
for (snap_id = ControlFile->recent_snapshot; snap_id >= sfs_current_snapshot; snap_id--)
39003901
{
39013902
char* snap_file = psprintf("%s.snap.%d", fname, snap_id);
39023903
struct stat statbuf;
39033904

39043905
if (stat(snap_file, &statbuf) == 0 && S_ISREG(statbuf.st_mode))
39053906
{
3906-
File file = PathNameOpenFile(fname, O_RDWR);
3907+
File file = PathNameOpenFile(fname, O_RDWR|O_CREAT|PG_BINARY);
39073908
Vfd* vfdP = &VfdCache[file];
39083909
int i;
39093910

0 commit comments

Comments
 (0)