mirror of
https://github.com/ceph/ceph
synced 2025-03-10 02:09:21 +00:00
Merge pull request #36274 from xiexingguo/wip-peer-num-objects
osd/PeeringState: prevent peer's num_objects going negative Reviewed-by: Neha Ojha <nojha@redhat.com> Reviewed-by: yanjun <yan.jun8@zte.com.cn>
This commit is contained in:
commit
48a849299f
@ -3276,7 +3276,8 @@ void PeeringState::update_calc_stats()
|
||||
// Primary should not be in the peer_info, skip if it is.
|
||||
if (peer.first == pg_whoami) continue;
|
||||
int64_t missing = 0;
|
||||
int64_t peer_num_objects = peer.second.stats.stats.sum.num_objects;
|
||||
int64_t peer_num_objects =
|
||||
std::max((int64_t)0, peer.second.stats.stats.sum.num_objects);
|
||||
// Backfill targets always track num_objects accurately
|
||||
// all other peers track missing accurately.
|
||||
if (is_backfill_target(peer.first)) {
|
||||
|
Loading…
Reference in New Issue
Block a user