This is an automated email from the ASF dual-hosted git repository. reshke pushed a commit to branch fix_for_db_records in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit bcded44536f818f99f7b8ede190966629e61da12 Author: reshke <[email protected]> AuthorDate: Sat Feb 21 21:23:18 2026 +0000 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 7a09e80d498dbcb90e954519e3a6cd826569b14a. --- src/backend/commands/dbcommands.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 48caa782464..f93f969d168 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -2438,7 +2438,6 @@ dbase_redo(XLogReaderState *record) xl_dbase_create_rec *xlrec = (xl_dbase_create_rec *) XLogRecGetData(record); char *src_path; char *dst_path; - char *parentdir; struct stat st; src_path = GetDatabasePath(xlrec->src_db_id, xlrec->src_tablespace_id); @@ -2458,30 +2457,6 @@ dbase_redo(XLogReaderState *record) dst_path))); } - /* - * It is possible that the tablespace was later dropped, but we are - * re-redoing database create before that. In that case, - * either src_path or dst_path is probably missing here and needs to - * be created. We create directories here so that copy_dir() won't - * fail, but do not bother to create the symlink under pg_tblspc - * if the tablespace is not global/default. - */ - if (stat(src_path, &st) != 0 && pg_mkdir_p(src_path, S_IRWXU) != 0) - { - ereport(WARNING, - (errmsg("can not recursively create directory \"%s\"", - src_path))); - } - parentdir = pstrdup(dst_path); - get_parent_directory(parentdir); - if (stat(parentdir, &st) != 0 && pg_mkdir_p(parentdir, S_IRWXU) != 0) - { - ereport(WARNING, - (errmsg("can not recursively create directory \"%s\"", - parentdir))); - } - pfree(parentdir); - /* * Force dirty buffers out to disk, to ensure source database is * up-to-date for the copy. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
