# Odd record count when adding new nodes to cluster

**URL:** <https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127>\
**Category:** Operations\
**Created:** [July 3, 2016, 8:04pm UTC](https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127 "2016-07-03T20:04:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Cukier](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/daniel_cukier/32/428_2.png) [@Daniel\_Cukier](https://discuss.aerospike.com/u/Daniel_Cukier)\
**Post date:** [July 3, 2016, 8:04pm UTC](https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127/1 "2016-07-03T20:04:58Z")

</div>

I have an Aerospike Cluster v3.8.4 - I don’t understand how the numbers of master / replica objects works.

My 7 nodes cluster had 18M master objects and 36M replicas (replication factor of 3).

When I just added 6 new nodes to the cluster, the number of master objects dropped to 16M and replica objects dropped to 1M. I noticed from the application that no objects were actually lost, and the cluster is increasing the number of objects over time, without any write to it, which I suppose it is re-creating the master and replicas.

Why this is so confusing?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [July 3, 2016, 8:42pm UTC](https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127/2 "2016-07-03T20:42:18Z")

</div>

Object counts during migrations is a common source of confusion. Basically the counts are underestimates during migration. Partitions that haven’t reached their final state are not counted

The “object-refs” (iirc the name) counts the number of object references held, the index always holds one for each object and various transactions will also take a ref. This can be used as an over estimate (especially during migration).

---

<div class="post-metadata">

**Author:** ![Daniel\_Cukier](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/daniel_cukier/32/428_2.png) [@Daniel\_Cukier](https://discuss.aerospike.com/u/Daniel_Cukier)\
**Post date:** [July 3, 2016, 9:07pm UTC](https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127/3 "2016-07-03T21:07:32Z")

</div>

What do you mean by “object-refs”? What is “iirc the name”? Is there any way to know exactly how many objects I have in the database? Is there any chance to loose when I add new nodes? I noticed rare events of NullPointerException in my application, which suggests some old existing objects may have disappeared.

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [July 4, 2016, 2:28am UTC](https://discuss.aerospike.com/t/odd-record-count-when-adding-new-nodes-to-cluster/3127/4 "2016-07-04T02:28:47Z")

</div>

Looks like I didn’t [recall correctly](https://www.google.com/search?q=iirc), the correct metric name is [record-refs](http://www.aerospike.com/docs/reference/metrics#record_refs).

> Is there any way to know exactly how many objects I have in the database?

If there were an efficient way to compute the exact number during rebalance, we would simply provide that instead of an approximate value.

> Is there any chance to loose when I add new nodes?

Data loss is not expected when adding nodes.

> I noticed rare events of NullPointerException in my application, which suggests some old existing objects may have disappeared.

The server does provides error codes, cannot really determine much from a NullPointerException. Could these be timeouts? Rebalance will cause some additional latency to transactions.
