]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PeeringState: don't zero backfill target num_bytes on activation
authorsjust@redhat.com <sjust@redhat.com>
Mon, 22 Apr 2019 21:07:06 +0000 (14:07 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:29 +0000 (11:22 -0700)
834d3c19a774f1cc93903447d91d182776e12d18 preserves num_bytes
on backfill targets in order to estimate space required to complete
backill.  However, from activation until backfill reservation,
info.stats.stats.sum.num_bytes is persisted to disk as 0 messing
up future intervals.  Instead, preserve it in the info sent during
recovery and leave it alone in RequestBackfillPrio.

Additionally, it's possible for backfill to be preempted between
last_backfill=MAX being sent to the replica and Backfilled being
queued occuring.  In that case, the stats get on reservation
and the replica ends up with invalid stats.

Fixes: https://tracker.ceph.com/issues/39401
Signed-off-by: sjust@redhat.com <sjust@redhat.com>
src/osd/PeeringState.cc

index f87dadc968e330a9f6a93eadd99c0fffd24fc110..013ed49b3a79419f590341602cd6fbac58bc7e2b 100644 (file)
@@ -2261,6 +2261,7 @@ void PeeringState::activate(
         // Save num_bytes for reservation request, can't be negative
         peer_bytes[peer] = std::max<int64_t>(0, pi.stats.stats.sum.num_bytes);
         pi.stats.stats.clear();
+        pi.stats.stats.sum.num_bytes = peer_bytes[peer];
 
        // initialize peer with our purged_snaps.
        pi.purged_snaps = info.purged_snaps;
@@ -4781,9 +4782,6 @@ PeeringState::RepNotRecovering::react(const RequestBackfillPrio &evt)
        evt.primary_num_bytes, evt.local_num_bytes)) {
     post_event(RejectRemoteReservation());
   } else {
-    // Use un-ec-adjusted bytes for stats.
-    ps->info.stats.stats.sum.num_bytes = evt.local_num_bytes;
-
     PGPeeringEventRef preempt;
     if (HAVE_FEATURE(ps->upacting_features, RECOVERY_RESERVATION_2)) {
       // older peers will interpret preemption as TOOFULL