How to promise Data consistent when Recipe for an HDD Storage Engine with Data in Memory

namespace test { replication-factor 2 memory-size 1G default-ttl 30d # 5 days, use 0 to never expire/evict.

#	storage-engine memory

# To use file storage backing, comment out the line above and use the
# following lines instead.

storage-engine device {
	file /opt/aerospike/data/test.dat
	filesize 4G
	data-in-memory true # Store data in memory in addition to file.
}

} https://www.aerospike.com/docs/operations/configure/namespace/storage/index.html#recipe-for-an-hdd-storage-engine-with-data-in-memory

When recipe for an HDD Storage Engine with Data in Memory,user read/write request only behave on memory and use asynchronous way to write data into disk.I found aerospike still works when I make disk failure(just like delete data file).So how aerospike confirm Data in memory consistent with Data file in the disk in above storage mode?

This isn’t disk failure. Aerospike still has a reference to this file so the filesystem hasn’t deleted it completely. You just cannot see it in the directory anymore. If you want to simulate this type of disk failure try unmounting the disk.

If you are interested in consistency then you will need to look into strong-consistency which includes an option for commit-to-device.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.