Bug #46273
Updated by Patrick Donnelly almost 4 years ago
Log as follow: <pre> 2020-06-18 15:32:20.706904 7f1fe9f54700 1 mds.2.cache.dir(0x2000255af08.100*) commit error -2 v 1248554 2020-06-18 15:32:20.706914 7f1fe9f54700 -1 log_channel(cluster) log [ERR] : failed to commit dir 0x2000255af08.100* object, errno -2 2020-06-18 15:32:20.706921 7f1fe9f54700 -1 mds.2.334296 unhandled write error (2) No such file or directory, force readonly... 2020-06-18 15:32:20.706929 7f1fe9f54700 1 mds.2.cache force file system read-only </pre> The reason is that deleting files in a directory until it meets the merge condition, the merge operation will merge multiple subfrags into a basefrag, and create basedir for basefrag, then call steal_dentry to moves the dentries under subdir to basedir. When commit the basedir, the dentries under basedir will satisfies the condition: dn->is_dirty() && dn->get_linkage()->is_null(), so the OMAP request type is CEPH_OSD_OP_OMAPRMKEYS, When OSD processes this request, it thinks that the object corresponding to basedir must exist (in fact, it does not exist), and returns error - 2.