Why the number of objects after coldstart may be less than before

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

Scenario:

Before you coldstart Aerospike, you checked in AQL under show sets to look at your records. After coldstart Aerospike, you look up the records again and it’s now reflecting a different total. You’re now wondering why your total number of records changed.

Reason:

The reason why is during the time you shutdown, eviction was not caught up. During coldstart, eviction is forced to catch up. What you end up seeing is the additional records evicted is the difference you’re seeing.

Do note, when Aerospike is rebuilding the index, in addition to the way defrag works. You will encounter some of the records multiple times, which may lead to multiple evictions. You will also encounter some records that were previously evicted but were not below the eviction depth, which are not automatically skipped.