]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MOSDMap: reencode full map embedded in Incremental, as needed
authorSage Weil <sage@newdream.net>
Tue, 25 Oct 2011 17:51:21 +0000 (10:51 -0700)
committerSage Weil <sage@newdream.net>
Tue, 25 Oct 2011 17:51:21 +0000 (10:51 -0700)
The Incremental may have a bufferlist containing a full map; reencode
that too if we are reencoding for old clients.

Signed-off-by: Sage Weil <sage@newdream.net>
src/messages/MOSDMap.h

index 1a956a44b6e299f67da38ee1e4ce54af5dd629ad..a7ff30858ecea76f5e813032f92b9780451f2046 100644 (file)
@@ -93,6 +93,13 @@ public:
        bufferlist::iterator q = p->second.begin();
        inc.decode(q);
        p->second.clear();
+       if (inc.fullmap.length()) {
+         // embedded full map?
+         OSDMap m;
+         m.decode(inc.fullmap);
+         inc.fullmap.clear();
+         m.encode(inc.fullmap, connection->get_features());
+       }
        inc.encode(p->second, connection->get_features());
       }
       for (map<epoch_t,bufferlist>::iterator p = maps.begin();