]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: fix cleanup of pgmeta-like objects on PG deletion
authorSage Weil <sage@redhat.com>
Thu, 2 May 2019 16:28:14 +0000 (11:28 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 May 2019 02:14:17 +0000 (21:14 -0500)
If an object has an empty 'name' field, it "looks" like a pgmeta object,
and the PG cleanup code was skipping it.  However, we were letting these
objects get created.

Fix by only skipping *our* pgmeta object.  If there are other pgmeta-like
objects in the PG collection, clean them up.

Fixes: https://tracker.ceph.com/issues/38724
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc

index ba6d8730c11ff5acf4d5d0fa7eb4a11061f47c36..27107add21032874f9e88cc0d2052b02eb524a46 100644 (file)
@@ -3806,9 +3806,13 @@ void PG::do_delete_work(ObjectStore::Transaction *t)
   OSDriver::OSTransaction _t(osdriver.get_transaction(t));
   int64_t num = 0;
   for (auto& oid : olist) {
-    if (oid.is_pgmeta()) {
+    if (oid == pgmeta_oid) {
       continue;
     }
+    if (oid.is_pgmeta()) {
+      osd->clog->warn() << info.pgid << " found stray pgmeta-like " << oid
+                       << " during PG removal";
+    }
     int r = snap_mapper.remove_oid(oid.hobj, &_t);
     if (r != 0 && r != -ENOENT) {
       ceph_abort();