# Deleted records get resurrected after a restart

**URL:** <https://discuss.aerospike.com/t/deleted-records-get-resurrected-after-a-restart/1510>\
**Category:** Node.js Client\
**Created:** [July 19, 2015, 2:13am UTC](https://discuss.aerospike.com/t/deleted-records-get-resurrected-after-a-restart/1510 "2015-07-19T02:13:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![denisbetsi](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@denisbetsi](https://discuss.aerospike.com/u/denisbetsi)\
**Post date:** [July 19, 2015, 2:13am UTC](https://discuss.aerospike.com/t/deleted-records-get-resurrected-after-a-restart/1510/1 "2015-07-19T02:13:22Z")

</div>

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?

---

<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 20, 2015, 4:58pm UTC](https://discuss.aerospike.com/t/deleted-records-get-resurrected-after-a-restart/1510/2 "2015-07-20T16:58:36Z")

</div>

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?](https://discuss.aerospike.com/t/how-data-is-deleted/183).

---

<div class="post-metadata">

**Author:** ![denisbetsi](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@denisbetsi](https://discuss.aerospike.com/u/denisbetsi)\
**Post date:** [July 26, 2015, 5:43am UTC](https://discuss.aerospike.com/t/deleted-records-get-resurrected-after-a-restart/1510/3 "2015-07-26T05:43:07Z")

</div>

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?
