重建备机时不删除覆盖 postgresql.conf.bak 与 postgresql.conf.guc.bak 文件

This commit is contained in:
laishenghao
2023-06-10 15:20:59 +08:00
parent 3b196063b2
commit 3b07a0cd06
2 changed files with 2 additions and 0 deletions

View File

@ -1433,6 +1433,7 @@ static void DeleteSubDataDir(const char* dirname)
} else if (S_ISREG(st.st_mode)) {
if (strcmp(de->d_name, "postgresql.conf") == 0 || strcmp(de->d_name, "pg_ctl.lock") == 0 ||
strcmp(de->d_name, "postgresql.conf.lock") == 0 || strcmp(de->d_name, "postgresql.conf.bak.old") == 0 ||
strcmp(de->d_name, "postgresql.conf.bak") == 0 || strcmp(de->d_name, "postgresql.conf.guc.bak") == 0 ||
strcmp(de->d_name, "build_completed.start") == 0 || strcmp(de->d_name, "gs_build.pid") == 0 ||
strcmp(de->d_name, "postmaster.opts") == 0 || strcmp(de->d_name, "gaussdb.state") == 0 ||
strcmp(de->d_name, "disc_readonly_test") == 0 || strcmp(de->d_name, ssl_cert_file) == 0 ||

View File

@ -1433,6 +1433,7 @@ static int64 sendDir(const char *path, int basepathlen, bool sizeonly, List *tab
/* For gs_backup, we should not skip these files */
if (strcmp(pathbuf, "./pg_ctl.lock") == 0 || strcmp(pathbuf, "./postgresql.conf.lock") == 0 ||
strcmp(pathbuf, "./postgresql.conf.bak") == 0 || strcmp(pathbuf, "./postgresql.conf") == 0 ||
strcmp(de->d_name, "postgresql.conf.guc.bak") == 0 ||
strcmp(pathbuf, "./postgresql.conf.bak.old") == 0) {
continue;
}