]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: adjust pending_attrs correctly in copy_from 1417/head
authorSamuel Just <sam.just@inktank.com>
Sun, 9 Mar 2014 18:43:57 +0000 (11:43 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 10 Mar 2014 23:03:37 +0000 (16:03 -0700)
Otherwise, subsequent reads might not get the correct cached attrs.

Fixes: #7663
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 2d8d60bf13cc83ad816b80bd3b6badb7ebd878e1..8040cb4db4d33d9d6688a365886910d702412d95 100644 (file)
@@ -5537,10 +5537,12 @@ void ReplicatedPG::_write_copy_chunk(CopyOpRef cop, PGBackend::PGTransaction *t)
     t->touch(cop->results.temp_oid);
     for (map<string,bufferlist>::iterator p = cop->attrs.begin();
         p != cop->attrs.end();
-        ++p)
+        ++p) {
+      cop->results.attrs[string("_") + p->first] = p->second;
       t->setattr(
        cop->results.temp_oid,
        string("_") + p->first, p->second);
+    }
     cop->attrs.clear();
   }
   if (!cop->temp_cursor.data_complete) {
@@ -5620,6 +5622,7 @@ void ReplicatedPG::finish_copyfrom(OpContext *ctx)
       }
     }
     ctx->mod_desc.create();
+    replace_cached_attrs(ctx, ctx->obc, cb->results->attrs);
   } else {
     if (obs.exists) {
       ctx->op_t->remove(obs.oi.soid);
index 969a094e74c9c33ba2161586526301291f679d74..1c9bf24db414c7b7243d7fc205ef11d3e370f517 100644 (file)
@@ -122,6 +122,7 @@ public:
     snapid_t snap_seq;       ///< src's snap_seq (if head)
     librados::snap_set_t snapset; ///< src snapset (if head)
     bool mirror_snapset;
+    map<string, bufferlist> attrs; ///< src user attrs
     CopyResults() : object_size(0), started_temp_obj(false),
                    user_version(0), should_requeue(false),
                    mirror_snapset(false) {}