Skip to contentSkip to conversation

a metadata lost problem when mds breaks down

DISCUSSION Mark Meyers 2 participants 2 messages Aug 31, 2017 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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!

A message that is not in the archive (sent off-list or not yet received): 1228685801.457671.1504191723500-sAHhhX/[email protected]

#3 lore raw
Quoted 12 lines · Mark Meyers

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

Quoted 6 lines

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