]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: kludge sloppy hammer temp objects into temp collection 6188/head
authorSage Weil <sage@redhat.com>
Wed, 7 Oct 2015 15:49:01 +0000 (11:49 -0400)
committerSage Weil <sage@redhat.com>
Wed, 7 Oct 2015 15:49:25 +0000 (11:49 -0400)
When we are running with a mixed hammer cluster, hammer primaries
will generate temp object names that are sloppy.  Make sure we still
put them into the temp collection.

Note that this isn't a problem on write because the primary (hammer)
OSD generated the transaction and explicitly specified a temp
collection; it's only transactions we do on our own with the sloppy
temp ghobject_t that trip over this.

Fixes: #13395
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.h

index 2de2440d6fae1bb74c92d0b9a20a5a31f07ce183..2a04da2ac1aa2637c0fa563d518f06b67f343664 100644 (file)
@@ -141,7 +141,10 @@ private:
   int init_index(coll_t c);
 
   void _kludge_temp_object_collection(coll_t& cid, const ghobject_t& oid) {
-    if (oid.hobj.pool < -1 && !cid.is_temp())
+    // - normal temp case: cid is pg, object is temp (pool < -1)
+    // - hammer temp case: cid is pg (or already temp), object pool is -1
+    if (cid.is_pg() && (oid.hobj.pool < -1 ||
+                       oid.hobj.pool == -1))
       cid = cid.get_temp();
   }
   void init_temp_collections();