]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Call EnableFileDeletions with false as argument
authorIgor Canadi <icanadi@fb.com>
Tue, 20 May 2014 21:28:51 +0000 (14:28 -0700)
committerIgor Canadi <icanadi@fb.com>
Tue, 20 May 2014 21:28:51 +0000 (14:28 -0700)
db/db_filesnapshot.cc
include/rocksdb/db.h
utilities/backupable/backupable_db.cc

index 1e1ec9757092867cfdcb14f176baa00b7305de7a..582355ccdf7679da6b19a4d9846c01440885bb13 100644 (file)
@@ -29,8 +29,11 @@ Status DBImpl::DisableFileDeletions() {
   MutexLock l(&mutex_);
   ++disable_delete_obsolete_files_;
   if (disable_delete_obsolete_files_ == 1) {
-    // if not, it has already been disabled, so don't log anything
     Log(options_.info_log, "File Deletions Disabled");
+  } else {
+    Log(options_.info_log,
+        "File Deletions Disabled, but already disabled. Counter: %d",
+        disable_delete_obsolete_files_);
   }
   return Status::OK();
 }
@@ -50,6 +53,10 @@ Status DBImpl::EnableFileDeletions(bool force) {
       Log(options_.info_log, "File Deletions Enabled");
       should_purge_files = true;
       FindObsoleteFiles(deletion_state, true);
+    } else {
+      Log(options_.info_log,
+          "File Deletions Enable, but not really enabled. Counter: %d",
+          disable_delete_obsolete_files_);
     }
   }
   if (should_purge_files)  {
index e743b4c888830cae438b201645260047b0db7f22..33b443f40747d6ac2404399e2c4e480584b4b506 100644 (file)
@@ -396,7 +396,7 @@ class DB {
   // times have the same effect as calling it once.
   virtual Status DisableFileDeletions() = 0;
 
-  // Allow compactions to delete obselete files.
+  // Allow compactions to delete obsolete files.
   // If force == true, the call to EnableFileDeletions() will guarantee that
   // file deletions are enabled after the call, even if DisableFileDeletions()
   // was called multiple times before.
index 87901e0efa3f6cabe585d4a272540931b294b136..3ac1d90a1adef90b97d3e56c02ec594bd8989e99 100644 (file)
@@ -426,7 +426,7 @@ Status BackupEngineImpl::CreateNewBackup(DB* db, bool flush_before_backup) {
     s = db->GetSortedWalFiles(live_wal_files);
   }
   if (!s.ok()) {
-    db->EnableFileDeletions();
+    db->EnableFileDeletions(false);
     return s;
   }
 
@@ -495,7 +495,7 @@ Status BackupEngineImpl::CreateNewBackup(DB* db, bool flush_before_backup) {
   }
 
   // we copied all the files, enable file deletions
-  db->EnableFileDeletions();
+  db->EnableFileDeletions(false);
 
   if (s.ok()) {
     // move tmp private backup to real backup folder