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

curvefs: fix trash will delete file data more than once #2938

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented Nov 30, 2023

What problem does this PR solve?

#2774

Issue Number: #xxx

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@SeanHai
Copy link
Contributor Author

SeanHai commented Nov 30, 2023

cicheck

}

void TrashImpl::ScanTrash() {
LockGuard lgScan(scanMutex_);
// only scan on leader
if (copysetNode_ == nullptr || !copysetNode_->IsLeaderTerm()) {
Copy link
Member

@xu-chaojie xu-chaojie Dec 1, 2023

Choose a reason for hiding this comment

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

The following loop also needs to be interrupted when the node is not the leader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


DeleteInodeResponse response;
DeleteInodeClosure done;
auto DeleteInodeOp = new copyset::DeleteInodeOperator(
Copy link
Member

Choose a reason for hiding this comment

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

Where is this op implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This operation originally existed and was used to delete the remaining inodes after the creation process failed.

class DeleteInodeOperator : public MetaOperator {

<< ", inodeId = " << it->inodeId;
LOG(INFO) << "Trash delete inode, fsId = " << fsId_
<< ", partitionId = " << partitionId_
<< ", inodeId = " << it->inodeId;
it = temp.erase(it);
Copy link
Member

Choose a reason for hiding this comment

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

How to remove trash items on the follower side

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, it will delete in InodeManagger::DeleteInode

@SeanHai
Copy link
Contributor Author

SeanHai commented Dec 4, 2023

cicheck

@SeanHai SeanHai merged commit bfd5acb into opencurve:master Dec 5, 2023
4 checks passed
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.

3 participants