Skip to content
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

mds: wait for unlink operation to finish #47399

Merged
merged 2 commits into from Apr 10, 2023
Merged

mds: wait for unlink operation to finish #47399

merged 2 commits into from Apr 10, 2023

Conversation

lxbsz
Copy link
Member

@lxbsz lxbsz commented Aug 2, 2022

If the previous unlink is not finished yet but the corressponding
inode has been projected and it dentry parent has been changed to
stray. The new comming link request will fail with -EXDEV.

Just wait the previous unlink to finish and unlink the dn from
parent directory.

https://tracker.ceph.com/issues/56695
Signed-off-by: Xiubo Li xiubli@redhat.com

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@lxbsz lxbsz requested a review from a team August 2, 2022 06:28
@github-actions github-actions bot added the cephfs Ceph File System label Aug 2, 2022
src/mds/CInode.h Outdated Show resolved Hide resolved
@lxbsz lxbsz force-pushed the wip-56695 branch 2 times, most recently from 32ec0c4 to aabf691 Compare August 3, 2022 04:16
Copy link
Member

@batrick batrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done tracking that down!!

@vshankar vshankar changed the title mds: wait the unlink to finish mds: wait for unlink operation to finish Aug 11, 2022
@vshankar
Copy link
Contributor

@lxbsz This change seems to be causing fsstress.sh failures here: https://pulpito.ceph.com/vshankar-2022-08-12_09:34:24-fs-wip-vshankar-testing1-20220812-072441-testing-default-smithi/ (check for fsstress.sh failures)

Without this changes, there are no such failures: https://pulpito.ceph.com/vshankar-2022-08-18_04:30:42-fs-wip-vshankar-testing1-20220818-082047-testing-default-smithi/

Please take a look.

@lxbsz
Copy link
Member Author

lxbsz commented Aug 18, 2022

@lxbsz This change seems to be causing fsstress.sh failures here: https://pulpito.ceph.com/vshankar-2022-08-12_09:34:24-fs-wip-vshankar-testing1-20220812-072441-testing-default-smithi/ (check for fsstress.sh failures)

Without this changes, there are no such failures: https://pulpito.ceph.com/vshankar-2022-08-18_04:30:42-fs-wip-vshankar-testing1-20220818-082047-testing-default-smithi/

Please take a look.

We need to check the strayin to make sure it's not nullptr when dereferencing it.

Fixed it and I will run the fsstress.sh qa tests.

@lxbsz
Copy link
Member Author

lxbsz commented Aug 19, 2022

@vshankar
Copy link
Contributor

need to check the strayin to make sure it's not nullptr when dereferencing it.

Will review it today.

@vshankar
Copy link
Contributor

vshankar commented Mar 7, 2023

@lxbsz I'm seeing failures which should have been fixed by this change. See: https://pulpito.ceph.com/vshankar-2023-03-07_05:15:12-fs-wip-vshankar-testing-20230307.030510-testing-default-smithi/7195941/

2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ expect 0 link fstest_6f263add3ff59b7ee938215207ed44e0 _123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123
456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_1234567
89_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234567
89_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1
23456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12345
6789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12/x
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ e=0
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ shift
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:++ /home/ubuntu/cephtest/mnt.0/client.0/tmp/tmp/../pjd-fstest-20090130-RC/tests/link/../../fstest link fstest_6f263add3ff59b7ee938215207ed44
e0 _123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456
789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_
123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234
56789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_12345678
9_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12/x
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:++ tail -1
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ r=EXDEV
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ echo EXDEV
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ egrep '^0$'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ '[' 1 -eq 0 ']'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ echo 'not ok 8'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:++ expr 8 + 1
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ ntest=9

@lxbsz
Copy link
Member Author

lxbsz commented Mar 7, 2023

@lxbsz I'm seeing failures which should have been fixed by this change. See: https://pulpito.ceph.com/vshankar-2023-03-07_05:15:12-fs-wip-vshankar-testing-20230307.030510-testing-default-smithi/7195941/

2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ expect 0 link fstest_6f263add3ff59b7ee938215207ed44e0 _123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123
456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_1234567
89_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234567
89_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1
23456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12345
6789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12/x
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ e=0
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:+ shift
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:++ /home/ubuntu/cephtest/mnt.0/client.0/tmp/tmp/../pjd-fstest-20090130-RC/tests/link/../../fstest link fstest_6f263add3ff59b7ee938215207ed44
e0 _123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456
789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_
123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234
56789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_1234/_123456789_123456789_123456789_123456789_123456789_123456789_12345678
9_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_12/x
2023-03-07T06:05:57.980 INFO:tasks.workunit.client.0.smithi088.stderr:++ tail -1
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ r=EXDEV
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ echo EXDEV
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ egrep '^0$'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ '[' 1 -eq 0 ']'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ echo 'not ok 8'
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:++ expr 8 + 1
2023-03-07T06:05:57.981 INFO:tasks.workunit.client.0.smithi088.stderr:+ ntest=9

Okay, I will check this tomorrow. Thanks.

@vshankar vshankar added wip-vshankar-backlog Backlog of CephFS PRs to pick for testing and removed wip-vshankar-testing1 labels Mar 7, 2023
src/mds/Server.cc Outdated Show resolved Hide resolved
@lxbsz lxbsz requested a review from vshankar March 8, 2023 04:36
@vshankar vshankar removed the wip-vshankar-backlog Backlog of CephFS PRs to pick for testing label Mar 8, 2023
@vshankar vshankar added wip-vshankar-testing2 and removed wip-vshankar-backlog Backlog of CephFS PRs to pick for testing labels Mar 13, 2023
@lxbsz
Copy link
Member Author

lxbsz commented Mar 14, 2023

We need to drop the locks before queue it into waiter list:

+ mds->locker->drop_locks(mdr.get());

I am running the test.

@vshankar Let me run the pjd tests first before you run more tests. Will ping you after it succeeds.

In the else scope the remote_dn must be non-auth.

https://tracker.ceph.com/issues/56695
Signed-off-by: Xiubo Li <xiubli@redhat.com>
@lxbsz lxbsz force-pushed the wip-56695 branch 3 times, most recently from 7e7f7c6 to 9506b4d Compare March 16, 2023 04:33
@lxbsz
Copy link
Member Author

lxbsz commented Mar 16, 2023

Updated it. We need to wait for the unlink to finish until the stray dentry to be unlinked from the corresponding inode, or we still could hit the same issue.

There have 3 cases:
(1), the nlink > 1 and the other links dentries are also in local mds, we need to wait the linkmerge to finish.
(2), the nlink > 1 and the other link dentries are in other mds, we need to wait the migrate to finish
(3), the nlink = 1 but the clients pass one invalidate ino, we will try to wake up the waiter after the stray dentry get purged.

I am still testing it.

If one inode has more than one link and after one of its dentries
being unlinked it will be moved to stray directory. Before the
linkmerge/migrate finises if a link request comes it will fail
with -EXDEV.

While in non-multiple link case it's also possible that the clients
could pass one invalidate ino, which is still under unlinking.

Just wait the linkmerge/migrate or purge to finish.

https://tracker.ceph.com/issues/56695
Signed-off-by: Xiubo Li <xiubli@redhat.com>
@lxbsz
Copy link
Member Author

lxbsz commented Mar 17, 2023

@vshankar The pjd.sh test itself passed in my tests. But the qa infra seems having other irrelevant issues and took a long time and died or failed.

I have also tried to run the same tests by reverting these patches in this PR still have the same issue and took a long time, till now one has died and the others still running.

I am not sure whether my qa test commands' issue or not. Could you add this into your next test ?

@vshankar
Copy link
Contributor

vshankar commented Mar 17, 2023

@vshankar The pjd.sh test itself passed in my tests. But the qa infra seems having other irrelevant issues and took a long time and died or failed.

I have also tried to run the same tests by reverting these patches in this PR still have the same issue and took a long time, till now one has died and the others still running.

I am not sure whether my qa test commands' issue or not. Could you add this into your next test ?

Sure. I think your change in #47399 (comment) would fix the pending issue. I'll include this change in my next run.

@lxbsz
Copy link
Member Author

lxbsz commented Mar 23, 2023

@vshankar The pjd.sh test itself passed in my tests. But the qa infra seems having other irrelevant issues and took a long time and died or failed.
I have also tried to run the same tests by reverting these patches in this PR still have the same issue and took a long time, till now one has died and the others still running.
I am not sure whether my qa test commands' issue or not. Could you add this into your next test ?

Sure. I think your change in #47399 (comment) would fix the pending issue. I'll include this change in my next run.

Today I checked the qa test failures again carefully. All the pjd.sh test passed and the client was also successfully unmounted very fast. But when tearing down the ceph cluster it was stuck when removing the osd.6 daemon. The MDS, MON, MGR and OSD.{0~5} daemons were all successfully destroyed without any issue before that.

@lxbsz
Copy link
Member Author

lxbsz commented Mar 23, 2023

destroyed

@vshankar The pjd.sh test itself passed in my tests. But the qa infra seems having other irrelevant issues and took a long time and died or failed.
I have also tried to run the same tests by reverting these patches in this PR still have the same issue and took a long time, till now one has died and the others still running.
I am not sure whether my qa test commands' issue or not. Could you add this into your next test ?

Sure. I think your change in #47399 (comment) would fix the pending issue. I'll include this change in my next run.

Today I checked the qa test failures again carefully. All the pjd.sh test passed and the client was also successfully unmounted very fast. But when tearing down the ceph cluster it was stuck when removing the osd.6 daemon. The MDS, MON, MGR and OSD.{0~5} daemons were all successfully destroyed without any issue before that.

Run the tests again twice by pulling the latest teuthology repo the tests passed:

https://pulpito.ceph.com/xiubli-2023-03-23_04:49:00-fs:workload-wip-20230316-1328-unlink-distro-default-smithi/
https://pulpito.ceph.com/xiubli-2023-03-23_04:47:23-fs:workload-wip-20230316-1328-unlink-distro-default-smithi/

@vshankar
Copy link
Contributor

vshankar commented Apr 3, 2023

fs suite run: https://pulpito.ceph.com/?branch=wip-vshankar-testing-20230330.105356

(test run review is in progress - will update once done)

@vshankar
Copy link
Contributor

vshankar commented Apr 5, 2023

fs suite run: https://pulpito.ceph.com/?branch=wip-vshankar-testing-20230330.105356

(test run review is in progress - will update once done)

The pjd failures are fixed - nice work @lxbsz

@vshankar
Copy link
Contributor

vshankar commented Apr 5, 2023

jenkins test windows

@vshankar
Copy link
Contributor

vshankar commented Apr 6, 2023

jenkins make check arm64

1 similar comment
@lxbsz
Copy link
Member Author

lxbsz commented Apr 6, 2023

jenkins make check arm64

@lxbsz
Copy link
Member Author

lxbsz commented Apr 6, 2023

jenkins test make check arm64

@vshankar
Copy link
Contributor

vshankar commented Apr 6, 2023

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vshankar vshankar merged commit afb6b17 into ceph:main Apr 10, 2023
5 checks passed
yuvalif pushed a commit to yuvalif/ceph that referenced this pull request Apr 30, 2023
* refs/pull/47399/head:
	mds: wait the linkmerge/migrate to finish after unlink
	mds: remove false is_auth() check for remote_dn

Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Rishabh Dave <ridave@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cephfs Ceph File System
Projects
None yet
6 participants