]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: do not update stats in ReplicaActive from info
authorSamuel Just <sam.just@inktank.com>
Fri, 31 Aug 2012 21:01:47 +0000 (14:01 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 31 Aug 2012 21:43:48 +0000 (14:43 -0700)
Bug #2954

Consider the following case:

1) Primary calls share_pg_info()
2) Primary processes client op and sends off sub_op to replica
3) Replica process sub_op
4) Replica process info reverting stat to before 2)

Similarly:

1) Primary processes client op
2) Primary calls share_pg_info()
3) Replica processes info
[4) Replica processes sub_op]

If 4) is interrupted by a map change, we can end up in a case there
the replica's info has a stat which reflects a log entry which
is not there.  If that logs ends up authoratative, the most recent
op will be replayed and end up double counted in the log.

There should actually be no cases where the stats change after the
replica goes active except for as part of a sub_op_modify.  Thus,
ReplicaActive::MInfoRec should not update the stats.

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

index 849dca4c38874c1fd40666aae071feb555fcf4f5..256b7243601f12b170fc7e9e1a78b5f64a38ede1 100644 (file)
@@ -3923,11 +3923,6 @@ void PG::proc_primary_info(ObjectStore::Transaction &t, const pg_info_t &oinfo)
 {
   assert(!is_primary());
 
-  if (info.last_backfill.is_max()) {
-    info.stats = oinfo.stats;
-    dirty_info = true;
-  }
-
   osd->unreg_last_pg_scrub(info.pgid, info.history.last_scrub_stamp);
   if (info.history.merge(oinfo.history))
     dirty_info = true;