7

I am using aerospike cluster with storage mechanism SSD. I have updated some key but when i restarted aerospike cluster it restoring previous value in place of new value.

WritePolicy writePolicy = new WritePolicy();
writePolicy.recordExistsAction = RecordExistsAction.UPDATE;
writePolicy.generationPolicy = GenerationPolicy.NONE;
Bin whiteList = Bin.asNull("bin1");
Bin blackList = Bin.asNull("bin2");

client.put(writePolicy, key, whiteList, blackList);

I just want last updated value for given key after server restart in place of older value.

How can i handle this case?

visingh
  • 233
  • 3
  • 17
  • Is this happening all the time or on coldstart only? – Ben Bates Apr 05 '16 at 13:56
  • 1
    Hi @BenBates i checked it for coldstart. Fast start is only available for enterprise edition but currently i am using Community Edition. Is there any other way to do this in Community Edition? – visingh Apr 05 '16 at 18:42
  • No, this is most likely going to be your issue. Durable deletes are on the roadmap for this year, which would be the way forward. I do not know - at this stage - whether this would be an Enterprise only feature. – Ben Bates Apr 08 '16 at 09:36

2 Answers2

1

I suspect you are hitting a well documented behaviour on cold starts as described here:

https://discuss.aerospike.com/t/expired-deleted-data-reappears-after-server-is-restarted/470/2

When Aerospike cold starts it reads data back from disk. When a record is deleted the reference to that record is removed from the index. When looking at the disk in isolation the database has no way of knowing if the record it reads from disk is deleted (as the index is in memory and by definition unavailable)

For this reason 'ghost' records can seem to re-appear on cold start. This is going to be addressed very soon with 'durable' deletes.

Ben Bates
  • 707
  • 3
  • 7
0

One possible answer may be that the nodes in the cluster are not in sync and value fetching from a non-updated node. So make sure you got synced all the nodes in the cluster before executing query.

shubham12511
  • 620
  • 1
  • 9
  • 25