EldoS | Feel safer!

Software components for data protection, secure storage and transfer

solfs in callback mode : how to implement 'snapshot' mechanism

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
Posted: 02/23/2015 08:55:55
by Miguel De Buf (Priority Standard support level)
Joined: 01/04/2007
Posts: 32


I am using solfs in callback mode, and want to implement snapshots.

1. Please tell me if this statement is correct : if I would restore all pages to the latest version before a flush() callback was called, then I have a consistent state for my storage.

2. Please tell me if this statement is also correct : if I would use a sequence number to generate a unique sequence number at each flush() callback, then I could use that number to identify a snapshot. I could then tag each page written using the current value of the sequence number. Going back to a previous snapshot would mean restoring all pages with a tag that is equal to or smaller than the snapshot.

My apologies, this is not clear from the documentation. I think this is correct, but would like to have a confirmation from you guys.
Posted: 02/23/2015 09:28:18
by Alexander Plas (Team)


1. SolFS may call flush callback few time during the transaction commit and there is no ability to pass the information about state of the storage to the callback. You may call StorageFlushBuffers function or equivalent method and at the moment of last call of flush callback the storage will be in consistent state. If you use OS edition the OS or any other process may perform some operations which will make the storage inconsistent.

2. This statement is correct.
Posted: 02/23/2015 10:04:12
by Miguel De Buf (Priority Standard support level)
Joined: 01/04/2007
Posts: 32

So, do you mean that :

1. To go from one consistent state to the next consistent state, there could be multiple flush() callbacks. So, somewhere in between the first and last flush(), the storage is inconsistent.

2. If journalling mode is enabled, and I go back to a previous snapshot (inconsistent flush), than journalling would automatically rollback the transaction so the storage goes back to the last consistent state.

If journalling mode is not enabled, I would simply be in an inconsistent state. How do I recover from that ? Is there a way to detect the state of the storage (consistent/inconsistent) ?

Posted: 02/23/2015 11:22:25
by Alexander Plas (Team)

1. Yes, that's right

2. That's right too.

Since you use callback mode, if the transactions is enabled you may analyze content of the second page in the storage. There are field which is empty in consistent state. If the transactions is disabled there is no ability to detect consistent state of the storage.



Topic viewed 3486 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!