On Thu, 31 Aug 2017, Mark Meyers wrote: > Hi: > > I encountered a metadata lost problem of files when testing the outcome of ceph mds's unpredictable breakdown. > The test shell script is like(not real code): > > while i < 100000 > do > touch $i > i++ > done > echo c > /proc/sysrq-trigger > > The script is run in the same machine which mds is running on, and the directory is mount point of cephfs. > I created 10,000 files using touch command and forced the system to break down. > When the machine rebooted again, the number of new files created is smaller than 10000. So the metadata of those files are lost. > My question: Are those losts of metadata allowed by ceph? Or is this a bug of ceph mds which could be solved in the future? My ceph version is 12.1.0, ubuntu kernel version 4.4.0. > > Thanks for your reading, I really appreciate your rely. Thanks! You have to call fsync(2) on the containing directory if you want metadata changes (link, unlink, rename, create, mknod, open(...O_CREAT)) to be stable... just like you have to call fsync(2) after write(2) if you want the data to be durable. In the case of creating a file, calling fsync() on the new file is also sufficient to make the new file exist (on most file systems, including CephFS). sage _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com