Question about persistence and data loss during node crashing
I'm a little bit confused about the couchbase bucket's persistence logic (especially in cases of node crashing). Not exactly sure what happens to the data already persisted (or partialy persisted) to a disk in several different scenarios. I'll give you examples.
Let's say I have a very simple configuration with only one node, only one couchbase bucket and no replication settings at all. And I also have an application that is trying to execute the following sequence of actions:
1. adding a new document X with value "x"
2. replacing the value of X with new value "y"
3. removing the document X by calling "delete"
When suddenly! Crashing event happens causing the node to reboot instantly and completely.
What state of data can I actually have after the reboot considering asynchronous nature of flushing to the disk?
From what I understand from the documentation sections the following statements seem valid:
A. reboot between 1 and 2 and before (or in the proccess of) flushing to the disk leaves me with no document X at all
B. reboot between 1 and 2 and after flushing to the disk - document X with "x" value
C. reboot between 2 and 3 and before (or in the proccess of) flushing to the disk - document X with "x" value (The C statement is the most confusing one.)
D. reboot between 2 and 3 and after flushing to the disk - document X with "y" value
E. reboot after 3 and before flushing to the disk - document X with "y" value
F. reboot after 3 and after flushing to the disk - no document X
Or these are not true?
It would be great if someone could clarify this topic to me :)