]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: clean_up_local should ignore snapped, snapdir objects
authorSage Weil <sage@newdream.net>
Fri, 23 Jul 2010 19:59:11 +0000 (12:59 -0700)
committerSage Weil <sage@newdream.net>
Fri, 23 Jul 2010 22:50:20 +0000 (15:50 -0700)
The snap_trimmer is responsible for removing any/all snap objects.

snapdir only exists if snapped objects exist and head doesn't, so it will
get cleaned up when the snapped object(s) do.

src/osd/ReplicatedPG.cc

index 6e9af16d3801ba7828d887c1f648f76bcb417b60..c46d22878aa773465612dcb09455f1bd756b2601 100644 (file)
@@ -3888,15 +3888,16 @@ void ReplicatedPG::clean_up_local(ObjectStore::Transaction& t)
     // be thorough.
     vector<sobject_t> ls;
     osd->store->collection_list(coll_t::build_pg_coll(info.pgid), ls);
-    if (ls.size() != info.stats.num_objects)
-      dout(10) << " WARNING: " << ls.size() << " != num_objects " << info.stats.num_objects << dendl;
 
-    set<sobject_t> s;
-    
+    set<sobject_t> s;   
     for (vector<sobject_t>::iterator i = ls.begin();
          i != ls.end();
-         i++) 
-      s.insert(*i);
+         i++)
+      if (i->snap == CEPH_NOSNAP)
+       s.insert(*i);
+
+    if (s.size() != info.stats.num_objects)
+      dout(10) << " WARNING: " << s.size() << " != num_objects " << info.stats.num_objects << dendl;
 
     set<sobject_t> did;
     for (list<Log::Entry>::reverse_iterator p = log.log.rbegin();