]> 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)
committerSamuel Just <sam.just@inktank.com>
Tue, 19 Mar 2013 17:30:21 +0000 (10:30 -0700)
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>
(cherry picked from commit 31e911b63d326bdd06981ec4029ad71b7479ed70)

src/osd/PG.cc
src/osd/ReplicatedPG.cc

index 1d90399b28cd0d1f34836301f60c97cc767ce413..23f1623d7fea4f836101e5d13ded70c0e882bb94 100644 (file)
@@ -2912,9 +2912,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 3e75fe2c7dca42ad91ac270228d4b014ac35df22..5a27ea4a8ae14bb38d78acb5fe7a8c38d42170a2 100644 (file)
@@ -4661,7 +4661,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);