md_src_plugins_sync_README(3) README

Usage

Just add this plugin to the list of plugins during mounting, e.g.

    kdb mount file.dump /important dump sync

Then when you observe the change of a value, e.g.

    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, 10)             = 10
    write(4, "ksNew 1, 8)                = 8
    write(4, "keyNew 19 6, 12)           = 12
    write(4, "user/important/key value , 26) = 26
    write(4, "keyEnd, 7)                 = 7
    write(4, "ksEnd, 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,
                    st_size=69, ...}) = 0
    fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0,
                    len=0}) = 0
    close(3)                                = 0
    open("/home/markus/.kdb",
                    O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
    fsync(3)                                = 0