Details
Description
Seeing incorrect active_resident ratio on some nodes in a cluster.
The web UI shows 0 percent active resident ratio, while ep-engine shows 83 %, which is the correct value.
- added screenshot from UI.
Stats from node -
[root@grape-004 ~]# /opt/couchbase/bin/cbstats localhost:11210 -b default all | grep resident
ep_num_non_resident: 850006
ep_tap_backfill_resident: 0.9
vb_active_num_non_resident: 122506
vb_active_perc_mem_resident: 83
vb_pending_num_non_resident: 0
vb_pending_perc_mem_resident: 0
vb_replica_num_non_resident: 727500
vb_replica_perc_mem_resident: 0
The current ns_server code shows the following calculation for the "active resident ratio" and it seems to be hitting the exception
In menalus_stats.erl:
ResidenceCalculator = fun (NonResident, Total) ->
try (Total - NonResident) * 100 / Total
catch error:badarith -> 0
end
It looks like there is an exception being thrown in Alk's calculation which causes the result to be 0.