osd: Reduce the amount of status invalidations when rolling shards forwards during peering
Currently stats invalidations happen during peering when rolling forward shards.
We can reduce this so we only invalidate the stats when we don't have any other shards at the version we want to roll the stats forwards to.
In the cases where we have a shard with the stats at the correct version, we use those stats instead of invalidating.
If we do not have any shards with the correct version of stats, we do the invalidate as before.
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
(cherry picked from commit
b5cad2694569b7f0eef173f87a7eecb2ddd6b27e)