]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop unused+inefficient support for pg[n]ls at a specific snapid 13398/head
authorSage Weil <sage@redhat.com>
Mon, 13 Feb 2017 16:55:53 +0000 (11:55 -0500)
committerSage Weil <sage@redhat.com>
Mon, 13 Feb 2017 16:55:53 +0000 (11:55 -0500)
This was super slow, and Objecter was incapable of generating the requests
to use it.

To do this properly we should create a new listing op that returns the
set of clones and/or snaps for each object as part of a single listing
result.  If/when the need arises.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index 006f5d5fd13c40ecf64db86b295abef639a45c13..f001fc34822460f45bb66c92c4c5ecfa98dacd31 100644 (file)
@@ -1066,6 +1066,10 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
       // fall through
 
     case CEPH_OSD_OP_PGNLS:
+      if (snapid != CEPH_NOSNAP) {
+       result = -EINVAL;
+       break;
+      }
       if (get_osdmap()->raw_pg_to_pg(m->get_pg()) != info.pgid.pgid) {
         dout(10) << " pgnls pg=" << m->get_pg()
                 << " " << get_osdmap()->raw_pg_to_pg(m->get_pg())
@@ -1115,8 +1119,6 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
          break;
        }
 
-       assert(snapid == CEPH_NOSNAP || pg_log.get_missing().get_items().empty());
-
        map<hobject_t, pg_missing_item>::const_iterator missing_iter =
          pg_log.get_missing().get_items().lower_bound(current);
        vector<hobject_t>::iterator ls_iter = sentries.begin();
@@ -1164,32 +1166,9 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
          if (candidate.snap == CEPH_SNAPDIR)
            continue;
 
-         if (candidate.snap < snapid)
+         if (candidate.snap != CEPH_NOSNAP)
            continue;
 
-         if (snapid != CEPH_NOSNAP) {
-           bufferlist bl;
-           if (candidate.snap == CEPH_NOSNAP) {
-             pgbackend->objects_get_attr(
-               candidate,
-               SS_ATTR,
-               &bl);
-             SnapSet snapset(bl);
-             if (snapid <= snapset.seq)
-               continue;
-           } else {
-             bufferlist attr_bl;
-             pgbackend->objects_get_attr(
-               candidate, OI_ATTR, &attr_bl);
-             object_info_t oi(attr_bl);
-             vector<snapid_t>::iterator i = find(oi.snaps.begin(),
-                                                 oi.snaps.end(),
-                                                 snapid);
-             if (i == oi.snaps.end())
-               continue;
-           }
-         }
-
          // skip internal namespace
          if (candidate.get_namespace() == cct->_conf->osd_hit_set_namespace)
            continue;
@@ -1258,6 +1237,10 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
       // fall through
 
     case CEPH_OSD_OP_PGLS:
+      if (snapid != CEPH_NOSNAP) {
+       result = -EINVAL;
+       break;
+      }
       if (get_osdmap()->raw_pg_to_pg(m->get_pg()) != info.pgid.pgid) {
         dout(10) << " pgls pg=" << m->get_pg()
                 << " " << get_osdmap()->raw_pg_to_pg(m->get_pg())
@@ -1339,32 +1322,9 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
          if (candidate.snap == CEPH_SNAPDIR)
            continue;
 
-         if (candidate.snap < snapid)
+         if (candidate.snap != CEPH_NOSNAP)
            continue;
 
-         if (snapid != CEPH_NOSNAP) {
-           bufferlist bl;
-           if (candidate.snap == CEPH_NOSNAP) {
-             pgbackend->objects_get_attr(
-               candidate,
-               SS_ATTR,
-               &bl);
-             SnapSet snapset(bl);
-             if (snapid <= snapset.seq)
-               continue;
-           } else {
-             bufferlist attr_bl;
-             pgbackend->objects_get_attr(
-               candidate, OI_ATTR, &attr_bl);
-             object_info_t oi(attr_bl);
-             vector<snapid_t>::iterator i = find(oi.snaps.begin(),
-                                                 oi.snaps.end(),
-                                                 snapid);
-             if (i == oi.snaps.end())
-               continue;
-           }
-         }
-
          // skip wrong namespace
          if (candidate.get_namespace() != m->get_object_locator().nspace)
            continue;