osd/PeeringState.cc: don't let num_objects become negative
If num_objects become negative, we may end up incorrectly setting
the PG_STATE_DEGRADED flag. Instead reset num_objects to zero and set
the PG_STATE_INCONSISTENT flag when this happens expecting scrub to fix
the inconsistency.
Fixes: https://tracker.ceph.com/issues/43308
Co-authored-by: David Zafman <dzafman@redhat.com>
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit
54c5eca48ce94dc4a1416836a06203db880c3842)
Conflicts:
src/osd/PeeringState.cc
- file is missing in nautilus; backported the code change manually
to src/osd/PG.cc