Sync: Use fences for code snippets
@@ -21,14 +21,19 @@ add this plugin.
Just add this plugin to the list of plugins during mounting, e.g.
+```sh
kdb mount file.dump /important dump sync
+```
Then when you observe the change of a value, e.g.
+```sh
strace kdb set user/important/key value
+```
you can see, done by storage:
+```
open("/home/markus/.kdb/file.dump.16874:1409592592.95084.tmp",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
write(4, "kdbOpen 1\n", 10) = 10
@@ -38,16 +43,20 @@ you can see, done by storage:
write(4, "keyEnd\n", 7) = 7
write(4, "ksEnd\n", 6) = 6
close(4) = 0
+```
then done by sync:
+```
open("/home/markus/.kdb/file.dump.16874:1409592592.95084.tmp",
O_RDWR) = 4
fsync(4) = 0
close(4) = 0
+```
and finally commit + sync of directory by resolver:
+```
rename("/home/markus/.kdb/file.dump.16874:1409592592.95084.tmp",
"/home/markus/.kdb/file.dump") = 0
stat("/home/markus/.kdb/file.dump", {st_mode=S_IFREG|0644,
@@ -58,3 +67,4 @@ and finally commit + sync of directory by resolver:
open("/home/markus/.kdb",
O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fsync(3) = 0
+```
