]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: add omap_header to recovery
authorSamuel Just <samuel.just@dreamhost.com>
Fri, 2 Mar 2012 19:12:56 +0000 (11:12 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Tue, 6 Mar 2012 19:44:36 +0000 (11:44 -0800)
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/messages/MOSDSubOp.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 0fc18b6644e02a5381b61b5ef1cde397da7813dd..a92449a930950f6b2dee70419e4d273bfe743cf5 100644 (file)
@@ -25,7 +25,7 @@
 
 class MOSDSubOp : public Message {
 
-  static const int HEAD_VERSION = 5;
+  static const int HEAD_VERSION = 6;
   static const int COMPAT_VERSION = 1;
 
 public:
@@ -81,6 +81,7 @@ public:
   ObjectRecoveryProgress current_progress;
 
   map<string,bufferlist> omap_entries;
+  bufferlist omap_header;
 
   virtual void decode_payload() {
     bufferlist::iterator p = payload.begin();
@@ -130,6 +131,8 @@ public:
     }
     if (header.version >= 5)
       ::decode(omap_entries, p);
+    if (header.version >= 6)
+      ::decode(omap_header, p);
   }
 
   virtual void encode_payload(uint64_t features) {
@@ -173,6 +176,7 @@ public:
     ::encode(recovery_progress, payload);
     ::encode(current_progress, payload);
     ::encode(omap_entries, payload);
+    ::encode(omap_header, payload);
   }
 
   MOSDSubOp()
index 6a329e271b9d3117929219168b153ffd633b2691..618b14a15389dab13131ec68b51bd413db6a6380 100644 (file)
@@ -4352,6 +4352,7 @@ void ReplicatedPG::submit_push_data(
   bool first,
   const interval_set<uint64_t> &intervals_included,
   bufferlist data_included,
+  bufferlist omap_header,
   map<string, bufferptr> &attrs,
   map<string, bufferlist> &omap_entries,
   ObjectStore::Transaction *t)
@@ -4359,6 +4360,7 @@ void ReplicatedPG::submit_push_data(
   if (first) {
     t->remove(coll_t::TEMP_COLL, recovery_info.soid);
     t->touch(coll_t::TEMP_COLL, recovery_info.soid);
+    t->omap_setheader(coll_t::TEMP_COLL, recovery_info.soid, omap_header);
   }
   uint64_t off = 0;
   for (interval_set<uint64_t>::const_iterator p = intervals_included.begin();
@@ -4529,7 +4531,9 @@ void ReplicatedPG::handle_pull_response(OpRequest *op)
   Context *onreadable = 0;
   Context *onreadable_sync = 0;
   submit_push_data(pi.recovery_info, first,
-                  data_included, data, m->attrset,
+                  data_included, data,
+                  m->omap_header,
+                  m->attrset,
                   m->omap_entries,
                   t);
 
@@ -4600,6 +4604,7 @@ void ReplicatedPG::handle_push(OpRequest *op)
                   first,
                   m->data_included,
                   data,
+                  m->omap_header,
                   m->attrset,
                   m->omap_entries,
                   t);
@@ -4647,6 +4652,7 @@ int ReplicatedPG::send_push(int peer,
   subop->ops[0].op.op = CEPH_OSD_OP_PUSH;
 
   if (progress.first) {
+    osd->store->omap_get_header(coll, recovery_info.soid, &subop->omap_header);
     osd->store->getattrs(coll, recovery_info.soid, subop->attrset);
 
     // Debug
index 7531840203689ee32276ecc0da6ccbe0136d59a8..e418d4712327ff41c53cd7a312cd3c988cc5e667 100644 (file)
@@ -580,6 +580,7 @@ protected:
                        bool first,
                        const interval_set<uint64_t> &intervals_included,
                        bufferlist data_included,
+                       bufferlist omap_header,
                        map<string, bufferptr> &attrs,
                        map<string, bufferlist> &omap_entries,
                        ObjectStore::Transaction *t);