Skip to content

Commit b3f0554

Browse files
committed
Revert "Recursively create tablespace directories if they do not exist but we need them when re-redoing some tablespace related xlogs (e.g. database create with a tablespace) on mirror."
This reverts commit 7a09e80.
1 parent f9588e8 commit b3f0554

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

src/backend/commands/dbcommands.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,6 @@ dbase_redo(XLogReaderState *record)
24382438
xl_dbase_create_rec *xlrec = (xl_dbase_create_rec *) XLogRecGetData(record);
24392439
char *src_path;
24402440
char *dst_path;
2441-
char *parentdir;
24422441
struct stat st;
24432442

24442443
src_path = GetDatabasePath(xlrec->src_db_id, xlrec->src_tablespace_id);
@@ -2458,30 +2457,6 @@ dbase_redo(XLogReaderState *record)
24582457
dst_path)));
24592458
}
24602459

2461-
/*
2462-
* It is possible that the tablespace was later dropped, but we are
2463-
* re-redoing database create before that. In that case,
2464-
* either src_path or dst_path is probably missing here and needs to
2465-
* be created. We create directories here so that copy_dir() won't
2466-
* fail, but do not bother to create the symlink under pg_tblspc
2467-
* if the tablespace is not global/default.
2468-
*/
2469-
if (stat(src_path, &st) != 0 && pg_mkdir_p(src_path, S_IRWXU) != 0)
2470-
{
2471-
ereport(WARNING,
2472-
(errmsg("can not recursively create directory \"%s\"",
2473-
src_path)));
2474-
}
2475-
parentdir = pstrdup(dst_path);
2476-
get_parent_directory(parentdir);
2477-
if (stat(parentdir, &st) != 0 && pg_mkdir_p(parentdir, S_IRWXU) != 0)
2478-
{
2479-
ereport(WARNING,
2480-
(errmsg("can not recursively create directory \"%s\"",
2481-
parentdir)));
2482-
}
2483-
pfree(parentdir);
2484-
24852460
/*
24862461
* Force dirty buffers out to disk, to ensure source database is
24872462
* up-to-date for the copy.

0 commit comments

Comments
 (0)