]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: adjust snap collection memberships during pg split
authorSage Weil <sage@newdream.net>
Fri, 8 May 2009 04:42:19 +0000 (21:42 -0700)
committerSage Weil <sage@newdream.net>
Fri, 8 May 2009 04:49:17 +0000 (21:49 -0700)
src/osd/OSD.cc

index 68edca94907dfd4e321facecf0c3fe780e6e792a..0ec1f69a3a32e869a4007c487e5bc18a639fdbaa 100644 (file)
@@ -2479,8 +2479,19 @@ void OSD::split_pg(PG *parent, map<pg_t,PG*>& children, ObjectStore::Transaction
       } else {
        dout(25) << "    not tagging pg with v " << oi.version << " <= " << child->info.last_update << dendl;
       }
+
       t.collection_add(pgid.to_coll(), parentid.to_coll(), poid);
       t.collection_remove(parentid.to_coll(), poid);
+      if (oi.snaps.size()) {
+       snapid_t first = oi.snaps[0];
+       t.collection_add(pgid.to_snap_coll(first), parentid.to_coll(), poid);
+       t.collection_remove(parentid.to_snap_coll(first), poid);
+       if (oi.snaps.size() > 1) {
+         snapid_t last = oi.snaps[oi.snaps.size()-1];
+         t.collection_add(pgid.to_snap_coll(last), parentid.to_coll(), poid);
+         t.collection_remove(parentid.to_snap_coll(last), poid);
+       }
+      }
 
       // add to child stats
       child->info.stats.num_bytes += st.st_size;