]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: update ObjectContext's object_info_t for new hit_set objects
authorSage Weil <sage@inktank.com>
Fri, 10 Jan 2014 00:04:21 +0000 (16:04 -0800)
committerSage Weil <sage@inktank.com>
Tue, 14 Jan 2014 00:19:49 +0000 (16:19 -0800)
We were fabricating an object_info_t correctly and writing it to disk, but
it was not reflected by the in-memory ObjectContext.  If something came
along quickly (like backfill) and tried to use it, the info would be
invalid.

Fix this by fabricating it in the obc and copying it to the new_obs for
the update.

Fixes: #7122
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc

index d834a3a12bd45c3aa712db2121d63d2296479a32..214f48c905e6fe87b3d3f5b69131da6feae26320 100644 (file)
@@ -9786,10 +9786,12 @@ void ReplicatedPG::hit_set_persist()
   }
 
   // fabricate an object_info_t and SnapSet
-  ctx->new_obs.oi.version = ctx->at_version;
-  ctx->new_obs.oi.mtime = now;
-  ctx->new_obs.oi.size = bl.length();
-  ctx->new_obs.exists = true;
+  obc->obs.oi.version = ctx->at_version;
+  obc->obs.oi.mtime = now;
+  obc->obs.oi.size = bl.length();
+  obc->obs.exists = true;
+
+  ctx->new_obs = obc->obs;
   ctx->new_snapset.head_exists = true;
 
   ctx->delta_stats.num_objects++;