From e8f997ca597761087c46ad6657aebe7c73a45e38 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Wed, 27 Nov 2019 15:05:32 -0800 Subject: [PATCH] Update comment on max_valid_backups_to_open (#6105) Summary: To reflect changes in PR https://github.com/facebook/rocksdb/issues/6072 This comment also implies that a seemingly valid use-case for max_valid_backups_to_open is flawed: even if you only want to add a new backup without trying to delete, you might need to clean up after a backup creation that never finished. To clean up properly requires opening all backups to get proper ref counts on shared files. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6105 Test Plan: code comment only Differential Revision: D18736716 Pulled By: pdillinger fbshipit-source-id: 2447c0000eefe3a4ca606926bfe922a8456b0cb7 --- include/rocksdb/utilities/backupable_db.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/rocksdb/utilities/backupable_db.h b/include/rocksdb/utilities/backupable_db.h index afff2c2ac..ff1dd1c3f 100644 --- a/include/rocksdb/utilities/backupable_db.h +++ b/include/rocksdb/utilities/backupable_db.h @@ -104,13 +104,13 @@ struct BackupableDBOptions { // Default: 4194304 uint64_t callback_trigger_interval_size; - // When Open() is called, it will open at most this many of the latest - // non-corrupted backups. + // For BackupEngineReadOnly, Open() will open at most this many of the + // latest non-corrupted backups. // - // Note setting this to a non-default value prevents old files from being - // deleted in the shared directory, as we can't do proper ref-counting. If - // using this option, make sure to occasionally disable it (by resetting to - // INT_MAX) and run GarbageCollect to clean accumulated stale files. + // Note: this setting is ignored (behaves like INT_MAX) for any kind of + // writable BackupEngine because it would inhibit accounting for shared + // files for proper backup deletion, including purging any incompletely + // created backups on creation of a new backup. // // Default: INT_MAX int max_valid_backups_to_open;