Skip to content

crimson/osd/osd_operations: hang requests if the objects are unfound - #58148

Merged
Matan-B merged 2 commits into
ceph:mainfrom
xxhdx1985126:wip-65696
Aug 6, 2024
Merged

Matan-B merged 2 commits into
ceph:mainfrom
xxhdx1985126:wip-65696

Conversation

@xxhdx1985126

Copy link
Copy Markdown
Member

Fixes: https://tracker.ceph.com/issues/65696
Signed-off-by: Xuehan Xu [email protected]

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

@xxhdx1985126
xxhdx1985126 force-pushed the wip-65696 branch 2 times, most recently from 7d40ed4 to fe8d38e Compare June 26, 2024 02:21
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@Matan-B @athanatos I've just modified the code as suggested, please take a look again, thanks:-)

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

Great solution :) few comments

Comment thread src/crimson/osd/recovery_backend.h Resolved
Comment thread src/crimson/osd/recovery_backend.h Outdated
Comment on lines 106 to 113

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.

We should probably make sure that we drop the waiting requests in this case. I'm not sure this is handled, am I missing something?

@xxhdx1985126 xxhdx1985126 Jun 28, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think, by setting exceptions to the unfound promises, requests waiting on it will receive the exceptions, so the whole rest of the client request processing will be skipped, which I think is equivalent to dropping the requests. Am I right?

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.

Yes, this is right. My concern is whether client request actually handles exceptions correctly by dropping them. What do you think?

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.

Since the client request code is now using coroutines, IIUC, exceptions should be handled explicitly (aka by try-catch). See: https://docs.seastar.io/master/tutorial.html#exceptions-in-coroutines
(CC: @athanatos)

My suggestion is to change add_unfound to return ertr instead. That way, we could handle the error explicitly without try-catch.

    auto unfound = co_await do_recover_missing(
      pg, m->get_hobj().get_head(), m->get_reqid());
    if (unfound) {
      DEBUGDPP("{} unfound, hang it for now", *pg, m->get_hobj().get_head());
      co_await
        pg->get_recovery_backend()->add_unfound(m->get_hobj().get_head())
        ).handle_error_interruptible(... {
          DEBUG("dropping ...");
          co_return;
        });
    }

We can also catch the exceptions from the couroutine in order to drop the requests instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will do.

@xxhdx1985126 xxhdx1985126 Jul 1, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since the client request code is now using coroutines, IIUC, exceptions should be handled explicitly (aka by try-catch). See: https://docs.seastar.io/master/tutorial.html#exceptions-in-coroutines (CC: @athanatos)

My suggestion is to change add_unfound to return ertr instead. That way, we could handle the error explicitly without try-catch.

    auto unfound = co_await do_recover_missing(
      pg, m->get_hobj().get_head(), m->get_reqid());
    if (unfound) {
      DEBUGDPP("{} unfound, hang it for now", *pg, m->get_hobj().get_head());
      co_await
        pg->get_recovery_backend()->add_unfound(m->get_hobj().get_head())
        ).handle_error_interruptible(... {
          DEBUG("dropping ...");
          co_return;
        });
    }

We can also catch the exceptions from the couroutine in order to drop the requests instead.

@Matan-B After a second thought, the exception "system_shutdown_exception" we set to the unfound promises is actually an interrupt that will be handle by the interruptor::with_interruption() method. So, we are not leaking any exceptions.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-65696 branch 2 times, most recently from f2d1c58 to b62e12e Compare June 28, 2024 02:26
@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test make check

@xxhdx1985126

Copy link
Copy Markdown
Member Author

@Matan-B I added an extra commit in which the exceptions set to recovery promises are changed to another interruption actingset_changed, please take a look, thanks.

@Matan-B Matan-B 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, just a few questions

Comment thread src/crimson/osd/recovery_backend.h Resolved
Comment thread src/crimson/osd/recovery_backend.h Resolved
Comment thread src/crimson/osd/recovery_backend.h Resolved
@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test make check

@Matan-B

Matan-B commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

@Matan-B

Matan-B commented Jul 7, 2024 •

Copy link
Copy Markdown
Contributor

@Matan-B

Matan-B commented Jul 11, 2024 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Matan-B

Matan-B commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

Rebased

@xxhdx1985126

Copy link
Copy Markdown
Member Author

Rebased

Thanks:-)

@Matan-B

Matan-B commented Aug 6, 2024

Copy link
Copy Markdown
Contributor

@Matan-B
Matan-B merged commit d91864f into ceph:main Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants