aa63abf698
Summary: Only if there is a crash, power failure, or I/O error in DeleteBackup, shared or private files from the backup might be left behind that are not cleaned up by PurgeOldBackups or DeleteBackup-- only by GarbageCollect. This makes the BackupEngine API "leaky by default." Even if it means a modest performance hit, I think we should make Delete and Purge do as they say, with ongoing best effort: i.e. future calls will attempt to finish any incomplete work from earlier calls. This change does that by having DeleteBackup and PurgeOldBackups do a GarbageCollect, unless (to minimize performance hit) this BackupEngine has already done a GarbageCollect and there have been no deletion-related I/O errors in that GarbageCollect or since then. Rejected alternative 1: remove meta file last instead of first. This would in theory turn partially deleted backups into corrupted backups, but code changes would be needed to allow the missing files and consider it acceptably corrupt, rather than failing to open the BackupEngine. This might be a reasonable choice, but I mostly rejected it because it doesn't solve the legacy problem of cleaning up existing lingering files. Rejected alternative 2: use a deletion marker file. If deletion started with creating a file that marks a backup as flagged for deletion, then we could reliably detect partially deleted backups and efficiently finish removing them. In addition to not solving the legacy problem, this could be precarious if there's a disk full situation, and we try to create a new file in order to delete some files. Ugh. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6015 Test Plan: Updated unit tests Differential Revision: D18401333 Pulled By: pdillinger fbshipit-source-id: 12944e372ce6809f3f5a4c416c3b321a8927d925 |
||
---|---|---|
.. | ||
utilities | ||
advanced_options.h | ||
c.h | ||
cache.h | ||
cleanable.h | ||
compaction_filter.h | ||
compaction_job_stats.h | ||
comparator.h | ||
concurrent_task_limiter.h | ||
convenience.h | ||
db_bench_tool.h | ||
db_dump_tool.h | ||
db_stress_tool.h | ||
db.h | ||
env_encryption.h | ||
env.h | ||
experimental.h | ||
filter_policy.h | ||
flush_block_policy.h | ||
iostats_context.h | ||
iterator.h | ||
ldb_tool.h | ||
listener.h | ||
memory_allocator.h | ||
memtablerep.h | ||
merge_operator.h | ||
metadata.h | ||
options.h | ||
perf_context.h | ||
perf_level.h | ||
persistent_cache.h | ||
rate_limiter.h | ||
slice_transform.h | ||
slice.h | ||
snapshot.h | ||
sst_dump_tool.h | ||
sst_file_manager.h | ||
sst_file_reader.h | ||
sst_file_writer.h | ||
statistics.h | ||
stats_history.h | ||
status.h | ||
table_properties.h | ||
table.h | ||
thread_status.h | ||
threadpool.h | ||
trace_reader_writer.h | ||
transaction_log.h | ||
types.h | ||
universal_compaction.h | ||
version.h | ||
wal_filter.h | ||
write_batch_base.h | ||
write_batch.h | ||
write_buffer_manager.h |