Skip to content

Commit

Permalink
mds: avoid killing dead requests
Browse files Browse the repository at this point in the history
This is important when you have:

* sub-op A finishes and resumes parent
* parent kills all sub-ops (including sub-op A)

Signed-off-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Mar 20, 2024
1 parent 9956f9a commit b72e153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9864,6 +9864,8 @@ void MDCache::request_cleanup(const MDRequestRef& mdr)
{
dout(15) << "request_cleanup " << *mdr << dendl;

mdr->dead = true;

if (mdr->has_more()) {
if (mdr->more()->is_ambiguous_auth)
mdr->clear_ambiguous_auth();
Expand Down Expand Up @@ -9904,7 +9906,7 @@ void MDCache::request_cleanup(const MDRequestRef& mdr)

void MDCache::request_kill(const MDRequestRef& mdr)
{
if (mdr->killed) {
if (mdr->killed || mdr->dead) {
/* ignore duplicate kills */
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/mds/Mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ struct MutationImpl : public TrackedOp {
bool committing = false;
bool aborted = false;
bool killed = false;
bool dead = false;

// for applying projected inode changes
std::set<MDSCacheObject*> projected_nodes;
Expand Down

0 comments on commit b72e153

Please sign in to comment.