Deleted records get resurrected after a restart


#1

I am using node.js client. First I retrieve unique keys of all records in a table. I then loop through each record and issue

    var key = {
      ns:  'CRM;,
      set: 'visit',
      key: row.id
    };
       
    client.remove(key, function(err){
           if(err==0) console.log('removed');
    }

This shows successful delete.

in AQL select shows 0 rows :

aql> select * from CRM.visit
0 rows in set (0.073 secs)

Then I restart the service:

[vagrant@localhost ~]$ sudo service aerospike restart
Stopping aerospike:                                        [  OK  ]
Starting and checking aerospike:                           [  OK  ]

go back to AQL and

aql> select * from CRM.visit

This time, there’s 15 records, the same ones that were deleted.

Is there something that isn’t being committed? How can I avoid this behavior? Is there some commit function?


#2

Deletes only remove the data from the primary index which exists in RAM (shared memory on enterprise). When you restart a node and it cannot reconnect to its previous primary index then it will need to rebuild the index from disk.

This issue is discussed here: How is data deleted?.


#3

Saw the link of someone having the same issue, not seeing a solution to it. So it appears that there’s no actual way to delete records then from the Aerospike in Community Edition?