diff --git a/doc/xml/release.xml b/doc/xml/release.xml index a9a61bc0..0089d222 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -67,6 +67,16 @@ + + + + + + + +

Skip pg_internal.init temp file during backup.

+
+ @@ -8039,6 +8049,11 @@ mibiio + + Michael Paquier + michaelpq + + Michael Renner terrorobe diff --git a/src/info/manifest.c b/src/info/manifest.c index a5662fd6..1eae49af 100644 --- a/src/info/manifest.c +++ b/src/info/manifest.c @@ -579,8 +579,13 @@ manifestBuildCallback(void *data, const StorageInfo *info) strPtr(manifestName)); } - // Skip pg_internal.init since it is recreated on startup - if (strEqZ(info->name, PG_FILE_PGINTERNALINIT)) + // Skip pg_internal.init since it is recreated on startup. It's also possible, (though unlikely) that a temp file with + // the creating process id as the extension can exist so skip that as well. This seems to be a bug in PostgreSQL since + // the temp file should be removed on startup. Use regExpMatchOne() here instead of preparing a regexp in advance since + // the likelihood of needing the regexp should be very small. + if ((pgVersion <= PG_VERSION_84 || buildData.dbPath) && strBeginsWithZ(info->name, PG_FILE_PGINTERNALINIT) && + (strSize(info->name) == sizeof(PG_FILE_PGINTERNALINIT) - 1 || + regExpMatchOne(STRDEF("\\.[0-9]+"), strSub(info->name, sizeof(PG_FILE_PGINTERNALINIT) - 1)))) { FUNCTION_TEST_RETURN_VOID(); return; diff --git a/test/src/module/info/manifestTest.c b/test/src/module/info/manifestTest.c index 684905d1..9d945152 100644 --- a/test/src/module/info/manifestTest.c +++ b/test/src/module/info/manifestTest.c @@ -252,6 +252,10 @@ testRun(void) // global directory storagePathCreateP(storagePgWrite, STRDEF(PG_PATH_GLOBAL), .mode = 0700, .noParentCreate = true); storagePutP(storageNewWriteP(storagePgWrite, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGINTERNALINIT)), NULL); + storagePutP(storageNewWriteP(storagePgWrite, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGINTERNALINIT ".1")), NULL); + storagePutP( + storageNewWriteP(storagePgWrite, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGINTERNALINIT ".allow"), .modeFile = 0400, + .timeModified = 1565282114), NULL); storagePutP( storageNewWriteP(storagePgWrite, STRDEF(PG_PATH_GLOBAL "/t1_1"), .modeFile = 0400, .timeModified = 1565282114), NULL); @@ -282,6 +286,7 @@ testRun(void) "\n" "[target:file]\n" "pg_data/PG_VERSION={\"size\":4,\"timestamp\":1565282100}\n" + "pg_data/global/pg_internal.init.allow={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/global/t1_1={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_notify/BOGUS={\"size\":0,\"timestamp\":1565282102}\n" @@ -419,6 +424,7 @@ testRun(void) "pg_data/base/1/t1_1.1={\"size\":0,\"timestamp\":1565282113}\n" "pg_data/base/1/t8888888_8888888_vm={\"size\":0,\"timestamp\":1565282113}\n" "pg_data/base/1/t8888888_8888888_vm.999999={\"size\":0,\"timestamp\":1565282113}\n" + "pg_data/global/pg_internal.init.allow={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/global/t1_1={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_dynshmem/BOGUS={\"master\":true,\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"master\":true,\"size\":9,\"timestamp\":1565282117}\n" @@ -537,6 +543,7 @@ testRun(void) "pg_data/base/1/555_init.1={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" + "pg_data/global/pg_internal.init.allow={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" "pg_data/pg_replslot/BOGUS={\"size\":0,\"timestamp\":1565282103}\n" @@ -625,6 +632,7 @@ testRun(void) "pg_data/base/1/555_init={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_init.1={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" + "pg_data/global/pg_internal.init.allow={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" "pg_data/pg_replslot/BOGUS={\"size\":0,\"timestamp\":1565282103}\n" @@ -705,6 +713,7 @@ testRun(void) "pg_data/base/1/555_init={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_init.1={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" + "pg_data/global/pg_internal.init.allow={\"master\":false,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" "pg_data/pg_replslot/BOGUS={\"size\":0,\"timestamp\":1565282103}\n" @@ -852,6 +861,7 @@ testRun(void) "pg_data/base/1/PG_VERSION={\"size\":0,\"timestamp\":1565282120}\n" "pg_data/base/1/pg_filenode.map={\"size\":0,\"timestamp\":1565282120}\n" "pg_data/global/pg_control={\"master\":true,\"size\":0,\"timestamp\":1565282101}\n" + "pg_data/global/pg_internal.init.allow={\"checksum-page\":true,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/pg_clog/BOGUS={\"size\":0,\"timestamp\":1565282121}\n" "pg_data/pg_hba.conf={\"master\":true,\"size\":9,\"timestamp\":1565282117}\n" "pg_data/pg_multixact/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" @@ -903,6 +913,7 @@ testRun(void) storageRemoveP(storageTest, STRDEF("pg/pg_tblspc/2"), .errorOnMissing = true); storagePathRemoveP(storageTest, STRDEF("ts/2"), .recurse = true); + storageRemoveP(storagePgWrite, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGINTERNALINIT ".allow"), .errorOnMissing = true); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("manifest with all features - 12, online");