Re: [PATCH] mon: fix pg state logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Jun 2012, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>
> 
> PGMap->num_pg_by_state is a PG state to number of PG in the state
> mapping. PGMonitor::update_logger wrongly interprets the mapping.

Thanks, applied!
sage


> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
> ---
>  src/mon/PGMonitor.cc |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
> index 97fbb1b..1b0a210 100644
> --- a/src/mon/PGMonitor.cc
> +++ b/src/mon/PGMonitor.cc
> @@ -96,13 +96,13 @@ void PGMonitor::update_logger()
>    for (hash_map<int,int>::iterator p = pg_map.num_pg_by_state.begin();
>         p != pg_map.num_pg_by_state.end();
>         ++p) {
> -    if (p->second & PG_STATE_ACTIVE) {
> -      active++;
> -      if (p->second & PG_STATE_CLEAN)
> -	active_clean++;
> +    if (p->first & PG_STATE_ACTIVE) {
> +      active += p->second;
> +      if (p->first & PG_STATE_CLEAN)
> +	active_clean += p->second;
>      }
> -    if (p->second & PG_STATE_PEERING)
> -      peering++;
> +    if (p->first & PG_STATE_PEERING)
> +      peering += p->second;
>    }
>    mon->cluster_logger->set(l_cluster_num_pg_active_clean, active_clean);
>    mon->cluster_logger->set(l_cluster_num_pg_active, active);
> -- 
> 1.7.10.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux