New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph: simplify CInode::maybe_export_pin() #15106

Merged
merged 2 commits into from May 24, 2017

Conversation

Projects
None yet
3 participants
@ukernel
Member

ukernel commented May 16, 2017

move most works into MDBalancer::handle_export_pins(), this simplifies
the code a lot.

Another reason for this change is that creating aux subtree directly in
CInode::maybe_export_pin() confuses journal replay (the subtree map check
when replaying ESubtreeMap).

Signed-off-by: "Yan, Zheng" zyan@redhat.com

ceph: simplify CInode::maybe_export_pin()
move most works into MDBalancer::handle_export_pins(), this simplifies
the code a lot.

Another reason for this change is that creating aux subtree directly in
CInode::maybe_export_pin() confuses journal replay (the subtree map check
when replaying ESubtreeMap).

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>

@ukernel ukernel added the cephfs label May 16, 2017

@ukernel ukernel requested a review from batrick May 16, 2017

@batrick

Looks simpler to me. I'm only a little worried some corner cases may be missed but I don't see any problems right now.

queue = dir->state_test(CDir::STATE_AUXSUBTREE);
}
if (queue) {
get(CInode::PIN_EXPORTPINQUEUE);

This comment has been minimized.

@batrick

batrick May 16, 2017

Member

I believe this new pin would prevent an inode pinned to a (currently) non-existent rank from ever being evicted from the cache, right?

This comment has been minimized.

@ukernel

ukernel May 17, 2017

Member

It gets unpinned after MDBalancer::handle_export_pins() processes it

This comment has been minimized.

@ukernel

ukernel May 17, 2017

Member

it get unpinned after MDBalancer::handle_export_pins() processes it

This comment has been minimized.

@batrick

batrick May 17, 2017

Member

Right, but because it's never removed from the queue (because it can't be exported) and is pinned, it cannot be removed from the cache? Right?

if (export_pin == MDS_RANK_NONE) {
if (dir->state_test(CDir::STATE_AUXSUBTREE)) {
if (dir->is_frozen() || dir->is_freezing()) {

This comment has been minimized.

@batrick

batrick May 16, 2017

Member

Does this also catch amibuous auth on the parent subtree? (i.e. if the subtree is ambiguous then it must be frozen?)

This comment has been minimized.

@ukernel

ukernel May 17, 2017

Member

If parent subtree is being exported, the dirfrag has CDir::STATE_EXPORTBOUND set. clearing CDir::STATE_AUXSUBTREE shouldn't be problem

This comment has been minimized.

@ukernel

ukernel May 17, 2017

Member

yes, subtree is ambiguous then it must be frozen

mds: don't pin inodes in MDCache::export_pin_queue
pinning inode can trigger assertion when replaying log

 1: (()+0x560ceb) [0x55b263ff7ceb]
 2: (()+0x115c0) [0x7fc0393a75c0]
 3: (gsignal()+0x9f) [0x7fc03812f91f]
 4: (abort()+0x16a) [0x7fc03813151a]
 5: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x2bc) [0x55b26404158c]
 6: (MDCache::remove_inode(CInode*)+0x316) [0x55b263d9c616]
 7: (MDCache::trim_non_auth_subtree(CDir*)+0x4d8) [0x55b263d9cd68]
 8: (MDCache::try_trim_non_auth_subtree(CDir*)+0x5e2) [0x55b263da7292]
 9: (EExport::replay(MDSRank*)+0x549) [0x55b263fdc619]
 10: (MDLog::_replay_thread()+0xd0f) [0x55b263f8580f]
 11: (MDLog::ReplayThread::entry()+0xd) [0x55b263cebbfd]
 12: (()+0x76ca) [0x7fc03939d6ca]
 13: (clone()+0x5f) [0x7fc038201f7f]

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
@batrick

This comment has been minimized.

Member

batrick commented May 17, 2017

The change to not pin inodes looks good to me but I'm wondering why we need the CInode::STATE_QUEUEDEXPORTPIN at all. Isn't it sufficient to just look at the export_pin_queue?

@ukernel

This comment has been minimized.

Member

ukernel commented May 18, 2017

checking flag is faster than removing item from export_pin_queue

@jcsp

This comment has been minimized.

Contributor

jcsp commented May 23, 2017

retest this please (jenkins)

@jcsp jcsp merged commit 6ca92c5 into ceph:master May 24, 2017

2 of 3 checks passed

default Build finished.
Details
Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details

@ukernel ukernel deleted the ukernel:wip-export-pin-cleanup branch Jun 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment