]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: note wal releases in fsck
authorSage Weil <sage@redhat.com>
Tue, 22 Dec 2015 17:45:58 +0000 (12:45 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:22 +0000 (13:07 -0500)
Include these in used_blocks (they are about to be released but
not reflected in the onode).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 0f0a2851e5500b6515d39646970ee7ff370a35d7..90ffcd49c1aed9ae13410eaea29b8b3434a233b9 100644 (file)
@@ -1948,6 +1948,27 @@ int BlueStore::fsck()
     }
   }
 
+  dout(1) << __func__ << " checking wal events" << dendl;
+  {
+    it = db->get_iterator(PREFIX_WAL);
+    for (it->lower_bound(string()); it->valid(); it->next()) {
+      bufferlist bl = it->value();
+      bufferlist::iterator p = bl.begin();
+      bluestore_wal_transaction_t wt;
+      try {
+       ::decode(wt, p);
+      } catch (buffer::error& e) {
+       derr << __func__ << " failed to decode wal txn "
+            << pretty_binary_string(it->key()) << dendl;
+       return -EIO;
+      }
+      dout(20) << __func__ << "  wal " << wt.seq
+              << " ops " << wt.ops.size()
+              << " released " << wt.released << dendl;
+      used_blocks.insert(wt.released);
+    }
+  }
+
   dout(1) << __func__ << " checking freelist vs allocated" << dendl;
   {
     const map<uint64_t,uint64_t>& free = fm->get_freelist();