Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restarting of aerospike server reading older value

Tags:

java

aerospike

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?

like image 711
visingh Avatar asked Apr 05 '16 12:04

visingh


People also ask

How does TTL work in Aerospike?

Aerospike provides the ability to expire a record by setting its TTL (Time To Live) from a client. The TTL value is the number of seconds that a record will live (from the current time) before being removed by the server.

Is Aerospike multithreaded?

Aerospike is multithreaded — makes for the most effective usage of our resources. No downtime for master-replica synchronisations — you can configure the 'write' policy, so that the write-request is considered 'finished' after the replica creation confirmation.


1 Answers

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.

like image 79
Ben Bates Avatar answered Sep 24 '22 10:09

Ben Bates