Project

General

Profile

Bug #10164

Dirfrag objects for deleted dir not purged until MDS restart

Added by John Spray over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Seen while playing with the #9881 flush functionality: the dirfrag objects for deleted directories are never cleaned up after the directory is unlinked.

On a fresh vstart FS client mount:
$ mkdir alpha
$ rmdir alpha
$ sync

./ceph daemon mds.a flush journal
./rados -p cephfs_metadata ls | grep 10000000000
10000000000.00000000

...the object is still there for the dirfrag (including after waiting a while).

Restart the MDS, and the object is removed during MDCache::scan_stray_dir.

The log output from eval_stray indicates it's failing the in->dirfrags.empty() condition.

There is also another case where if there was a child file, and the client still holds the cap for the directory it just deleted (as the fuse client does), eval_stray fails on the in->is_any_caps condition.

Associated revisions

Revision 818a8073 (diff)
Added by Yan, Zheng over 9 years ago

mds: drop dirty dentries in deleted directory

opened dirfrags and null dirty dentries in deleted directory inode
prevent MDCache::eval_stray() from purging the delete inode.

It's safe to not commit null dirty dentries in deleted directory to
corresponding dirfrag objects, because these dirfrag objects will be
deleted soon.

Fixes: #10164
Signed-off-by: Yan, Zheng <>

History

#1 Updated by John Spray over 9 years ago

Alternatively less contrived way to see the issue: just do a loop of "cp -r /etc . ; rm -rf ./etc" in a filesystem mount, and watch the object count in the metadata pool tick ever upwards in 'ceph df'.

#2 Updated by John Spray over 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Zheng Yan

Zheng: assigning to you since you mentioned you were working on it

#3 Updated by Zheng Yan over 9 years ago

  • Status changed from In Progress to Fix Under Review

#4 Updated by Greg Farnum over 9 years ago

  • Status changed from Fix Under Review to Resolved

Merged to master as of commit:24ca9f1c259d6222b54290bc4ea2030f0271af8f.
Test run at http://pulpito.ceph.com/gregf-2014-12-08_12:26:05-fs-wip-10164-testing-basic-multi/

Also available in: Atom PDF