Skip to content

client: flush the caps release in filesystem sync - #58896

Merged
vshankar merged 1 commit into
ceph:mainfrom
xiubli:wip-67221
Aug 16, 2024
Merged

vshankar merged 1 commit into
ceph:mainfrom
xiubli:wip-67221

Conversation

@xiubli

@xiubli xiubli commented Jul 29, 2024 •

Copy link
Copy Markdown
Member

Fixes: https://tracker.ceph.com/issues/67221

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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
  • jenkins test rook e2e

@xiubli
xiubli requested a review from a team July 29, 2024 06:30
@github-actions github-actions Bot added the cephfs Ceph File System label Jul 29, 2024

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

Please explain the commit message regarding the idea behind the change.

@dparmar18

Copy link
Copy Markdown
Contributor

were there any problems uncovered due this @lxbsz ?

@dparmar18

Copy link
Copy Markdown
Contributor

In tracker you mentioned "Though the tick thread will do this but some times the tick could be stuck.", is it due to the thread entering sleep here?:

ceph/src/client/Client.cc

Lines 7119 to 7121 in 2fa0e43

ldout(cct, 20) << "upkeep thread waiting interval " << interval << dendl;
if (!tick_thread_stopped)
upkeep_cond.wait_for(cl, interval);

So maybe when the thread is sleeping, we're at a situation where the cap flush is needed but can't until the thread wakes up, but this should just be a slight delay i guess, shouldn't be that critical. What are other scenarios?

@xiubli

xiubli commented Jul 29, 2024

Copy link
Copy Markdown
Member Author

Please explain the commit message regarding the idea behind the change.

Done.

@xiubli

xiubli commented Jul 29, 2024

Copy link
Copy Markdown
Member Author

In tracker you mentioned "Though the tick thread will do this but some times the tick could be stuck.", is it due to the thread entering sleep here?:

ceph/src/client/Client.cc

Lines 7119 to 7121 in 2fa0e43

ldout(cct, 20) << "upkeep thread waiting interval " << interval << dendl;
if (!tick_thread_stopped)
upkeep_cond.wait_for(cl, interval);

So maybe when the thread is sleeping, we're at a situation where the cap flush is needed but can't until the thread wakes up, but this should just be a slight delay i guess, shouldn't be that critical. What are other scenarios?

Not sure, before I hit several times the tick thread was blocked for a long time, maybe over load or something else.

Here for this we just want to explicitly expose one method to flush the cap release manually to get rid of the cap revoke stuck bugs as we hit in https://tracker.ceph.com/issues/57244 many times before.

@xiubli

xiubli commented Jul 29, 2024

Copy link
Copy Markdown
Member Author

were there any problems uncovered due this @lxbsz ?

We have figured out there has a race between caps revoke and the cap release in kclient. Just want to expose one way to flush the cap releases manually to get rid of the bug.

@dparmar18

Copy link
Copy Markdown
Contributor

were there any problems uncovered due this @lxbsz ?

We have figured out there has a race between caps revoke and the cap release in kclient. Just want to expose one way to flush the cap releases manually to get rid of the bug.

So this is a temporary fix?

@vshankar

vshankar commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

@xiubli

xiubli commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

were there any problems uncovered due this @lxbsz ?

We have figured out there has a race between caps revoke and the cap release in kclient. Just want to expose one way to flush the cap releases manually to get rid of the bug.

So this is a temporary fix?

No, the caps releases also the metadata should be flushed when syncing the whole filesystem.

@xiubli

xiubli commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

jenkins test api

@xiubli

xiubli commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

jenkins test make check

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

LGTM, we need a mechanism to flush cap releases manually and till now we had none. Other thing is Client::sync_fs does flush the metadata logs at Client::flush_mdlog_sync but never did we flush the cap releases. This is adding the missing bit to the function.

@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

Copy link
Copy Markdown
Contributor

jenkins test make check

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test api

joscollin pushed a commit to joscollin/ceph that referenced this pull request Aug 14, 2024
* refs/pull/58896/head:
	client: flush the caps release in filesystem sync
@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

We have hit a race between cap releases and cap revoke request
that will cause the check_caps() to miss sending a cap revoke ack
to MDS. And the client will depend on the cap release to release
that revoking caps, which could be delayed for some unknown reasons.

In Kclient we have figured out the RCA about race and we need
a way to explictly trigger this manually could help to get rid
of the caps revoke stuck issue.

Fixes: https://tracker.ceph.com/issues/67221
Signed-off-by: Xiubo Li <[email protected]>
@vshankar

Copy link
Copy Markdown
Contributor

rebased and pushed for getting jenkins tests to pass.

@vshankar
vshankar merged commit 7ac44d6 into ceph:main Aug 16, 2024
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.

3 participants