]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: update snap collections for sub_op_modify log records conditionaly
authorSage Weil <sage@inktank.com>
Mon, 11 Feb 2013 14:23:54 +0000 (06:23 -0800)
committerSage Weil <sage@inktank.com>
Mon, 11 Feb 2013 21:25:12 +0000 (13:25 -0800)
The only remaining caller is sub_op_modify().  If we do have a non-empty
op transaction, we want to do this update, regardless of what we think
last_backfill is (our notion may be not completely in sync with the
primary).  In particular, our last_backfill may be the same object but
a different snapid, but the primary disagrees and is pushing an op
transaction through.

Instead, update the collections if we have a non-empty transaction.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index 5ed13685df0ec87d555fc093ce7acbea80393fbf..bd66e4fe092ba25263b0385a6a26a508111d0e62 100644 (file)
@@ -2736,9 +2736,6 @@ void PG::update_snap_collections(vector<pg_log_entry_t> &log_entries,
   for (vector<pg_log_entry_t>::iterator i = log_entries.begin();
        i != log_entries.end();
        ++i) {
-    // If past backfill line, snap_collections will be updated during push
-    if (i->soid > info.last_backfill)
-      continue;
     if (i->snaps.length() > 0) {
       vector<snapid_t> snaps;
       bufferlist::iterator p = i->snaps.begin();
index 12b84aa515ee8bc68093c7d5457ab28e5a89deab..635fde6cc65066ee8aa70a0000fdd27d46bf8cea 100644 (file)
@@ -4653,7 +4653,13 @@ void ReplicatedPG::sub_op_modify(OpRequestRef op)
       }
       
       info.stats = m->pg_stats;
-      update_snap_collections(log, rm->localt);
+      if (!rm->opt.empty()) {
+       // If the opt is non-empty, we infer we are before
+       // last_backfill (according to the primary, not our
+       // not-quite-accurate value), and should update the
+       // collections now.  Otherwise, we do it later on push.
+       update_snap_collections(log, rm->localt);
+      }
       append_log(log, m->pg_trim_to, rm->localt);
 
       rm->tls.push_back(&rm->localt);