Skip to content

mds: wait for unlink operation to finish - #47399

Merged
vshankar merged 2 commits into
ceph:mainfrom
xiubli:wip-56695
Apr 10, 2023
Merged

vshankar merged 2 commits into
ceph:mainfrom
xiubli:wip-56695

Conversation

@xiubli

@xiubli xiubli commented Aug 2, 2022

Copy link
Copy Markdown
Member

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 [email protected]

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

@xiubli
xiubli 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
Comment thread src/mds/CInode.h Resolved
@xiubli
xiubli force-pushed the wip-56695 branch 2 times, most recently from 32ec0c4 to aabf691 Compare August 3, 2022 04:16
Comment thread src/mds/Server.cc Resolved

@batrick batrick left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

@xiubli

xiubli commented Aug 18, 2022 •

Copy link
Copy Markdown
Member Author

@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.

@xiubli

xiubli commented Aug 19, 2022

Copy link
Copy Markdown
Member Author

@vshankar

Copy link
Copy Markdown
Contributor

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

Will review it today.

@vshankar

vshankar commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

@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

@xiubli

xiubli commented Mar 7, 2023

Copy link
Copy Markdown
Member Author

@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
Comment thread src/mds/Server.cc Resolved
@xiubli
xiubli 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
@xiubli

xiubli commented Mar 14, 2023

Copy link
Copy Markdown
Member Author

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.

@xiubli
xiubli force-pushed the wip-56695 branch 3 times, most recently from 7e7f7c6 to 9506b4d Compare March 16, 2023 04:33
@xiubli

xiubli commented Mar 16, 2023 •

Copy link
Copy Markdown
Member Author

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 <[email protected]>
@xiubli

xiubli commented Mar 17, 2023 •

Copy link
Copy Markdown
Member Author

@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

vshankar commented Mar 17, 2023 •

Copy link
Copy Markdown
Contributor

@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.

@xiubli

xiubli commented Mar 23, 2023 •

Copy link
Copy Markdown
Member Author

@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.

@xiubli

xiubli commented Mar 23, 2023

Copy link
Copy Markdown
Member Author

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

vshankar commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

@vshankar

vshankar commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

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

vshankar commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

jenkins test windows

@vshankar

vshankar commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

jenkins make check arm64

1 similar comment
@xiubli

xiubli commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

jenkins make check arm64

@xiubli

xiubli commented Apr 6, 2023

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@vshankar

vshankar commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

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
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 <[email protected]>
Reviewed-by: Venky Shankar <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Rishabh Dave <[email protected]>
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

Development

Successfully merging this pull request may close these issues.

6 participants