]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: fix cleanup of pgmeta-like objects on PG deletion
authorSage Weil <sage@redhat.com>
Thu, 18 Jul 2019 16:09:47 +0000 (11:09 -0500)
committerSage Weil <sage@redhat.com>
Thu, 18 Jul 2019 16:09:47 +0000 (11:09 -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>
(cherry picked from commit a0f48db5cbfc48761eeac0daa259fecbaa573969)

# Conflicts:
# src/osd/PG.cc
- location of this code is do_delete_work in master, _delete_some in n

src/osd/PG.cc

index e54827611cadeff277d69de62feaf85e8dbf77c8..a62c904ed84370ab48661e10a0ef253daa87ff43 100644 (file)
@@ -7014,9 +7014,13 @@ void PG::_delete_some(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();