Skip to content

Commit cd918be

Browse files
kulaginmgsmolk
authored andcommitted
Ugly fix (set missing_ok = true)
Previously, the return code was not checked when deleting files. Now, in order for the tests to work out, you need to ignore the missing files. This fix for tests: tests.retention.RetentionTest.test_window_merge_interleaved_incremental_chains_1 tests.retention.RetentionTest.test_window_chains tests.merge.MergeTest.test_smart_merge tests.merge.MergeTest.test_merge_tablespaces tests.merge.MergeTest.test_merge_pg_filenode_map tests.merge.MergeTest.test_failed_merge_after_delete_3 tests.merge.MergeTest.test_failed_merge_after_delete tests.merge.MergeTest.test_crash_after_opening_backup_control_2
1 parent c6b6441 commit cd918be

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ cleanup_tablespace(const char *path)
16761676

16771677
join_path_components(fullpath, path, file->rel_path);
16781678

1679-
if (fio_remove(FIO_DB_HOST, fullpath, false) == 0)
1679+
if (fio_remove(FIO_DB_HOST, fullpath, true) == 0)
16801680
elog(VERBOSE, "Deleted file \"%s\"", fullpath);
16811681
else
16821682
elog(ERROR, "Cannot delete file or directory \"%s\": %s", fullpath, strerror(errno));

src/merge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ merge_chain(InstanceState *instanceState,
798798
/* We need full path, file object has relative path */
799799
join_path_components(full_file_path, full_database_dir, full_file->rel_path);
800800

801-
if (fio_remove(FIO_BACKUP_HOST, full_file_path, false) == 0)
801+
if (fio_remove(FIO_BACKUP_HOST, full_file_path, true) == 0)
802802
elog(VERBOSE, "Deleted \"%s\"", full_file_path);
803803
else
804804
elog(ERROR, "Cannot delete file or directory \"%s\": %s", full_file_path, strerror(errno));
@@ -1134,7 +1134,7 @@ remove_dir_with_files(const char *path)
11341134

11351135
join_path_components(full_path, path, file->rel_path);
11361136

1137-
if (fio_remove(FIO_LOCAL_HOST, full_path, false) == 0)
1137+
if (fio_remove(FIO_LOCAL_HOST, full_path, true) == 0)
11381138
elog(VERBOSE, "Deleted \"%s\"", full_path);
11391139
else
11401140
elog(ERROR, "Cannot delete file or directory \"%s\": %s", full_path, strerror(errno));

0 commit comments

Comments
 (0)