Search code examples
aerospike

aerospike: delete all record in a set


I am using aerospike for testing. I am using community edition.The cluster has 2 nodes. I am using storage engine as device with SSD. My config file -

namespace test {
        replication-factor 2
        memory-size 16G
        default-ttl 0 

       storage-engine device {
                device /dev/sdb1
                data-in-memory false
                write-block-size 128K   
        }
}

I have set named data. After adding 1M record in it for testing ,now i want to delete everything in this set (if possible drop set too). I tried this command on both node-

asinfo -v "set-config:context=namespace;id=test;set=data;set-delete=true;"

It worked until i restarted my cluster (sudo /etc/init.d/aerospike restart on both node). After restart all data came back. I went through this link http://www.aerospike.com/launchpad/deleting_sets_and_data.html but doesn't find anything convenient.


Solution

  • EDIT copy pasted from @sasha's comment:

    Aerospike 3.10.0 introduces [durable deletes][1] mechanism that adds the persistence to the deletion (only for Aerospike Enterprise though). It's implemented by so called Tombstone records written as the last version of the record being deleted. It guarantees no deleted record got into memory on cold start (read from disk). Then the defragmentation process eventually runs and frees memory and disk space from all the record versions including tombstone. [1]: aerospike.com/docs/guide/durable_deletes.html