From d41a1d3d8289d198f8ca07d887fa4040940d125f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 9 Jan 2014 16:04:21 -0800 Subject: [PATCH] osd/ReplicatedPG: update ObjectContext's object_info_t for new hit_set objects 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 --- src/osd/ReplicatedPG.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index d834a3a12bd45..214f48c905e6f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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++; -- 2.39.5