Repository navigation
Conversation
|
add yourself in Authors @Shgit29 |
| *backups = NULL; | ||
|
|
||
| pgmoneta_get_directories(directory, &number_of_dirs, &dirs); | ||
| if (pgmoneta_get_directories(directory, &number_of_dirs, &dirs)) |
There was a problem hiding this comment.
This fails for a server that doesn't have a backup yet. Something like
if (!pgmoneta_exists(directory))
{
return 0;
}
|
|
||
| backup_dir = pgmoneta_get_server_backup(PRIMARY_SERVER); | ||
| MCTF_ASSERT_PTR_NONNULL(backup_dir, cleanup); | ||
| MCTF_ASSERT_INT_EQ(pgmoneta_mkdir(backup_dir), 0, cleanup); |
There was a problem hiding this comment.
Remove. The test was correct - no backup directory means no backups
| MCTF_ASSERT_INT_EQ(pgmoneta_load_infos(missing, &count, &backups), 1, cleanup); | ||
| MCTF_ASSERT_INT_EQ(count, 0, cleanup); |
|
@Shgit29 A missing backup directory isn't an error, it is created by the first backup. With this change a server without backups fails list-backup, verify, keep, delete and so on Only fail when the directory exists and can't be read |
1b89851 to
e78caa6
Compare
|
@ecleon26 Thanks for clarifying. I overlooked that the backup directory is only created during the first backup. I've updated the implementation to distinguish a missing directory from an actual scan failure, reverted the changes to the original WAL test, corrected the missing-directory assertion, and updated AUTHORS and the acknowledgement file. All 18 relevant test cases pass. |
|
@Shgit29 Please, rebase |
Fixes #1770.
A failed catalog scan does not establish that there are no backups. Treating it as an empty catalog lets WAL cleanup proceed without knowing which WAL existing backups still need. Cleanup should stop on that error; a successfully scanned empty catalog should retain its existing behavior.
Validation against upstream
9a83b075:delete_wal(5 tests) andbackup_identifier(4 tests) pass on both versions using isolated private-configuration fixtures.These are isolated filesystem/function-level tests; the full PostgreSQL integration suite was not run. No production backups or real PostgreSQL WAL were used. The changes have been personally understood and tested before submission.