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

fix(meta): create dentry concurrency cause orphan inodes #3233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjp00556
Copy link
Contributor

@sjp00556 sjp00556 commented Mar 11, 2024

Motivation

when concurrency create dentries with same parent and name will cause orphan inodes.

Modifications

when create dentry with same parent and name:

  • if inodes are same, it will return status OpOk to client, we can treat it as successful (fixed here: f55846a)
  • if inodes are not same, it will return proto.OpExistErr

so when we get OpExistErr, it means dentry must create failed, so we should unlink this inode to avoid orphan inode

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bugfix (non-breaking change which fixes an issue)
  • Documentation Update (if none of the other choices apply)
  • So on...

Verifying this change

  • Make sure that the change passes the testing checks.

This change is already covered by existing tests, such as (please describe tests).

Does this pull request potentially affect one of the following parts:

  • Master
  • MetaNode
  • DataNode
  • ObjectNode
  • AuthNode
  • LcNode
  • Blobstore
  • Client
  • Cli
  • SDK
  • Other Tools
  • Common Packages
  • Dependencies
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Review Expection

  • in-two-days
  • weeks
  • free-time
  • whenever

Copy link

netlify bot commented Mar 11, 2024

Deploy Preview for cubefs-check ready!

Name Link
🔨 Latest commit 03de9a9
🔍 Latest deploy log https://app.netlify.com/sites/cubefs-check/deploys/6628cd585b875200089fa133
😎 Deploy Preview https://deploy-preview-3233--cubefs-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sjp00556 sjp00556 changed the title fix(meta): create dentry concurrency cause orphan inodes fix(meta): create dentry concurrency cause orphan inodes Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 41.94%. Comparing base (bdffd66) to head (86696fc).
Report is 16 commits behind head on master.

❗ Current head 86696fc differs from pull request most recent head 03de9a9. Consider uploading reports for the commit 03de9a9 to get more accurate results

Files Patch % Lines
sdk/meta/api.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3233      +/-   ##
==========================================
+ Coverage   40.49%   41.94%   +1.44%     
==========================================
  Files         603      580      -23     
  Lines      125057   119697    -5360     
==========================================
- Hits        50643    50201     -442     
+ Misses      70051    65187    -4864     
+ Partials     4363     4309      -54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjp00556 sjp00556 force-pushed the create_orphan_inode branch 2 times, most recently from 1173df6 to 86696fc Compare March 11, 2024 10:40
Signed-off-by: sunjiapeng <782615313@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant